Last active
July 17, 2023 04:38
-
-
Save daisyUniverse/f286bc47b28c1795b83739e0e489c7b6 to your computer and use it in GitHub Desktop.
mouse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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