Skip to content

Instantly share code, notes, and snippets.

@SevereCloud
Last active July 5, 2017 18:17
Show Gist options
  • Save SevereCloud/46b1d565ed6e37de0000c07d4de7d906 to your computer and use it in GitHub Desktop.
Save SevereCloud/46b1d565ed6e37de0000c07d4de7d906 to your computer and use it in GitHub Desktop.
Последний скриншот в буфер обмена
#!/bin/bash
cd /home/severecloud/Изображения/
lasti=-1
endfile=''
while true
do
i=0
for file in Снимок*.png
do
if [ "$file" != "Снимок*.png" ]
then
i=$((i+1))
endfile=$file
fi
done
if [ "$lasti" -eq "-1" ]
then
notify-send "Скриншоты в буфер обмена" "Старт"
lasti=$i
fi
if [ "$lasti" -lt "$i" ]
then
xclip -selection clipboard -t image/png -i "$endfile"
notify-send -u low "Скриншот в буфере обмена" "$endfile"
fi
lasti=$i
sleep 2s
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment