Simplify autostart state change
parent
fa6bb0814c
commit
50ca167167
|
@ -72,15 +72,14 @@ class ManjaroHello(Gtk.Window):
|
||||||
if state and not os.path.isfile(self.autostart_path):
|
if state and not os.path.isfile(self.autostart_path):
|
||||||
try:
|
try:
|
||||||
os.symlink(self.desktop_path, self.autostart_path)
|
os.symlink(self.desktop_path, self.autostart_path)
|
||||||
self.preferences["autostart"] = True
|
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print(e)
|
print(e)
|
||||||
elif not state and os.path.isfile(self.autostart_path):
|
elif not state and os.path.isfile(self.autostart_path):
|
||||||
try:
|
try:
|
||||||
os.unlink(self.autostart_path)
|
os.unlink(self.autostart_path)
|
||||||
self.preferences["autostart"] = False
|
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
self.preferences["autostart"] = state
|
||||||
self.save_preferences()
|
self.save_preferences()
|
||||||
|
|
||||||
def save_preferences(self):
|
def save_preferences(self):
|
||||||
|
|
Loading…
Reference in New Issue