mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-11-06 19:32:24 +00:00
24 lines
497 B
Bash
Executable file
24 lines
497 B
Bash
Executable file
#!/bin/bash
|
|
|
|
|
|
to_file=0
|
|
fullscreen=0
|
|
for arg in "$@"; do
|
|
case $arg in
|
|
--tofile) to_file=1;;
|
|
--fullscreen) fullscreen=1;;
|
|
esac
|
|
done
|
|
|
|
select_flag="-s"
|
|
[ $fullscreen -eq 1 ] && select_flag=""
|
|
|
|
|
|
if [ $to_file -eq 1 ]; then
|
|
file="$HOME/Bilder/screenshots/screenshot_$(date +%s).png"
|
|
echo "$file"
|
|
maim $select_flag --format png "$file"
|
|
echo "$file" | xclip -selection clipboard
|
|
else
|
|
maim "$select_flag" --format png /dev/stdout | xclip -selection clipboard -t image/png -i
|
|
fi
|