You are not logged in.

#1 2012-03-22 02:16:52

JeSuisNerd
Member
From: /home/egon
Registered: 2012-03-06
Posts: 30

[SOLVED] Can't use scrot with a shortcut in Xfce

I don't need to be bothered by a dialog and browsing to my screenshots directory every time I want to take a screenshot, so I've tried to set a keyboard shortcut in Xfce that lets me simply put a screenshot in the directory for me.  However, nothing seems to be happening.

I've set the command to be just plain old 'scrot' (and '/usr/bin/scrot' just to be sure) as suggested on the Arch Wiki and have tried the format suggested in the scrot man page.  Neither works, and I can't figure out why.  As a point of information, the

scrot '%Y-%m-%d.png' -e 'mv $f ~/shots/'

suggested by the man page doesn't work because it says that --.png is not a valid option.  So it would seem that the calls to strftime are being interpreted wrongly or at the wrong time?

Thanks for any help.

Last edited by JeSuisNerd (2012-03-31 23:55:38)

Offline

#2 2012-03-22 02:24:45

Isola
Member
Registered: 2010-02-02
Posts: 99

Re: [SOLVED] Can't use scrot with a shortcut in Xfce

Does it work if you make the command just:

scrot

It should save the screenshot in your home directory, but if it doesn't, try:

export DISPLAY=:0.0;scrot

And see if that works first!

Offline

#3 2012-03-22 02:38:23

JeSuisNerd
Member
From: /home/egon
Registered: 2012-03-06
Posts: 30

Re: [SOLVED] Can't use scrot with a shortcut in Xfce

Yep, I've tried just

scrot

(guess I should have put that in code tags as well).

Using your second command also worked from command line (did I mention all the ones I've tried are fine in a terminal?) but was useless as soon as I tried to use the shortcut.

Oh, and I checked my Xmonad key bindings to make sure the window manager wasn't stealing use of the key or something, and it's fine.

Offline

#4 2012-03-22 02:55:51

Isola
Member
Registered: 2010-02-02
Posts: 99

Re: [SOLVED] Can't use scrot with a shortcut in Xfce

What if you create a script like this:

#!/bin/bash
scrot '%Y-%m-%d.png' -e 'mv $f ~/shots/'

Make it executable:

chmod +x the_script

Then try it in the terminal and see if you get a screenshot, if you do, then modify the key bind in xfce to run:

/home/username/the_script

And see if it works that way. It's not really a solution if it works, because you need the script.

Offline

#5 2012-03-22 03:10:07

JeSuisNerd
Member
From: /home/egon
Registered: 2012-03-06
Posts: 30

Re: [SOLVED] Can't use scrot with a shortcut in Xfce

Dang, I've tried running the script from the terminal to make sure everything works and I get the image I want.  But when I run it from the shortcut I get nothing.  I've also tried using many different keys and combinations of keys for the shortcut to no avail.

Offline

#6 2012-03-22 03:28:36

Isola
Member
Registered: 2010-02-02
Posts: 99

Re: [SOLVED] Can't use scrot with a shortcut in Xfce

Hmm, does other shortcuts work, for example firefox if you use that?

I forgot in the script you need the display variable again, like so:

#!/bin/bash
sleep 0.1
export DISPLAY=:0.0
scrot '%Y-%m-%d.png' -e 'mv $f ~/shots/'

I added the "sleep" too because for some reason I have it in my old screenshot script. I'm not sure why.

Offline

#7 2012-03-22 03:35:34

JeSuisNerd
Member
From: /home/egon
Registered: 2012-03-06
Posts: 30

Re: [SOLVED] Can't use scrot with a shortcut in Xfce

Hm, now that you mention it, I can't use any of the Xfce keyboard shortcuts, including one I just made for firefox.  So it would seem that something has hijacked my keyboard.  I guess I'll have to see if I can make the window manager handle the shortcut.

Thanks for the help, Isola.  I lose internet access soon but will update in the morning to hopefully mark this "solved," though I'm going to consider getting the shortcut working solved whether or not I get my Xfce shortcuts back.

Offline

#8 2012-03-31 23:57:13

JeSuisNerd
Member
From: /home/egon
Registered: 2012-03-06
Posts: 30

Re: [SOLVED] Can't use scrot with a shortcut in Xfce

Sorry for the late update, I forgot to come back to fix this.

I was only able to figure out that none of my Xfce keyboard shortcuts worked, so I just let the window manager handle it by adding another shortcut in the Xmonad config.

Offline

Board footer

Powered by FluxBB