Add --force_area option to screenshot script

Also bind this option in sxhkd.
This commit is contained in:
samedamci 2020-06-01 08:26:03 +02:00
parent 67d0001920
commit ffb62ab714
No known key found for this signature in database
GPG Key ID: FCB4A9A20D00E894
2 changed files with 13 additions and 9 deletions

View File

@ -11,12 +11,12 @@ super + c
super + s; {t,m,n,v}
{tuirent,mails,rss,fm}
super + a; {g,k,l,i,k}
{gimp,keepassxc,libreoffice,inkscape,keepassxc}
super + a; {g,k,l,i}
{gimp,keepassxc,libreoffice,inkscape}
super + m
rofi-mpd -a
super + x
{Prior,super + x}
slock
super + z
powermenu
@ -29,8 +29,8 @@ super + {_,shift +} e
super + w
choosewall
{_,shift +} Print
screenshot {_,--force}
{_,shift,ctrl +} Print
screenshot {_,--force,--force_area}
{_,shift +} F1
{_,u}mounter
{_,ctrl +} F10

View File

@ -12,7 +12,13 @@ screenshot() {
notify-send -u low -t 1400 -i "$screen_path" "Screenshot created!"
}
[ "$1" = "--force" ] && { screenshot && exit; }
clip() {
xclip -sel clip /dev/null; sleep 0.5
xclip -selection clipboard -t image/png "$screen_path"
}
[ "$1" = "--force" ] && { screenshot; exit; }
[ "$1" = "--force_area" ] && { type="-s -u" && screenshot && clip; exit ;}
type="$(printf " Screen\n Area\n" | m 2 -p 'Screenshoter')"
[ ! "$type" ] && exit
@ -26,6 +32,4 @@ time="$(printf "0.7\n5\n10\n15" | m 3 -p 'Delay')"
sleep "$time"
screenshot
[ "$save" = " Yes" ] &&
xclip -sel clip /dev/null; sleep 0.5
xclip -selection clipboard -t image/png "$screen_path" || exit
[ "$save" = " Yes" ] && clip || exit