Skip to content

Commit

Permalink
Respect user autostart options (#89)
Browse files Browse the repository at this point in the history
* Respect user autostart options

* Formatting

* Cleanup

* Load exisitin autostart file

---------

Co-authored-by: Ryan Kornheisl <ryan@skarva.tech>
Co-authored-by: Leo <lenemter@gmail.com>
  • Loading branch information
3 people authored Aug 21, 2023
1 parent fcee36a commit 5642383
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Background/Portal.vala
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ public class Background.Portal : Object {
}

var key_file = new KeyFile ();

if (file.query_exists ()) {
try {
uint8[] contents;
yield file.load_contents_async (null, out contents, null);

key_file.load_from_data ((string) contents, contents.length, KEEP_COMMENTS | KEEP_TRANSLATIONS);
} catch (Error e) {
warning ("Failed to load exisiting autostart file: %s", e.message);
}
}

key_file.set_string (KeyFileDesktop.GROUP, KeyFileDesktop.KEY_TYPE, KeyFileDesktop.TYPE_APPLICATION);

if (app_info != null) {
Expand Down

0 comments on commit 5642383

Please sign in to comment.