diff options
author | Robert Tari <robert@tari.in> | 2023-02-21 18:38:08 +0100 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2023-02-21 18:38:08 +0100 |
commit | 3359a177222d8167b6fb31ef047e1656e36b324f (patch) | |
tree | d3c8859b46868e4b073426579803dab2416e5251 | |
parent | f87fd5232641f4941d8724e360239795b447a911 (diff) | |
parent | b1e0651865951ffe6c9e75d95870840d7661a9a2 (diff) | |
download | ayatana-settings-3359a177222d8167b6fb31ef047e1656e36b324f.tar.gz ayatana-settings-3359a177222d8167b6fb31ef047e1656e36b324f.tar.bz2 ayatana-settings-3359a177222d8167b6fb31ef047e1656e36b324f.zip |
Merge branch 'sunweaver-pr/create-config-autostart-if-nonexistent'
Attributes GH PR #20: https://github.com/AyatanaIndicators/ayatana-settings/pull/20
-rwxr-xr-x | ayatana-settings | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ayatana-settings b/ayatana-settings index 7daae0a..78db62a 100755 --- a/ayatana-settings +++ b/ayatana-settings @@ -226,7 +226,12 @@ class AyatanaSettings: else: ''' - sPath = '~/.config/autostart/ayatana-indicator-{}.desktop'.format(sIndicator) + sAutostartFolder = '~/.config/autostart' + pAutostartFolder = pathlib.Path(sAutostartFolder).expanduser() + if not pAutostartFolder.exists(): + pAutostartFolder.mkdir(parents=True) + + sPath = '{autostart}/ayatana-indicator-{indicator}.desktop'.format(autostart=sAutostartFolder, indicator=sIndicator) pPath = pathlib.Path(sPath).expanduser() if not pPath.exists(): |