Add a screenshot uploader

This will take a screenshot (window or selection) and upload to
c0de.link/pics (link will be i.c0de.link/*, but other picture related
subdomains will go to the same place)
This commit is contained in:
David Todd 2019-03-05 03:23:38 -06:00
parent d6e33d7a25
commit ac62357ba4
3 changed files with 17 additions and 2 deletions

View File

@ -66,7 +66,7 @@ bindsym $mod+Ctrl+x --release exec --no-startup-id xkill
bindsym $mod+n --release exec --no-startup-id terminator -e nnn
bindsym Insert exec --no-startup-id maim -s ~/Pictures/$(date +%Y-%m-%d-%s).png #i3-scrot --select '%Y-%m-%d_$wx$h.png' # Selection -- CHange cursor?
bindsym $mod+Insert --release exec --no-startup-id maim -i $(xdotool getactivewindow) ~/Pictures/$(date +%Y-%m-%d-%s).png #i3-scrot -w '%Y-%m-%d_$wx$h.png' # Window
bindsym $mod+Insert exec --no-startup-id ~/.i3/screenshotter.sh #i3-scrot -w '%Y-%m-%d_$wx$h.png' # Window
bindsym $mod+Shift+Insert --release exec --no-startup-id maim ~/Pictures/$(date +%Y-%m-%d).png #i3-scrot -d '%Y-%m-%d_$wx$h.png' # Fullscreen
bindsym $mod+Ctrl+Insert exec --no-startup-id maim -s ~/Pictures/$(date +%Y-%m-%d).png&& pinta ~/Pictures/$(date +%Y-%m-%d-%s).png # screenshot and edit

14
i3/screenshotter.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
DATE=$(date +%Y-%m-%d-%s).png
FILENAME=~/Pictures/$DATE
maim -s $FILENAME&
wait $!
notify-send "Uploading Screenshot"
scp $FILENAME web.foxnet.space:/var/www/c0de.link/pics&
wait $!
echo https://i.c0de.link/$DATE | xclip -selection clipboard
notify-send "Link copied to Clipboard"

View File

@ -107,7 +107,8 @@ mkdir -p $HOME/.config/i3
mkdir -p $HOME/.i3
symlink $basedir/i3/config $HOME/.config/i3/config
symlink $basedir/i3/i3blocks.conf $HOME/.i3/i3blocks.conf
symlink $basedir/i3/wallpaper.sh $Home/.i3/wallpaper.sh
symlink $basedir/i3/wallpaper.sh $HOME/.i3/wallpaper.sh
symlink $basedir/i3/screenshotter.sh $HOME/.i3/screenshotter.sh
symlink $basedir/i3/compton.conf $HOME/.compton.conf
if [ -e "$postinst" ]; then