You are not logged in.
Hi there guys!
I received from help from you guys about half a decade ago relating to saving screenshots to my clipboard. I pulled the bash file out of the Crunchbang install to use again but when I run it , I receive an "xcmenu not found" error. I can't find any mention of that executable so I thought I'd ask how I would update this for 2020.
#!/bin/sh
# get a name for a temporary file
temp="$(mktemp -u).png"
# use scrot to put a screenshot into said temporary file
scrot "$temp"
# copy the image to the X clipboard, tagging it as image data
cat "$temp" | xcmenu --binary image/png --clipboard
# remove the temporary file
rm -f "$temp"
Thanks for your time!
Last edited by schwim (2019-05-07 23:12:58)
Schw.im! A social site with an identity crisis.
Offline
Install maim, then use:
maim | xclip -selection clipboard -target image/png
My full screenshooter script:
#!/bin/bash
##
## scrotclip.sh by damo Feb 2019
# Requires maim, xclip, xdotool
# USAGE: scrotclip.sh [clipwin|clipall|clipsel|clipclean]
arg="$1"
if [[ $arg = "clipwin" ]];then
maim -i $(xdotool getactivewindow) | xclip -selection clipboard -target image/png
notify-send -t 6000 "Active window screenshot saved to clipboard"
elif [[ $arg = "clipall" ]];then
maim | xclip -selection clipboard -target image/png
notify-send -t 6000 "Desktop screenshot saved to clipboard"
elif [[ $arg = "clipsel" ]];then
maim -s | xclip -selection clipboard -target image/png
notify-send -t 6000 "Selected area screenshot saved to clipboard"
elif [[ $arg = "clipclean" ]];then
maim -d 3 -u | xclip -selection clipboard -target image/png # wait 3 secs (close menu, hide cursor)
notify-send -t 6000 "Selected area screenshot saved to clipboard"
else
notify-send -t 6000 "Nothing saved to clipboard..."
fi
exit
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Offline
xclip is also missing for me, will simply installing get me working or do I need to alter Openbox to swap out clipboard apps?
Just make menu entries or keybinds for your commands, and/or edit bl-graphics-pipemenu, so the writeScrot function looks like:
writeScrot() { # Write scrot submenu items
IMG="$SCROTSDIR/%F-%H-%M-%S_scrot.png"
VIEW="'bl-image-viewer $IMG'"
menuSubmenu 'clipscrot' 'Clipboard Screenshots'
menuItem "Desktop Screenshot" "scrotclip.sh clipall"
menuItem "Desktop Screenshot clean" "scrotclip.sh clipclean"
menuItem "Active Window Screenshot" "scrotclip.sh clipwin"
menuItem "Select Area Screenshot" "scrotclip.sh clipsel"
menuSubmenuEnd
menuSubmenu 'scrot' 'scrot Screenshooter'
menuItem "scrot Now" "scrot $IMG -e $VIEW"
menuItem "scrot In 5 secs..." "scrot -d 5 $IMG -e $VIEW"
menuItem "scrot In 10 secs..." "scrot -d 10 $IMG -e $VIEW"
menuItem "scrot Select Area" "scrot -s $IMG -e $VIEW"
menuItem "scrot Current Focus" "scrot -u $IMG -e $VIEW"
menuItem "scrot Multi-Monitor" "scrot -m $IMG -e $VIEW"
menuSubmenuEnd
}
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
i think damo's advice is sane - use what bunsenlabs provides instead of hacking your own.
but since you asked:
xclip is also missing for me, will simply installing get me working or do I need to alter Openbox to swap out clipboard apps?
yes, just install xclip.
Offline
This is my baby script for selection prt scr. It's also courtesy of @Damo from few months back. Completely works for my needs. Selection prt scr to clipboard.
#!/bin/bash
maim -s /tmp/woot.png && xclip -selection clipboard -t image/png /tmp/woot.png && rm /tmp/woot.png
exit
I don't have patience or skill to dig deep enough every time system breaks itself or when I break something because of lack of patience and skill.
nore, 23 Feb 2019
Offline
This is my baby script for selection prt scr. It's also courtesy of @Damo from few months back. Completely works for my needs. Selection prt scr to clipboard.
#!/bin/bash maim -s /tmp/woot.png && xclip -selection clipboard -t image/png /tmp/woot.png && rm /tmp/woot.png exit
Fantastic! Thanks to Damo for it and to you for continuing the share!
Schw.im! A social site with an identity crisis.
Offline
no worries, glad I could help.
I don't have patience or skill to dig deep enough every time system breaks itself or when I break something because of lack of patience and skill.
nore, 23 Feb 2019
Offline