You are not logged in.
I like very much MacOS:s way of screenshotting an area with a key combo, and have been trying to figure out to do the same with scrot. Scrot -s captures and creates the file in current directory, but the way I do it from the menu (saving to screenshots -dir and launching ImageViewer) is very much preferrable. And that's where I stumble.
Halp, plz?
(unintentionally NSFW title reformatted )
Last edited by Peregrino69 (2021-09-16 17:07:50)
Offline
with commands like these use your keybinding tool to connect these to your desired keystroke combinations. I think you can hook up terminal commands to your openbox menu too.
(this is from my Arch keybindings file)
# scrot select and copy to clipboard, delete filie
alt + Print
scrot -s foo.png && xclip -se c -t image/png -i foo.png && rm foo.png &
# scrot full screen and save to Screenshots
#super + Print
# scrot ~/Screenshots/%Y-%m-%d-%T-screenshot.png
# scrot print screen
Print
scrot ~/Screenshots/%Y-%m-%d-%T-selectscreenshot.png
#Scrot 5 second [Shots go to your screenshots folder]
ctrl + Print
scrot -d 5 -c ~/Screenshots/%Y-%m-%d-%T-screenshot.png
# select and save copy to
alt + ctrl + Print
scrot -s ~/Selectshots/%Y-%m-%d-%T-selectscreenshot.png &
Last edited by phuturism (2021-09-15 23:32:36)
Offline
Thanks. I was a bit unclear... the -s option is the one I want, and I do know how to create the shortcut.
The part I'm strugging with is having a way to save the image and open it with Ristretto as one command, i.e. the way it works on the menu. I could
var=(date [options]) | scrot -s ~/Pictures/screenshots/$var.png | ristretto ~/Pictures/screenshots/$var.png
... but generally there are more elegant ways of doing things than I can come up with
Offline
Yes I should have read more carefully...
No doubt some more experienced command line folks can help you to pass/open the file using the date variables.
Last edited by phuturism (2021-09-16 06:03:05)
Offline
Why not put all the commands you need in a script, and run the script with a keybind?
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
Thanks. I was a bit unclear... the -s option is the one I want, and I do know how to create the shortcut.
The part I'm strugging with is having a way to save the image and open it with Ristretto as one command, i.e. the way it works on the menu. I could
var=(date [options]) | scrot -s ~/Pictures/screenshots/$var.png | ristretto ~/Pictures/screenshots/$var.png
... but generally there are more elegant ways of doing things than I can come up with
Does this:
var=(date [options])
ever change? scrot accepts strftime options directly (see the man page for examples).
Then you can try something like:
scrot -s '%Y-%m-%d_%s.png' -e 'mv $f ~/temp/ ; sxiv ~/temp/$f'
change ~/temp to your directory of choice, and change sxiv to your image viewer of choice (or use xdg-open for the default image viewer).
Addy has a nice script for taking screenshots - screeny; it worked last time I tried it.
scrot or it never happened 8o
Last edited by PackRat (2021-09-16 14:01:26)
You must unlearn what you have learned.
-- yoda
Offline
Does this:
var=(date [options])
ever change? scrot accepts strftime options directly (see the man page for examples).
Then you can try something like:
scrot -s '%Y-%m-%d_%s.png' -e 'mv $f ~/temp/ ; sxiv ~/temp/$f'
change ~/temp to your directory of choice, and change sxiv to your image viewer of choice (or use xdg-open for the default image viewer).
Addy has a nice script for taking screenshots - screeny; it worked last time I tried it.
There we go - removing the need to use date elegancifies the line The name indeed doesn't need to change, date-time-filename -construct is useful here.
@damo - I could've, but wouldn't have learned anything new
@phuturism - nah, I really didn't make myself clear. Thanks for pitching in
And thanks @PackRat. I've got well enough here to declare the issue solved
Offline
PackRat wrote:Does this:
var=(date [options])
ever change? scrot accepts strftime options directly (see the man page for examples).
Then you can try something like:
scrot -s '%Y-%m-%d_%s.png' -e 'mv $f ~/temp/ ; sxiv ~/temp/$f'
change ~/temp to your directory of choice, and change sxiv to your image viewer of choice (or use xdg-open for the default image viewer).
Addy has a nice script for taking screenshots - screeny; it worked last time I tried it.
There we go - removing the need to use date elegancifies the line
The name indeed doesn't need to change, date-time-filename -construct is useful here.
@damo - I could've, but wouldn't have learned anything new
@phuturism - nah, I really didn't make myself clear. Thanks for pitching in
And thanks @PackRat. I've got well enough here to declare the issue solved
No worries! You can see the commands I use from my examples, but you've inspired me to set one up to open in my image editor too, this would be useful.
Offline