Fix autostart activation

merge-requests/64/head
Hugo Posnic 2017-05-25 17:24:31 +02:00
parent 3fd589995f
commit c5911b3872
2 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,7 @@
{ {
"system": "Manjaro Gellivara 17", "system": "Manjaro Gellivara 17",
"default_locale": "en", "default_locale": "en",
"autostart_path": "~/autostart/manjaro-hello.desktop", "autostart_path": "~/.config/autostart/manjaro-hello.desktop",
"data_path": "/usr/share/manjaro-hello/data/", "data_path": "/usr/share/manjaro-hello/data/",
"desktop_path": "/usr/share/applications/manjaro-hello.desktop", "desktop_path": "/usr/share/applications/manjaro-hello.desktop",
"installer_path": "/usr/bin/calamares", "installer_path": "/usr/bin/calamares",

View File

@ -177,12 +177,13 @@ class Hello():
:type autostart: bool :type autostart: bool
""" """
try: try:
if autostart and not os.path.isfile(self.preferences["autostart_path"]): if autostart and not os.path.isfile(fix_path(self.preferences["autostart_path"])):
os.symlink(self.preferences["desktop_path"], self.preferences["autostart_path"]) os.symlink(self.preferences["desktop_path"],
elif not autostart and os.path.isfile(self.preferences["autostart_path"]): fix_path(self.preferences["autostart_path"]))
os.unlink(self.preferences["autostart_path"]) elif not autostart and os.path.isfile(fix_path(self.preferences["autostart_path"])):
os.unlink(fix_path(self.preferences["autostart_path"]))
# Specific to i3 # Specific to i3
i3_config = self.home_path + "/.i3/config" i3_config = fix_path("~/.i3/config")
if os.path.isfile(i3_config): if os.path.isfile(i3_config):
i3_autostart = "exec --no-startup-id " + self.app i3_autostart = "exec --no-startup-id " + self.app
with open(i3_config, "r+") as f: with open(i3_config, "r+") as f: