23 lines
409 B
Bash
Executable File
23 lines
409 B
Bash
Executable File
#!/bin/bash
|
|
|
|
PICTURES=$(xdg-user-dir PICTURES)
|
|
if [ "$PICTURES" = "" ]; then
|
|
PICTURES=~/Pictures
|
|
fi
|
|
|
|
mkdir -p $PICTURES
|
|
cd $PICTURES
|
|
|
|
# make screenshot
|
|
SCREENSHOT=$(scrot -e 'echo $f')
|
|
|
|
if [ "$SCREENSHOT" = "" ]; then
|
|
exit 1
|
|
fi
|
|
|
|
# open screenshot in 2/3 window
|
|
read W H X <<< $(xrandr 2>/dev/null | fgrep '*' | tr -s " " | tr "x" " ")
|
|
W=$(($W*2/3))
|
|
H=$(($H*2/3))
|
|
exec feh --geometry $W"x"$H $SCREENSHOT
|