From 6fe748eaad1849a27006d1c49aefde670a297e6c Mon Sep 17 00:00:00 2001 From: Dadmehr <134191240+BDadmehr0@users.noreply.github.com> Date: Sat, 9 Sep 2023 00:04:00 +0330 Subject: [PATCH] install.sh update --- fishy/helper/config.py | 2 ++ install.sh | 6 +++--- requirements.txt | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fishy/helper/config.py b/fishy/helper/config.py index 5d2e386..e9006e7 100644 --- a/fishy/helper/config.py +++ b/fishy/helper/config.py @@ -5,6 +5,7 @@ Saves configuration in file as json file import json import logging import os +from subprocess import run # path to save the configuration file from typing import Optional @@ -79,6 +80,7 @@ class Config: logging.debug("config stopped") def _create_backup(self): + chmod = run(['sudo', 'chmod', '+w', '/tmp']) with open(temp_file, 'w') as f: f.write(json.dumps(self._config_dict)) logging.debug("created backup") diff --git a/install.sh b/install.sh index 64f9b8b..07d38ae 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ if [ -e /etc/os-release ]; then distro_info=$(cat /etc/os-release) - if [[ $distro_info == *"Manjaro"* ]]; then + if [[ $distro_info == *"arch"* ]]; then echo "OS Manjaro: installing tk, python, python-pip, wmctrl" sudo pacman -Sy @@ -11,7 +11,7 @@ if [ -e /etc/os-release ]; then sudo pacman -S python sudo pacman -S python-pip sudo pacman -S wmctrl - elif [[ $distro_info == *"Ubuntu"* ]]; then + elif [[ $distro_info == *"debian"* ]]; then echo "OS Ubuntu: installing tk, python, python-pip, wmctrl" sudo apt update @@ -20,7 +20,7 @@ if [ -e /etc/os-release ]; then sudo apt-get install python-pip sudo apt install wmctrl - elif [[ $distro_info == *"Fedora"* ]]; then + elif [[ $distro_info == *"red hat"* ]]; then echo "OS Fedora: installing tk, python, python-pip, wmctrl" sudo dnf update diff --git a/requirements.txt b/requirements.txt index a0a2797..0a356cc 100755 --- a/requirements.txt +++ b/requirements.txt @@ -16,3 +16,4 @@ event-scheduler mouse pyautogui mss +pyxdg \ No newline at end of file