Run script by mouse clicking #1251
-
I'm really confused by actions. I want to mouse click (right, left or middle, doesn't matter too much) and run my custom bash script. My use case: I display notification after taking screenshot and then I would like to mouse click on notification and have my script open file manager with my screenshot file highlighted. EDIT:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can create a simple script like this. #!/usr/bin/env bash
SCREENSHOT_DIR="$HOME/screenshot"
FILENAME="$SCREENSHOT_DIR/$(date +%Y-%m-%d_%I-%M-%S)_maim.png"
maim "$FILENAME"
DUNST_ACTION=$(dunstify -a maim -i "$FILENAME" -A "view,View Screenshot" Screenshot "New screenshot")
case "$DUNST_ACTION" in
"view")
sxiv -b "$FILENAME"
;;
esac You can add this script to a keyboard shortcut to run it. Like sxhkd
Then you just have to click on the notification to open the image with sxiv Additionally you can add this to your dunst configuration so that when the notification appears it makes a sound [Maim]
appname = maim
summary = Screenshot
script = ~/.config/dunst/scripts/screenshot_sound.sh
screenshot_sound.sh #!/usr/bin/env sh
paplay /usr/share/sounds/freedesktop/stereo/screen-capture.oga |
Beta Was this translation helpful? Give feedback.
You can create a simple script like this.
You can add this script to a keyboard shortcut to run it. Like sxhkd
Then you just have to click on the notification to open the image with sxiv
Additionally you can add this to your dunst configuration so that when the notification appears it makes a sound