-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A simple service to start application described in .desktop file. This way, dom0 can completely ignore VM-originated Exec= entry.
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
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,24 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "$1" ]; then | ||
echo "This service require an argument" >&2 | ||
exit 1 | ||
fi | ||
|
||
# make sure it have .desktop suffix, and only one of it | ||
app_basename="${1%.desktop}.desktop" | ||
|
||
# Based on XDG Base Directory Specification, Version 0.7 | ||
[ -n "$XDG_DATA_HOME" ] || XDG_DATA_HOME="$HOME/.local/share" | ||
[ -n "$XDG_DATA_DIRS" ] || XDG_DATA_DIRS="/usr/local/share:/usr/share" | ||
|
||
for dir in $(echo "$XDG_DATA_HOME:$XDG_DATA_DIRS" | tr : ' '); do | ||
if ! [ -d "$dir/applications" ]; then | ||
continue | ||
fi | ||
if [ -f "$dir/applications/$app_basename" ]; then | ||
exec qubes-desktop-run "$dir/applications/$app_basename" | ||
fi | ||
done | ||
echo "applications/$app_basename not found in $XDG_DATA_HOME:$XDG_DATA_DIRS" >&2 | ||
exit 1 |
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