Created
October 21, 2023 09:31
-
-
Save naranyala/919338b13b0aacbd017b0ea485ba64c3 to your computer and use it in GitHub Desktop.
rofi launcher feature to show screenshot option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
options=("Full Screen" "Selected Area" "Active Window") | |
selected_option=$(printf '%s\n' "${options[@]}" | rofi -dmenu -p "Screenshot Mode:") | |
case "$selected_option" in | |
"Full Screen") | |
notify-send "Taking full-screen screenshot..." | |
maim ~/Pictures/screenshot-$(date +"%Y-%m-%d_%H-%M-%S").png | |
notify-send "Screenshot saved as ~/screenshot-$(date +"%Y-%m-%d_%H-%M-%S").png" | |
;; | |
"Selected Area") | |
notify-send "Select an area for screenshot..." | |
maim -s ~/Pictures/screenshot-$(date +"%Y-%m-%d_%H-%M-%S").png | |
notify-send "Screenshot saved as ~/screenshot-$(date +"%Y-%m-%d_%H-%M-%S").png" | |
;; | |
"Active Window") | |
notify-send "Taking screenshot of the active window..." | |
maim -i $(xdotool getactivewindow) ~/Pictures/screenshot-$(date +"%Y-%m-%d_%H-%M-%S").png | |
notify-send "Screenshot saved as ~/screenshot-$(date +"%Y-%m-%d_%H-%M-%S").png" | |
;; | |
*) | |
notify-send "Invalid option" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment