Add screenshot functionality
This commit is contained in:
parent
1da0ea7f1e
commit
28c094ce2c
3 changed files with 28 additions and 2 deletions
|
@ -59,6 +59,23 @@ powermenu() {
|
|||
fi
|
||||
}
|
||||
|
||||
screenshot() {
|
||||
ACTION=$(printf "Area\nWindow\nScreen" | wofi --show=dmenu -i --width 200 --height 150)
|
||||
if [ -n "$ACTION" ]; then
|
||||
case $ACTION in
|
||||
Area)
|
||||
grim -g "$(slurp)" - | swappy -f -
|
||||
;;
|
||||
Window)
|
||||
grim -g "$(hyprctl clients -j | jq -r ".[] | select(.workspace.id | IN(["$(hyprctl monitors -j | jq '.[].activeWorkspace.id' | xargs | sed -e 's/ /,/g')"][]))" | jq -r ".at,.size" | jq -s "add" | jq '_nwise(4)' | jq -r '"\(.[0]),\(.[1]) \(.[2])x\(.[3])"' | slurp)" - | swappy -f -
|
||||
;;
|
||||
Screen)
|
||||
grim -g "$(slurp -o)" - | swappy -f -
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
ACTION=$1
|
||||
case $ACTION in
|
||||
background)
|
||||
|
@ -79,6 +96,9 @@ case $ACTION in
|
|||
powermenu)
|
||||
powermenu
|
||||
;;
|
||||
screenshot)
|
||||
screenshot
|
||||
;;
|
||||
help | -h | --help)
|
||||
echo "Usage: hyprhelpr <action> [parameters]"
|
||||
echo "Available actions:"
|
||||
|
@ -88,6 +108,7 @@ case $ACTION in
|
|||
echo " shutdown Shut down the system."
|
||||
echo " reboot Reboot the system."
|
||||
echo " powermenu Show wofi in dmenu mode with different power options"
|
||||
echo " screenshot Show wofi in dmenu mode with different screenshot options"
|
||||
echo " help Show this help text."
|
||||
;;
|
||||
*)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue