SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-01-29 13:19:10

airs
New Member
Registered: 2013-01-29
Posts: 5

rc.xml Keybind question [Solved]

I would like to set a keybind to printscreen on the numpad 0/insert button, but not the 0 on the top numbers or regular insert button, yet I am having trouble figuring out what the correct keybind is. Used google etc but no luck finding an answer. Was hoping one of you fine people could point me in the right direction.

<keybind key="keybind here etc">	
<action name="Execute">
<command>scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/scrots/'</command>
</action>
</keybind>

Also, would it be possible to make it only be bound while a certain program/task is running i.e ~/foo/bar.jar
?
Much thanks in advance.

Last edited by airs (2013-01-29 18:28:57)

Offline

Help fund CrunchBang, donate to the project!

#2 2013-01-29 15:37:17

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,192

Re: rc.xml Keybind question [Solved]

Use xev for that.

In a terminal:

xev

Make sure the white box is the active window, then press the key you want to get the keysym. The info is output to the terminal.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#3 2013-01-29 15:47:15

airs
New Member
Registered: 2013-01-29
Posts: 5

Re: rc.xml Keybind question [Solved]

Thanks PackRat.


Erm. Hope I did this right.

KeyPress event, serial 46, synthetic NO, window 0x3400001,
    root 0x152, subw 0x0, time 15275729, (-21,-51), root:(1126,266),
    state 0x0, keycode 90 (keysym 0xff9e, KP_Insert), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 46, synthetic NO, window 0x3400001,
    root 0x152, subw 0x0, time 15275841, (21,-43), root:(1168,274),
    state 0x0, keycode 90 (keysym 0xff9e, KP_Insert), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

I'm assuming it's KP_Insert?

<keybind key="KP_Insert">	
<action name="Execute">
<command>scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/scrots/'</command>
</action>
</keybind>

Did not work.
Do I have to restart #! or should it start working as soon as I save the rc.xml?

Offline

#4 2013-01-29 18:15:28

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,192

Re: rc.xml Keybind question [Solved]

You need to restart openbox so that it reads the rc.xml file again.

Normally, you don't need the "KP_" part of the keysysm; so if it still doesn't work, try without that part. There may also be an issue with the NumLock key - on vs off sort of issue.

Last edited by PackRat (2013-01-29 18:17:01)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#5 2013-01-29 18:28:40

airs
New Member
Registered: 2013-01-29
Posts: 5

Re: rc.xml Keybind question [Solved]

I restarted OB and it works perfect, with the KP part. Thank you kind sir. I'll go ahead and mark this solved, though do you know the answer to the bottom part? "would it be possible to make it only be bound while a certain program/task is running i.e ~/foo/bar.jar"

Offline

#6 2013-01-30 02:52:01

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,192

Re: rc.xml Keybind question [Solved]

First thought is that would not be possible, but I am no expert -

but there are plenty examples of key bindings for openbox here.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#7 2013-01-30 03:10:57

rkwurth
#! Junkie
Registered: 2012-09-04
Posts: 365

Re: rc.xml Keybind question [Solved]

You COULD, if you wanted really wanted to. You'd need two rc.xml files, rc.xml.1 and rc.xml.2. 1 contains your normal keybindings, and 2 contains the numpad insert screenshot keybinding. When your DE loads, tell your system to softlink 1 to rc.xml. When you launch whichever application you're referring to, tell your system to remove the softlink from 1 to rc.xml, then to softlink 2 to rc.xml, then to reload/reconfigure your rc.xml. This could be done w a script you've bound to the keybind you use to launch the application, or by at least somewhat globally aliasing the command used the run the application to the script, or whatever works for you. You'd also need to find a way to make your system softlink 1 to rc.xml and reconfigure openbox again  after the application is closed.

Offline

#8 2013-02-06 11:00:55

pakerjon
New Member
Registered: 2013-02-06
Posts: 1

Re: rc.xml Keybind question [Solved]

sorry i have idea regarding it.. otherwise i must help you..
cool  angel


paker
cool  angel

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo