dotfiles/nix/overlays/screenshot/screenshot
Magic_RB 11fc09120b
Switch old halfFlake system to regular overlays
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2021-04-09 00:35:36 +02:00

18 lines
646 B
Bash

# -*- mode: shell-script; -*-
export PATH=@scrot@/bin:@xclip@/bin:@busybox@/bin
OPT="${1:-screen}"
case "$OPT" in
screen)
scrot '/tmp/%F_%T_$wx$h.png' -e 'mkdir -p ~/screenshot/ ; mv $f ~/screenshot ; xclip -selection clipboard -target image/png -i ~/screenshot/`basename $f`'
;;
select)
scrot '/tmp/%F_%T_$wx$h.png' -f -s -e 'mkdir -p ~/screenshot/ ; mv $f ~/screenshot ; xclip -selection clipboard -target image/png -i ~/screenshot/`basename $f`'
;;
focused)
scrot '/tmp/%F_%T_$wx$h.png' -f -e 'mkdir -p ~/screenshot/ ; mv $f ~/screenshot ; xclip -selection clipboard -target image/png -i ~/screenshot/`basename $f`'
;;
esac