aboutsummaryrefslogtreecommitdiff
path: root/xdg-add
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-08-20 20:07:05 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-08-20 20:07:05 -0300
commita09a77ee87df69b1e9fe9fba98c21b11983d0150 (patch)
tree2f68ed8570bb4ed2f000471c88c58e101e617c6d /xdg-add
parentd3ae2029e3f50b63c2adaee12422348e7dd379c2 (diff)
downloadutils-x11-a09a77ee87df69b1e9fe9fba98c21b11983d0150.tar.gz
utils-x11-a09a77ee87df69b1e9fe9fba98c21b11983d0150.tar.bz2
Add some commands from the scripts repository
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