[bin] Make screenshoter Wayland compatible
This commit is contained in:
parent
b556b94f60
commit
04fe44859e
|
@ -16,5 +16,10 @@ Net::SCP.start("drop.bascht.space", "bascht") do |scp|
|
|||
scp.upload(file.expand_path.to_s, "/home/bascht/drop/#{new_name}")
|
||||
end
|
||||
|
||||
Open3.popen3( "xclip -i -selection clipboard" ){ |input, _, _| input << url }
|
||||
if ENV["WAYLAND_DISPLAY"].nil?
|
||||
Open3.popen3( "xclip -i -selection clipboard" ){ |input, _, _| input << url }
|
||||
else
|
||||
system "wl-copy #{url}"
|
||||
end
|
||||
|
||||
system("notify-send 'Uploaded successfully' '<a href=\'#{url}\'>drop.bascht.space</a>'")
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
drop $(i3-screenshot -s)
|
||||
SHOT=$(i3-screenshot -s)
|
||||
chmod o+r $SHOT
|
||||
drop $SHOT
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
#!/bin/bash
|
||||
FOLDER="/home/bascht/Pictures/Screenshots/$(date +'%Y-%m')"
|
||||
mkdir -p ${FOLDER}
|
||||
escrotum "${FOLDER}/Screenshot-%Y-%m-%d-%H%M%S-\$wx\$h.png" $*
|
||||
|
||||
if [ -z "$WAYLAND_DISPLAY" ]; then
|
||||
NAME="${FOLDER}/Screenshot-%Y-%m-%d-%H%M%S-\$wx\$h.png"
|
||||
exec escrotum "$NAME" $*
|
||||
else
|
||||
NAME="${FOLDER}/Screenshot-$(date +%Y-%m-%d-%H%M%S).png"
|
||||
grim -g "$(slurp)" "$NAME";
|
||||
echo $NAME
|
||||
fi;
|
||||
|
|
Loading…
Reference in New Issue