File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ from PIL import Image
6
6
import os
7
7
import threading
8
8
9
+ appIsRunning = True
10
+
9
11
10
12
class Const :
11
13
CONFIG_FILE_PATH = "./config.txt"
@@ -87,10 +89,12 @@ def onIconRightClicked(stray, query):
87
89
elif query == Const .STRAY_OPEN_CONFIG :
88
90
openConfigFile ()
89
91
elif query == Const .STRAY_EXIT :
90
- config .en = False
91
- config .writeConfig ()
92
+ # config.en = False
93
+ # config.writeConfig()
94
+ global appIsRunning
95
+ appIsRunning = False
92
96
stray .stop ()
93
- exit (0 )
97
+ # exit(0)
94
98
config .writeConfig ()
95
99
96
100
@@ -118,7 +122,7 @@ def setupStray():
118
122
def main ():
119
123
config = Config ()
120
124
showSystemStatus (config )
121
- while True :
125
+ while appIsRunning :
122
126
battery = psutil .sensors_battery ()
123
127
isPluggedIn = battery .power_plugged
124
128
if isPluggedIn :
@@ -129,7 +133,6 @@ def main():
129
133
sendNotification ("Low Battery, Plug-in charger" , ("The Power is at " + str (battery .percent )))
130
134
time .sleep (config .alertTimeInterval )
131
135
config .readConfig ()
132
- print ('hey' )
133
136
134
137
135
138
def showSystemStatus (config : Config ):
You can’t perform that action at this time.
0 commit comments