From 897ffe7b3ba43fee0c4418148a185d1cbb7d6425 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Tue, 30 Dec 2025 01:17:10 +0900 Subject: QoL small changes --- public/.local/bin/myfile-handler.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'public/.local/bin/myfile-handler.sh') diff --git a/public/.local/bin/myfile-handler.sh b/public/.local/bin/myfile-handler.sh index 52496cd..df57a9a 100755 --- a/public/.local/bin/myfile-handler.sh +++ b/public/.local/bin/myfile-handler.sh @@ -1,8 +1,15 @@ #!/bin/bash # A script to handle custom protocol -url="$1" +notify() { + mimetype=$(xdg-mime query filetype "$file_path") + defaultprogram=$(xdg-mime query default "$mimetype") + notify-send "Opening $(basename $file_path) ($mimetype) with $defaultprogram" +} + +url="$1" file_path="${url#myfile://}" file_path=$(echo "$file_path" | sed 's/%20/ /g') file_path="${file_path/\~/$HOME}" +notify xdg-open "$file_path" -- cgit v1.2.3