diff options
Diffstat (limited to 'public/.local/bin/dmenu-opentable.sh')
| -rwxr-xr-x | public/.local/bin/dmenu-opentable.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/public/.local/bin/dmenu-opentable.sh b/public/.local/bin/dmenu-opentable.sh index 69786bb..229efff 100755 --- a/public/.local/bin/dmenu-opentable.sh +++ b/public/.local/bin/dmenu-opentable.sh @@ -1,7 +1,14 @@ #!/bin/bash # xdg-open a file selected through dmenu +notify() { + mimetype=$(xdg-mime query filetype "$DIR/$FILE") + defaultprogram=$(xdg-mime query default "$mimetype") + notify-send "Opening $FILE ($mimetype) with $defaultprogram" +} + DIR="$HOME/docs/spreadsheet" FILE=$(ls "$DIR" | dmenu -i -l 10 -p "Select spreadsheet:") [ -z "$FILE" ] && exit 1 +notify xdg-open "$DIR/$FILE" |
