summary refs log tree commit diff
path: root/bin/xdg-exec
diff options
context:
space:
mode:
Diffstat (limited to 'bin/xdg-exec')
-rwxr-xr-xbin/xdg-exec27
1 files changed, 0 insertions, 27 deletions
diff --git a/bin/xdg-exec b/bin/xdg-exec
deleted file mode 100755
index 7f8ab5e..0000000
--- a/bin/xdg-exec
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# DESCRIPTION:
-#  parses a .desktop file, that matches in name to `$0`
-#  and executes the `Exec` value.
-#
-# INSTALL:
-#  ln -s <path/to/this/script> /usr/local/bin/app.desktop
-#
-
-set -e
-basepath=$(dirname "$0" | sed 's#/bin#/share/applications#')
-basename=$(basename "$0" | sed -e 's/^_//' -e 's/.desktop$//')
-
-# try ~/.local/share/applications first:
-XDG_DESKTOP_ENTRY_DIR=$HOME/.local/share/applications
-if [ -e "${XDG_DESKTOP_ENTRY_DIR}/${basename}.desktop" ]; then
-	desktop=${XDG_DESKTOP_ENTRY_DIR}/${basename}.desktop
-else
-	desktop=${basepath}/${basename}.desktop
-fi
-exe=$(
-	awk 'BEGIN{try=true;exe="";} /^;/{next} /^TryExec=/{try=gensub(/^TryExec=([^%]*).*$/, "\\1", "g")} /^Exec=/{if(exe==""){exe=gensub(/^Exec=([^%]*).*$/, "\\1", "g")}} END{if(system("command -v " try " >/dev/null")!=0){exit 1}; gsub(/\s$/, "", exe); print exe}' "$desktop"
-)
-
-set -x
-exec sh -c "${exe} \"$*\""