update screenshot scripts

This commit is contained in:
Lucas Barbieri 2023-10-09 17:55:47 -03:00
parent 8d498ab87a
commit 0d70ad2a7b
8 changed files with 44 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,13 @@
#!/bin/bash
name="$HOME/pics/screenshots/screenshot-$(date -Iseconds | cut -d '+' -f1).png"
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -u -n -l -c 0.157,0.333,0.466,0.4 $name
xclip -selection clipboard -t image/png $name
fi
jabuxa="$HOME/Pictures/screenshots/screenshot-$(date -Iseconds | cut -d '+' -f1).png" && maim -u -n -l -c 0.157,0.333,0.466,0.4 "$jabuxa" && xclip -selection clipboard -t image/png "$jabuxa"
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim $name
wl-copy < $name
fi

View File

@ -1,4 +1,13 @@
#!/bin/bash
name="$HOME/pics/screenshots/screenshot-$(date -Iseconds | cut -d '+' -f1).png"
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -u -s $name
xclip -selection clipboard -t image/png $name
fi
jabuxa="$HOME/Pictures/screenshots/screenshot-$(date -Iseconds | cut -d '+' -f1).png" && maim -u -s -n -l -c 0.157,0.333,0.466,0.4 "$jabuxa" && xclip -selection clipboard -t image/png "$jabuxa"
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim -g "$(slurp)" $name
xclip -selection clipboard -t image/png $name
wl-copy < $name
fi

11
desktop/bin/print-tmp Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
tmp="$HOME/tmp/tmp.png"
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -u -s "$tmp"
curl -F'file=@'"${tmp}" https://0x0.st | xclip -sel clip
fi
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim -g "$(slurp)" $tmp
curl -F'file=@'"${tmp}" https://0x0.st | wl-copy
fi

9
desktop/bin/print-window.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -i $(xdotool getactivewindow) | xclip -sel clip -t image/png
fi
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" ~/tmp/jabuxas.png
xclip -sel clip ~/tmp/jabuxas.png
wl-copy < ~/tmp/jabuxas.png
fi

4
desktop/bin/readme.md Normal file
View File

@ -0,0 +1,4 @@
## Dependencies
for a x11 session, you only need xclip, xdotool and maim
for a wayland session, i made these on sway, so, depends on swaymsg, slurp, grim and wl-clipboard