1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

maim: replace scrot with maim for screenshots

This commit is contained in:
Joe Groocock 2018-02-22 12:44:50 +00:00
parent 885cc62671
commit 3890246f83
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
2 changed files with 12 additions and 13 deletions

View File

@ -5,9 +5,6 @@ tmpbg='/tmp/screen.png'
(( $# )) && { icon=$1; }
# screenshot
scrot "$tmpbg"
PX=0
PY=0
# lockscreen image info
@ -25,17 +22,19 @@ SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset
PX=$(($SROX + $SRX/2 - $RX/2))
PY=$(($SROY + $SRY/2 - $RY/2))
# screenshot, pixelise and overlay
maim | convert - -scale 5% -scale 2000% $icon -geometry +$PX+$PY -composite -matte $tmpbg
# pixelize and add lock icon
convert $tmpbg -scale 5% -scale 2000% $tmpbg
convert $tmpbg $icon -geometry +$PX+$PY -composite -matte $tmpbg
if command mpc 2>&1 1>/dev/null; then
playing=$(mpc status | grep playing | wc -l)
[[ $playing == 1 ]] && mpc pause
fi
i3lock -i "$tmpbg" -n -e
if command mpc 2>&1 1>/dev/null; then
[[ $playing == 1 ]] && mpc play
fi
rm "$tmpbg"

View File

@ -4,10 +4,10 @@ imgur_secret=""
login="false"
log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log"
credentials_file="$HOME/.config/imgur-screenshot/credentials.conf"
file_name_format="scrot-%Y-%m-%d--%H:%M:%S.png" # when using scrot, must end with .png!
file_name_format="screenshot-%Y-%m-%d-%H%M%S.png" # when using scrot, must end with .png!
file_dir="$HOME/pictures/screenshots"
screenshot_select_command="scrot -q 0 -s %img"
screenshot_window_command="scrot -q 0 -b %img"
screenshot_select_command="maim -m 10 -us %img"
screenshot_window_command="maim -m 10 -uw %img"
edit_command="gimp %img"
edit="false"
exit_on_selection_fail="true"