-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from mapster/feature/apply-autostart-condition
Check autostart condition before launching
- Loading branch information
Showing
8 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bats | ||
|
||
setup() { | ||
export DID_RUN="$(mktemp -d)" | ||
export XDG_CONFIG_HOME=./data/autostart-folders/condition-home | ||
export XDG_CONFIG_DIRS= | ||
} | ||
|
||
teardown() { | ||
rm -r $DID_RUN | ||
} | ||
|
||
@test "Only starts applications with passing AutostartCondition" { | ||
run ../sway-launcher-desktop.sh autostart 3>&2 | ||
echo -e "DID_RUN=$DID_RUN" | ||
[[ ! -e $DID_RUN/unless-exists.file-exists ]] | ||
[[ -e $DID_RUN/unless-exists.file-not-exists ]] | ||
[[ ! -e $DID_RUN/if-exists.file-not-exists ]] | ||
[[ -e $DID_RUN/if-exists.file-exists ]] | ||
} |
Empty file.
12 changes: 12 additions & 0 deletions
12
tests/data/autostart-folders/condition-home/autostart/if-exists.file-exists.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Desktop Entry] | ||
Name=Initial Setup | ||
Exec=touch $DID_RUN/if-exists.file-exists | ||
Terminal=false | ||
Type=Application | ||
StartupNotify=true | ||
Categories=GNOME;GTK;System; | ||
OnlyShowIn=GNOME;Unity; | ||
NoDisplay=true | ||
AutostartCondition=if-exists marker-file.txt | ||
X-GNOME-HiddenUnderSystemd=true | ||
X-Ubuntu-Gettext-Domain=gnome-initial-setup |
12 changes: 12 additions & 0 deletions
12
tests/data/autostart-folders/condition-home/autostart/if-exists.file-not-exists.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Desktop Entry] | ||
Name=Initial Setup | ||
Exec=touch $DID_RUN/if-exists.file-not-exists | ||
Terminal=false | ||
Type=Application | ||
StartupNotify=true | ||
Categories=GNOME;GTK;System; | ||
OnlyShowIn=GNOME;Unity; | ||
NoDisplay=true | ||
AutostartCondition=if-exists non-existing-file.txt | ||
X-GNOME-HiddenUnderSystemd=true | ||
X-Ubuntu-Gettext-Domain=gnome-initial-setup |
12 changes: 12 additions & 0 deletions
12
tests/data/autostart-folders/condition-home/autostart/unless-exists.file-exists.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Desktop Entry] | ||
Name=Initial Setup | ||
Exec=touch $DID_RUN/unless-exists.file-exists | ||
Terminal=false | ||
Type=Application | ||
StartupNotify=true | ||
Categories=GNOME;GTK;System; | ||
OnlyShowIn=GNOME;Unity; | ||
NoDisplay=true | ||
AutostartCondition=unless-exists marker-file.txt | ||
X-GNOME-HiddenUnderSystemd=true | ||
X-Ubuntu-Gettext-Domain=gnome-initial-setup |
12 changes: 12 additions & 0 deletions
12
tests/data/autostart-folders/condition-home/autostart/unless-exists.file-not-exists.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Desktop Entry] | ||
Name=Initial Setup | ||
Exec=touch $DID_RUN/unless-exists.file-not-exists | ||
Terminal=false | ||
Type=Application | ||
StartupNotify=true | ||
Categories=GNOME;GTK;System; | ||
OnlyShowIn=GNOME;Unity; | ||
NoDisplay=true | ||
AutostartCondition=unless-exists non-existing-file.txt | ||
X-GNOME-HiddenUnderSystemd=true | ||
X-Ubuntu-Gettext-Domain=gnome-initial-setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yes |