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:
parent
885cc62671
commit
3890246f83
@ -5,9 +5,6 @@ tmpbg='/tmp/screen.png'
|
|||||||
|
|
||||||
(( $# )) && { icon=$1; }
|
(( $# )) && { icon=$1; }
|
||||||
|
|
||||||
# screenshot
|
|
||||||
scrot "$tmpbg"
|
|
||||||
|
|
||||||
PX=0
|
PX=0
|
||||||
PY=0
|
PY=0
|
||||||
# lockscreen image info
|
# 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))
|
PX=$(($SROX + $SRX/2 - $RX/2))
|
||||||
PY=$(($SROY + $SRY/2 - $RY/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
|
if command mpc 2>&1 1>/dev/null; then
|
||||||
convert $tmpbg -scale 5% -scale 2000% $tmpbg
|
playing=$(mpc status | grep playing | wc -l)
|
||||||
convert $tmpbg $icon -geometry +$PX+$PY -composite -matte $tmpbg
|
[[ $playing == 1 ]] && mpc pause
|
||||||
|
fi
|
||||||
playing=$(mpc status | grep playing | wc -l)
|
|
||||||
[[ $playing == 1 ]] && mpc pause
|
|
||||||
|
|
||||||
i3lock -i "$tmpbg" -n -e
|
i3lock -i "$tmpbg" -n -e
|
||||||
|
|
||||||
[[ $playing == 1 ]] && mpc play
|
if command mpc 2>&1 1>/dev/null; then
|
||||||
|
[[ $playing == 1 ]] && mpc play
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
rm "$tmpbg"
|
rm "$tmpbg"
|
||||||
|
@ -4,10 +4,10 @@ imgur_secret=""
|
|||||||
login="false"
|
login="false"
|
||||||
log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log"
|
log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log"
|
||||||
credentials_file="$HOME/.config/imgur-screenshot/credentials.conf"
|
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"
|
file_dir="$HOME/pictures/screenshots"
|
||||||
screenshot_select_command="scrot -q 0 -s %img"
|
screenshot_select_command="maim -m 10 -us %img"
|
||||||
screenshot_window_command="scrot -q 0 -b %img"
|
screenshot_window_command="maim -m 10 -uw %img"
|
||||||
edit_command="gimp %img"
|
edit_command="gimp %img"
|
||||||
edit="false"
|
edit="false"
|
||||||
exit_on_selection_fail="true"
|
exit_on_selection_fail="true"
|
||||||
|
Loading…
Reference in New Issue
Block a user