Skip to content

Run script by mouse clicking #1251

Answered by hypernova7
omnigenous asked this question in Q&A
Discussion options

You must be logged in to vote

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

Print
  ~/.config/dunst/scripts/screenshot.sh

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
    s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by omnigenous
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants