You are not logged in.

#1 2014-01-23 10:38:58

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Openbox Print Screen keybind Won't work

In .config/openbox/rc.xml i've got:

...
    <!-- Screenshot -->
    <keybind key="Print">
     <action name="Execute">
      <command>scrot -q 100 -e 'mv $f ~/Screenshots/'</command>
     </action>
    </keybind>
...

Nothing happens when i press the Print Screen key.I checked with Xev and X detects the print screen key as "Print", why is it not working? How can i make it work?

Offline

#2 2014-01-23 16:00:52

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,721

Re: Openbox Print Screen keybind Won't work

Did you reload the configuration after you made the change to rc.xml?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Online

#3 2014-01-23 23:28:09

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: Openbox Print Screen keybind Won't work

Yes, of course. (Otherwise it wouldn't have worked with another keybind)

I've restarted and everything too.

Last edited by rabcor (2014-01-23 23:28:20)

Offline

#4 2014-01-24 00:04:56

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Openbox Print Screen keybind Won't work

Are you sure about the 'mv...'? My settings work this way:

    <keybind key="W-Print">
      <!-- Screenshot of Area or Window -->
      <action name="Execute">
        <command>scrot -bs /home/bp/scratch/screen_%Y-%m-%d_%H-%M-%S.png</command>
      </action>
    </keybind>

To know or not to know ...
... the questions remain forever.

Offline

#5 2014-01-24 00:47:15

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: Openbox Print Screen keybind Won't work

yes i'm sure, the command worked if i used another keybind. Also works from terminal. The mv command is as explained in the programs man page.

Last edited by rabcor (2014-01-24 00:50:15)

Offline

#6 2014-01-24 00:57:32

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Openbox Print Screen keybind Won't work

rabcor wrote:

yes i'm sure, the command worked if i used another keybind. Also works from terminal. The mv command is as explained in the programs man page.


No, it is not. The command from the man pages works for me, but your version (without a file name) fails.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2014-01-24 01:14:02

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: Openbox Print Screen keybind Won't work

It works for me, it just uses the default filename if i don't specify one.

The command from the man page is

scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/'

my command is

scrot -q 100 -e 'mv $f ~/Screenshots/'

It is the command from the man page minus the filename part.
It seems I don't have to specify file name, the command works perfectly fine on my end, dunno why it fails for you :I (perhaps you don't have ~/Screenshots/ ?)

I can try changing the command though, nothing to lose i guess. I'll just make it execute something i know to work, like terminator...

Yes, i changed the keybind to "W-w" from "Print" and it opens terminator, but if it's set to "Print" nothing will happen.

Last edited by rabcor (2014-01-24 01:20:46)

Offline

#8 2015-08-14 13:26:14

jqrsd
Member
Registered: 2013-09-12
Posts: 12

Re: Openbox Print Screen keybind Won't work

I had the same problem, openbox on some machines just cannot resolve "Print" for some reason. So I have placed the hex-code of the key in the config, and now it works.

1) run "xev", press printscreen, the output will contain something like:

state 0x0, keycode 218 (keysym 0xff61, Print), same_screen YES,

2) notice the keycode here and convert it to hexadecimal. In my case 218 = 13*16 + 10 = DA

3) put it in keybind section of rc.xml:

<keybind key="0xDA">

Offline

#9 2015-08-15 08:43:06

justasug
Member
Registered: 2014-08-03
Posts: 174

Re: Openbox Print Screen keybind Won't work

Thanks for the solution jqrsd, it works great.
How would one go about using a modifier, like Alt, with it? The usual way of adding A separated by a dash like "A-0xDA" doesn't work. I also tried using the modifier's numeric code in hexadecimal "0x40-0xDA" but without success.

Offline

#10 2015-08-21 13:49:57

jqrsd
Member
Registered: 2013-09-12
Posts: 12

Re: Openbox Print Screen keybind Won't work

justasug wrote:

The usual way of adding A separated by a dash like "A-0xDA" doesn't work.

That's strange: "A-0xDA" doesn't work for me as well, but both "C-0xDA" and "S-0xDA" (Ctrl / Shift + PrintScreen) work fine, consider using one of these combinations if any work for you

Offline

Board footer

Powered by FluxBB