Skip to content

Instantly share code, notes, and snippets.

@daisyUniverse
Last active July 17, 2023 04:38
Show Gist options
  • Save daisyUniverse/f286bc47b28c1795b83739e0e489c7b6 to your computer and use it in GitHub Desktop.
Save daisyUniverse/f286bc47b28c1795b83739e0e489c7b6 to your computer and use it in GitHub Desktop.
mouse
#!/bin/bash
# Mousebutton action script made by Daisy Universe
# TODO: Write good code
normalScrot(){
echo "Taking a normal screenshot and pasting it to your clipboard"
sleep 0.2
scrot /tmp/clip.png -z --overwrite -s --freeze -e 'xclip -selection clipboard -target image/png -i $f'
cp /tmp/clip.png $HOME/Pictures/screenshots/`date +"%m-%d-%Y(%H:%M:%S)"`.png
}
windowScrot(){
echo "Taking a screenshot of the current window"
sleep 0.2
scrot -u /tmp/Fclip.png -z --overwrite -e 'xclip -selection clipboard -target image/png -i $f'
cp /tmp/Fclip.png $HOME/Pictures/screenshots/`date +"%m-%d-%Y(%H:%M:%S)"`.png
}
paste(){
echo "Pressing ctrl-v"
xdotool key ctrl+v
echo "Pressing Enter"
sleep 1.5
xdotool key KP_Enter
}
clipDL(){
cd $HOME/bin
bash clipdl "$HOME/Downloads/"
}
edit(){
cd $HOME/bin
bash clipdl "$HOME/Downloads/" -e
}
case $1 in
"screenshot" ) normalScrot ;;
"wscreenshot" ) windowScrot ;;
"paste" ) paste ;;
"peek" ) peek & ;;
"download" ) clipDL ;;
"edit" ) edit ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment