summaryrefslogtreecommitdiff
path: root/misc/mimewiz
diff options
context:
space:
mode:
Diffstat (limited to 'misc/mimewiz')
-rwxr-xr-xmisc/mimewiz19
1 files changed, 19 insertions, 0 deletions
diff --git a/misc/mimewiz b/misc/mimewiz
new file mode 100755
index 0000000..a275bcc
--- /dev/null
+++ b/misc/mimewiz
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+config="${XDG_CONFIG_HOME:-~/.config}/mimewiz"
+#mkdir -p "$config"
+
+install_default_mimetypes() {
+ for app in "$config"/*; do
+ desktop="$(basename "$app").desktop"
+ types="$(tr '\n' ' ' < "$app")"
+ echo "Setting $desktop as default application for types listed in $app"
+ xdg-mime default $desktop $types
+ done
+}
+
+case $1 in
+ -i) install_default_mimetypes; break ;;
+esac