aboutsummaryrefslogtreecommitdiff
path: root/xdg-add
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-05-09 10:59:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-05-09 10:59:29 -0300
commitfec935a411d77e40957e6bf08ea62d001413d12c (patch)
tree25777195098a9314fb31f6e55d0ba0df4d1ddd5e /xdg-add
parentf8783cfcfe7ebdb8e328e37322cf68d908f7e8f9 (diff)
downloadscripts-fec935a411d77e40957e6bf08ea62d001413d12c.tar.gz
scripts-fec935a411d77e40957e6bf08ea62d001413d12c.tar.bz2
Adds xdg-add
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