PrintScreen support in Slax

This commit is contained in:
TomasM
2017-11-15 14:46:41 -05:00
parent 371657ce94
commit dc5adcf05b
3 changed files with 26 additions and 1 deletions
@@ -135,3 +135,5 @@ Control Mod4 F9 :TakeToWorkspace 9
Control Mod4 F10 :TakeToWorkspace 10
Control Mod4 F11 :TakeToWorkspace 11
Control Mod4 F12 :TakeToWorkspace 12
Print :Exec fbprintscreen
@@ -0,0 +1,22 @@
#!/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