You are not logged in.

#176 2014-06-24 10:16:36

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

Re: sxhkd — Simple X HotKey Daemon

sxkhd greets me with:

Could not grab key 24 with modfield 65: the combination is already grabbed.

The only setting in the config corresponding to keycode 24 (q) would be:

super + shift + q
    pkill -x panel; bspc quit

I wonder, does super+shift correspond to modfield 65? How can I find that out?

Also, can I somehow find out what the X server executes upon seeing that key combination? I have no idea why sxhkd wouldn't be able to grab that combination.

Last edited by Stalafin (2014-06-24 11:07:43)

Offline

#177 2014-06-24 12:13:57

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxhkd — Simple X HotKey Daemon

Stalafin wrote:

I wonder, does super+shift correspond to modfield 65?
How can I find that out?

Here's an excerpt from <xcb/xproto.h>:

typedef enum xcb_mod_mask_t {
    XCB_MOD_MASK_SHIFT = 1,
    XCB_MOD_MASK_LOCK = 2,
    XCB_MOD_MASK_CONTROL = 4,
    XCB_MOD_MASK_1 = 8,
    XCB_MOD_MASK_2 = 16,
    XCB_MOD_MASK_3 = 32,
    XCB_MOD_MASK_4 = 64,
    XCB_MOD_MASK_5 = 128,
    XCB_MOD_MASK_ANY = 32768
} xcb_mod_mask_t;

super is generally on mod4, so, yes (65 = 64 + 1).


gh · da · ds

Offline

#178 2014-07-14 22:43:08

SolarBoyMatt
Member
Registered: 2012-01-07
Posts: 263

Re: sxhkd — Simple X HotKey Daemon

I seem to be having some issues getting my configuration to work correctly. I have  a machine without Page Down, Page Up, and Super keys, and I would like to map 'Page Up' and 'Page Down' to 'alt + up' and 'alt + down' respectively.

sxhkdrc

{F6,F7}
    xbacklight -{dec,inc} 10

F8
    amixer set Master toggle

{F9,F10}
    amixer set Master 10{-,+} unmute

alt + Up
    xte 'key Page_Up'

alt + Down
    xte 'key Page_Down'

However this configuration does not seem to work how I expected. When I run sxhkd from the command line, it does not output any errors when trying to use the bindings, but neither of them seem to work either. I have not set these bindings in any other program, and I'm not sure if this is something with sxhkd or xte.

Offline

#179 2014-07-16 08:09:25

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxhkd — Simple X HotKey Daemon

SolarBoyMatt wrote:

I seem to be having some issues getting my configuration to work correctly.

Start with something simple:

F1
	echo hello
SolarBoyMatt wrote:

I have  a machine without Page Down, Page Up, and Super keys, and I would like to map 'Page Up' and 'Page Down' to 'alt + up' and 'alt + down' respectively.

You can do this with xmodmap (cf. Mode_switch).


gh · da · ds

Offline

#180 2014-07-24 08:34:15

Ploppz
Member
Registered: 2013-09-14
Posts: 311

Re: sxhkd — Simple X HotKey Daemon

I have problems using scrot -s:

# screenshot
Print
	cd /tmp; \
	scrot; \
	cd - 
ctrl + Print
	cd /tmp; \
	scrot -s; \
	cd - 

Print works fine. But ctrl + Print; nothing happens. Running sxhkd from terminal, I got this error when pressing ctrl + Print:

giblib error: couldn't grab keyboard:Resource temporarily unavailable

Offline

#181 2014-07-24 12:09:39

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxhkd — Simple X HotKey Daemon

Ploppz wrote:

Print works fine. But ctrl + Print; nothing happens.

Use ctrl + @Print instead.


gh · da · ds

Offline

#182 2014-08-04 19:02:27

earsplit
Member
Registered: 2012-03-31
Posts: 187
Website

Re: sxhkd — Simple X HotKey Daemon

I'm having a weird issue with the toggle syntax, or I'm not using it correctly. I'm trying to switch between soundcards with the following command:

XF86WebCam
        sed -i 's/card [0-9]/card {0,1}/' $HOME/.asoundrc

But it looks like after a few seconds, it forgets what I ran last. It looks like 1->0 requires one kepress, and 0->1 requires two rapid keypresses.


((( configs :: website )))

Offline

#183 2014-08-07 13:41:46

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxhkd — Simple X HotKey Daemon

earsplit wrote:

I'm having a weird issue with the toggle syntax, or I'm not using it correctly.

The following example works fine for me:

a
	echo {0,1}

gh · da · ds

Offline

#184 2014-08-08 16:42:53

earsplit
Member
Registered: 2012-03-31
Posts: 187
Website

Re: sxhkd — Simple X HotKey Daemon

bloom wrote:
earsplit wrote:

I'm having a weird issue with the toggle syntax, or I'm not using it correctly.

The following example works fine for me:

a
	echo {0,1}

This works fine for me too. I think the issue is with these special function keys that require a chord to trigger (in this case, XF86WebCam == FN + F6). For instance, this is the output I get when I pause briefly after the state is set to 0:

XF86WebCam
       echo {0,1} >> ~/.test
> tail -f ~/.test
1
0
1
0
1
0
-- pause --
0
1
0
1

I don't know if this is related, but here is the output from XEV after disabling the bound sxhkd keys:

KeyRelease event, serial 32, synthetic NO, window 0x1c00001,
    root 0xa1, subw 0x0, time 46176547, (132,283), root:(665,301),
    state 0x0, keycode 220 (keysym 0x1008ff8f, XF86WebCam), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Is there anything else I can do to debug this? I've also tried binding it to the release event to no avail.


((( configs :: website )))

Offline

#185 2014-08-08 17:00:59

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxhkd — Simple X HotKey Daemon

earsplit wrote:

I'm having a weird issue with the toggle syntax

In a local sxhkd repository:

make clean debug
./sxhkd -c ~/foorc

Where ~/foorc has the following content:

XF86WebCam
       echo {0,1}

Then try to reproduce the problem, and post the output.


gh · da · ds

Offline

#186 2014-08-08 22:57:43

earsplit
Member
Registered: 2012-03-31
Posts: 187
Website

Re: sxhkd — Simple X HotKey Daemon

bloom wrote:
earsplit wrote:

I'm having a weird issue with the toggle syntax

In a local sxhkd repository:

make clean debug
./sxhkd -c ~/foorc

Where ~/foorc has the following content:

XF86WebCam
       echo {0,1}

Then try to reproduce the problem, and post the output.

Startup:

keysym for 'Alt_L' is 0xFFE9.
keysym for 'Alt_R' is 0xFFEA.
keysym for 'Super_L' is 0xFFEB.
keysym for 'Super_R' is 0xFFEC.
keysym for 'Hyper_L' is 0xFFED.
keysym for 'Hyper_R' is 0xFFEE.
keysym for 'Mode_switch' is 0xFF7E.
keysym for 'Num_Lock' is 0xFF7F.
keysym for 'Scroll_Lock' is 0xFF14.
lock fields 16 2 0
key chord 65307 0
load configuration 'foorc'
XF86WebCam: echo 0
key chord 269025167 0
XF86WebCam: echo 1
key chord 269025167 0
grab key 220 0
grab key 220 16
grab key 220 2
grab key 220 18
grab key 220 0
grab key 220 16
grab key 220 2
grab key 220 18

Hitting fn+F6 once:

mapping notify 1 248
lock fields 16 2 0
reload
cleanup
load configuration 'foorc'
XF86WebCam: echo 0
key chord 269025167 0
XF86WebCam: echo 1
key chord 269025167 0
ungrab
grab key 220 0
grab key 220 16
grab key 220 2
grab key 220 18
grab key 220 0
grab key 220 16
grab key 220 2
grab key 220 18
key chord 65307 0
mapping notify 0 0
key press 220 0
key release 220 0
num active 0
0

Multiple rapid presses:

key press 220 0
key release 220 0
num active 0
1
key press 220 0
key release 220 0
num active 0
0
key press 220 0
key release 220 0
num active 0
1
key press 220 0
key release 220 0
num active 0
0

Pausing and hitting it again, lingering on the FN key a bit before hitting F6:

mapping notify 1 248
lock fields 16 2 0
reload
cleanup
load configuration 'foorc'
XF86WebCam: echo 0
key chord 269025167 0
XF86WebCam: echo 1
key chord 269025167 0
ungrab
grab key 220 0
grab key 220 16
grab key 220 2
grab key 220 18
grab key 220 0
grab key 220 16
grab key 220 2
grab key 220 18
key chord 65307 0
mapping notify 0 0
mapping notify 1 248
lock fields 16 2 0
reload
cleanup
load configuration 'foorc'
XF86WebCam: echo 0
key chord 269025167 0
XF86WebCam: echo 1
key chord 269025167 0
ungrab
grab key 220 0
grab key 220 16
grab key 220 2
grab key 220 18
grab key 220 0
grab key 220 16
grab key 220 2
grab key 220 18
key chord 65307 0
mapping notify 0 0
key press 220 0
key release 220 0
num active 0
0

((( configs :: website )))

Offline

#187 2014-08-09 07:53:12

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxhkd — Simple X HotKey Daemon

It should be fixed by 49918e7.

To the users of non QWERTY keyboards: the previous behavior can be triggered with -m -1, but it will be preferable to try -m 1 first.

Please note that -n is no more.

Last edited by bloom (2014-08-09 07:55:54)


gh · da · ds

Offline

#188 2014-08-09 18:33:34

earsplit
Member
Registered: 2012-03-31
Posts: 187
Website

Re: sxhkd — Simple X HotKey Daemon

bloom wrote:

It should be fixed by 49918e7.

To the users of non QWERTY keyboards: the previous behavior can be triggered with -m -1, but it will be preferable to try -m 1 first.

Please note that -n is no more.

Works great thanks as usual


((( configs :: website )))

Offline

#189 2014-10-06 01:14:41

Konkorde
Member
Registered: 2014-03-17
Posts: 23

Re: sxhkd — Simple X HotKey Daemon

Is there a better way to map a mouse button?  I'm using this:

button9
	xdotool keydown ISO_Level3_Shift
@button9 + {_,shift, ctrl, alt, shift + ctrl, shift + alt, shift + ctrl + alt, ctrl + alt, ISO_Level3_Shift, shift + ISO_Level3_Shift, ctrl + ISO_Level3_Shift, ctrl + shift + ISO_Level3_Shift}
	xdotool keyup ISO_Level3_Shift

But it seems needlessly complex; I just want to say "for all modifiers".  At least using nesting on the modifier combinations would help.  But what I really want to do is hide button9 completely and pass all other modifiers.

Also, if I press mouse9 more than once, it tends to lock the modifier and then pass the mouse event through to applications: neither of which are desired.

EDIT:
This works better.  I need to use the modifier name rather than key name, should not have spaces in the modifier list, and should put the modifiers before the button.

{_,shift} + button9
	xdotool keydown ISO_Level3_Shift
{_,mod3,shift,shift + mod3} + @button9
 	 xdotool keyup ISO_Level3_Shift

Is there any way to automatically generate all 256 permutations of modifiers (AutoHotKey has a * prefix, e.g., *Button9)?

Last edited by Konkorde (2014-10-06 01:42:59)

Offline

#190 2014-10-08 08:20:10

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxhkd — Simple X HotKey Daemon

Konkorde wrote:

Is there any way to automatically generate all 256 permutations of modifiers (AutoHotKey has a * prefix, e.g., *Button9)?

As of d1f8d07:

any + button9

gh · da · ds

Offline

#191 2014-10-11 21:07:17

Konkorde
Member
Registered: 2014-03-17
Posts: 23

Re: sxhkd — Simple X HotKey Daemon

I was away from my computer all week & didn't see this until now: thanks!

Offline

#192 2014-10-30 12:30:31

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

Re: sxhkd — Simple X HotKey Daemon

The following keybindings do not do anything on my machine:

super + alt + {h,j,k,l}
bspc window -e {left -10,down +10,up -10,right +10}

And I do not understand why: if I execute the commands manually, everything works fine. And as far as I can tell, my system also detects the keys correctly; xev reports:

KeyRelease event, serial 32, synthetic NO, window 0x1600001,
    root 0x80, subw 0x0, time 6281284, (-248,71), root:(360,1210),
    state 0x48, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x1600001,
    root 0x80, subw 0x0, time 6281292, (-248,71), root:(360,1210),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Any idea why sxhkd doesn't like those bindings?

Offline

#193 2014-10-31 00:24:52

o_caino
Member
Registered: 2013-06-06
Posts: 166

Re: sxhkd — Simple X HotKey Daemon

Stalafin wrote:
super + alt + {h,j,k,l}
bspc window -e {left -10,down +10,up -10,right +10}

Commands should begin with a space.

super + alt + {h,j,k,l}
    bspc window -e {left -10,down +10,up -10,right +10}

Offline

#194 2014-10-31 12:40:50

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

Re: sxhkd — Simple X HotKey Daemon

o_caino wrote:
Stalafin wrote:
super + alt + {h,j,k,l}
bspc window -e {left -10,down +10,up -10,right +10}

Commands should begin with a space.

super + alt + {h,j,k,l}
    bspc window -e {left -10,down +10,up -10,right +10}

Thank you for noticing that. All my bindings are correct, except that one. I have no idea how I overlooked that. big_smile

Offline

#195 2014-12-14 19:15:42

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 245

Re: sxhkd — Simple X HotKey Daemon

Hi everyone, i use the sxhkd with herbstluftwm and have a little problem. How increase the spawn speed? Its little bit slow the terminal and frame movements/spawn/actions.

Thanks, Stephan

Offline

#196 2015-02-16 17:24:39

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: sxhkd — Simple X HotKey Daemon

The sxhkd package is now in community.


gh · da · ds

Offline

#197 2015-02-16 17:58:33

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: sxhkd — Simple X HotKey Daemon

bloom wrote:

The sxhkd package is now in community.

Woot! Congrats!

Offline

#198 2015-03-09 11:50:30

pepib
Member
Registered: 2014-07-13
Posts: 23

Re: sxhkd — Simple X HotKey Daemon

I have a button on my laptop's keyboard that correspond to Alt + F4, so in openbox this button is recognized in automatically and I use this to close the different windows. Can I set Alt + F4 to close the windows across the different wm with sxhkd?

Offline

#199 2015-03-09 16:06:46

angelic_sedition
Member
Registered: 2014-01-20
Posts: 124
Website

Re: sxhkd — Simple X HotKey Daemon

pepib wrote:

I have a button on my laptop's keyboard that correspond to Alt + F4, so in openbox this button is recognized in automatically and I use this to close the different windows. Can I set Alt + F4 to close the windows across the different wm with sxhkd?

If you can find a shell command that works across different window managers.

$ wmctrl -c :ACTIVE:
# if that doesn't work, try one of these
$ xdo close
$ xdotool getactivewindow windowkill

Offline

#200 2015-03-10 08:32:13

pepib
Member
Registered: 2014-07-13
Posts: 23

Re: sxhkd — Simple X HotKey Daemon

angelic_sedition wrote:
pepib wrote:

I have a button on my laptop's keyboard that correspond to Alt + F4, so in openbox this button is recognized in automatically and I use this to close the different windows. Can I set Alt + F4 to close the windows across the different wm with sxhkd?

If you can find a shell command that works across different window managers.

$ wmctrl -c :ACTIVE:
# if that doesn't work, try one of these
$ xdo close
$ xdotool getactivewindow windowkill

thanks man, however I write this only for give to other users interested much info:

xdotool get active window kill

kill the window because kill the process

xdo close

kill only the window without kill the refer process.

Offline

Board footer

Powered by FluxBB