diff options
Diffstat (limited to 'src/gtk-redshift/utils.py')
-rw-r--r-- | src/gtk-redshift/utils.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gtk-redshift/utils.py b/src/gtk-redshift/utils.py index 0344406..93e0195 100644 --- a/src/gtk-redshift/utils.py +++ b/src/gtk-redshift/utils.py @@ -28,7 +28,16 @@ def get_autostart(): autostart_dir = base.save_config_path("autostart") autostart_file = os.path.join(autostart_dir, REDSHIFT_DESKTOP) if not os.path.exists(autostart_file): - raise IOError("Installed redshift desktop file not found!") + desktop_files = list(base.load_data_paths("applications", + REDSHIFT_DESKTOP)) + if not desktop_files: + raise IOError("Installed redshift desktop file not found!") + desktop_file_path = desktop_files[0] + # Read installed file and modify it + dfile = desktop.DesktopEntry(desktop_file_path) + dfile.set(AUTOSTART_KEY, "false") + dfile.write(filename=autostart_file) + return False else: dfile = desktop.DesktopEntry(autostart_file) if dfile.get(AUTOSTART_KEY) == 'false': |