1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159 | diff --git a/install.py b/install.py
index ba54d48..2c5ef56 100644
--- a/install.py
+++ b/install.py
@@ -1,5 +1,11 @@
import os
+os.system(
+ 'sudo -k > /dev/null 2>&1 && sudo -v -p "[*]- Please enter password: " > /dev/null 2>&1'
+)
+print("")
+
+
def get_distro():
if os.path.isfile("/etc/os-release"):
with open("/etc/os-release") as f:
@@ -11,7 +17,8 @@ def get_distro():
result = stream.read().strip()
if result:
return result.split(":")[1].strip()
- return "unknown"
+ print("unknown distro !!")
+ return 1
distro = get_distro()
@@ -20,30 +27,26 @@ distro = get_distro()
def install_pip():
exit_code = os.system("pip3 --version > /dev/null 2>&1")
if exit_code == 0:
- print("Pip: Done")
+ print("[*]- pip is installed !!")
else:
- print("pip not found. Installing pip...")
+ print("[*]- Pip not found. Installing pip...")
+ print("[*]- wait...")
if distro in ["ubuntu", "debian"]:
os.system("sudo apt-get update")
os.system("sudo apt-get install -y python3-pip > /dev/null 2>&1")
- os.system("clear")
- print("Pip: Done")
+ print("[*]- pip installed Successfully !!")
elif distro == "fedora":
os.system("sudo dnf install -y python3-pip > /dev/null 2>&1")
- os.system("clear")
- print("Pip: Done")
+ print("[*]- pip installed Successfully !!")
elif distro in ["centos", "rhel"]:
os.system("sudo yum install -y python3-pip > /dev/null 2>&1")
- os.system("clear")
- print("Pip: Done")
+ print("[*]- pip installed Successfully !!")
elif distro == "arch":
os.system("sudo pacman -S --noconfirm python-pip > /dev/null 2>&1")
- os.system("clear")
- print("Pip: Done")
+ print("[*]- pip installed Successfully !!")
elif distro == "void":
os.system("sudo xbps-install -y python3-pip > /dev/null 2>&1")
- os.system("clear")
- print("Pip: Done")
+ print("[*]- pip installed Successfully !!")
else:
print("Unsupported distribution. Please install pip manually.")
exit(1)
@@ -52,34 +55,47 @@ def install_pip():
def install_system_deps():
if distro in ["ubuntu", "debian"]:
os.system("sudo apt-get update > /dev/null 2>&1")
- os.system("sudo apt-get install -y tk python3-tk > /dev/null 2>&1")
- print("Dependencies: Done")
+ os.system("sudo apt-get install -y tk python python3-tk > /dev/null 2>&1")
+ print("[*]- Dependencies: Done")
elif distro == "fedora":
- os.system("sudo dnf install -y tk > /dev/null 2>&1")
- print("Dependencies: Done")
+ os.system("sudo dnf install -y tk python > /dev/null 2>&1")
+ print("[*]- Dependencies: Done")
elif distro in ["centos", "rhel"]:
- os.system("sudo yum install -y tk > /dev/null 2>&1")
- print("Dependencies: Done")
+ os.system("sudo yum install -y python tk > /dev/null 2>&1")
+ print("[*]- Dependencies: Done")
elif distro == "arch":
- os.system("sudo pacman -S --noconfirm tk > /dev/null 2>&1")
- print("Dependencies: Done")
+ os.system("sudo pacman -S --noconfirm python tk > /dev/null 2>&1")
+ print("[*]- Dependencies: Done")
elif distro == "void":
- os.system("sudo xbps-install -y tk python3-tkinter > /dev/null 2>&1")
- print("Dependencies: Done")
+ os.system(
+ "sudo xbps-install -y tk python python-tkinter python3-tkinter > /dev/null 2>&1"
+ )
+ print("[*]- Dependencies: Done")
else:
- print("Unsupported distribution. Please install system dependencies manually.")
+ print(
+ "[*]- Unsupported distribution. Please install system dependencies manually.\n [*]- dependencies:\n\t-python\n\t-tk\n\t-python-tkinter "
+ )
def install_libs():
- #
- os.system(
- "pip install --upgrade pip setuptools wheel --break-system-packages > /dev/null 2>&1"
- )
- os.system(
- "pip install customtkinter screeninfo playsound --only-binary=:all: --break-system-packages > /dev/null 2>&1 "
- )
- print("Libs: Done")
+ try:
+ os.system(
+ "pip install --upgrade -y pip setuptools wheel --break-system-packages > /dev/null 2>&1"
+ )
+ print("[*]- Pip Upgraded Successfully !!")
+ except OSError as e:
+ print("[*]- Pip upgrade failed\ncheck pip_upgrade_error.txt for more info")
+ os.system(f"echo {e} > pip_upgrade_error.txt > /dev/null 2>&1")
+
+ try:
+ os.system(
+ "pip install -r requirements.txt --quiet --only-binary=:all: --break-system-packages"
+ )
+ print("[*]- Install libs successful !!")
+ except OSError as e:
+ print("[*]- Install libs failed !!\ncheck lib_install_error.txt for more info")
+ os.system(f"echo {e} > lib_install_error.txt > /dev/null 2>&1")
def copy_file():
@@ -90,16 +106,22 @@ def copy_file():
)
os.system("chmod +x pino > /dev/null 2>&1")
os.system("sudo cp pino ./src/pino_start /usr/bin/ > /dev/null 2>&1")
+
os.system("rm pino > /dev/null 2>&1")
+ except OSError as e:
+ print("Installing app failed\ncheck app_install_error.txt file for more info")
+ os.system(f"echo {e} > app_install_error.txt > /dev/null 2>&1")
+ try:
os.system("sudo mkdir /etc/pino/ > /dev/null 2>&1")
- os.system("mkdir ~/.config/pino/ ~/.config/pino/plugs/ > /dev/null 2>&1")
+ os.system("mkdir -p ~/.config/pino/plugs/ > /dev/null 2>&1")
os.system("cp ./plugs/* ~/.config/pino/plugs > /dev/null 2>&1")
os.system(
"sudo cp ./src/config.json ./src/notification.mp3 /etc/pino/ > /dev/null 2>&1"
)
- print("\nAll Done")
- except:
- print("The file has not moved")
+ print("\n[*]- Done")
+ except OSError as e:
+ print("Creating config files failed\ncheck config_error.txt for more info")
+ os.system(f"echo {e} > config_error.txt > /dev/null 2>&1")
install_pip()
|