summaryrefslogtreecommitdiffstats
path: root/local/bin/myfile-handler.sh
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2024-09-11 03:39:28 +0900
committerMitsuo Tokumori <[email protected]>2024-09-11 03:39:28 +0900
commitdca319b8d9d221f1aaf3a00ee457d202096c66ac (patch)
tree7450c668226aea29b02f8fd9bd36240d1b9d2d20 /local/bin/myfile-handler.sh
parent4bc0383c5745d5fbd7e83d7ae68f765a9b2024e3 (diff)
downloaddotfiles-dca319b8d9d221f1aaf3a00ee457d202096c66ac.tar.gz
dotfiles-dca319b8d9d221f1aaf3a00ee457d202096c66ac.tar.bz2
dotfiles-dca319b8d9d221f1aaf3a00ee457d202096c66ac.zip
Update custom bash scripts
Diffstat (limited to 'local/bin/myfile-handler.sh')
-rwxr-xr-xlocal/bin/myfile-handler.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/local/bin/myfile-handler.sh b/local/bin/myfile-handler.sh
new file mode 100755
index 0000000..40360b8
--- /dev/null
+++ b/local/bin/myfile-handler.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+# A script to handle custom protocol
+url="$1"
+
+file_path="${url#myfile://}"
+file_path="${file_path/\~/$HOME}"
+xdg-open "$file_path"