Fixed i3lock, from after update

This commit is contained in:
TuDatTr
2021-05-29 21:46:59 +02:00
parent 5537696c6a
commit 521c99c0c9
12 changed files with 140 additions and 48 deletions

View File

@@ -5,29 +5,41 @@ type dunstify >/dev/null 2>&1 || { echo >&2 "I require dunstify but it's not ins
type xclip >/dev/null 2>&1 || { echo >&2 "I require xclip but it's not installed. Aborting."; exit 1; }
type xdotool >/dev/null 2>&1 || { echo >&2 "I require xdotool but it's not installed. Aborting."; exit 1; }
d=$HOME/Pictures/Screenshots/$(date +%Y-%m);
fd=$(date +%G-%m-%d_%H-%M-%S)
clip_screenshot () {
if test -f "$1"
then
dunstify -r 2 "Saved in $1";
xclip -selection clipboard -t image/png -i $1
else
:
fi
}
mkdir $d;
d=$HOME/Pictures/Screenshots/$(date +%Y-%m);
fd=$(date +%y-%m-%d_%H-%M-%S)
if [ -d "$d" ]
then
:
else
mkdir $d
fi
case $1 in
"screen"*)
filename=$fd-$(cat /proc/$(xdotool getwindowfocus getwindowpid)/comm).png;
maim -f png $d/$filename;
dunstify -r 2 "Saved screenshot of screen in $d/$filename";
xclip -selection clipboard -t image/png -i $d/$filename
clip_screenshot $d/$filename;
;;
"window"*)
filename=$fd-$(cat /proc/$(xdotool getwindowfocus getwindowpid)/comm).png
filename=$fd-$(cat /proc/$(xdotool getwindowfocus getwindowpid)/comm).png;
maim -u -i $(xdotool getactivewindow) -f png $d/$filename;
dunstify -r 2 "Saved screenshot of window in $d/$filename";
xclip -selection clipboard -t image/png -i $d/$filename
clip_screenshot $d/$filename;
;;
"area"*)
# dunstify -r 2 'Taking screenshot from area.';
filename=$fd-$(cat /proc/$(xdotool getwindowfocus getwindowpid)/comm).png;
maim -u -s -f png $d/$filename;
dunstify -r 2 "Saved in $d/$filename.";
xclip -selection clipboard -t image/png -i $d/$filename
clip_screenshot $d/$filename;
;;
esac