aboutsummaryrefslogtreecommitdiff
path: root/xdg-add
diff options
context:
space:
mode:
Diffstat (limited to 'xdg-add')
-rwxr-xr-xxdg-add16
1 files changed, 16 insertions, 0 deletions
diff --git a/xdg-add b/xdg-add
new file mode 100755
index 0000000..d572ba9
--- /dev/null
+++ b/xdg-add
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# A xdg-mime shortcut.
+#
+
+# Parameters
+APP="$1"
+FILETYPE="$2"
+
+# Check if second param is a file
+if [ -e "$FILETYPE" ]; then
+ FILETYPE="`xdg-mime query filetype $FILETYPE`"
+fi
+
+# Make association
+xdg-mime default ${APP}.desktop $FILETYPE