You are not logged in.
Homepage:
https://github.com/baskerville/sxhkd
Mailing List:
sxhkd at librelist dot com
Last edited by bloom (2015-02-16 17:24:58)
Offline
sxhkd is intended to replace xbindkeys.
May I ask why? I'm not trying to be snarky, I'm genuinely curious. Does this new tool add functionality, or fix something broken in xbindkeys?
Last edited by 2ManyDogs (2013-01-03 19:59:20)
Offline
It doesn't include a scheme interpreter, at least.
@bloom, how hard would it be to also add grabs for mouse-clicks on the root window? This could be pretty useful together with minimalist window managers.
Offline
Does this new tool add functionality, or fix something broken in xbindkeys?
I prefer to remove functionalities ☺
I had a few issues with xbindkeys which led me to write sxhkd:
It isn't KISS (Guile, -k, -mk, ...).
The commands of the configuration file have to be surrounded by double quotes and don't support environment variables.
There are two mechanisms for reloading the configuration file: none of them works.
Implicit modifier names ('alt', 'super', ...) are not supported.
Last edited by bloom (2013-01-04 11:40:45)
Offline
Offline
To launch a menu (mygtkmenu, dzen, 9menu...) with right-click, or change workspaces with middle-click. Another ideia would be to implement keychains in a similar way to subtle and openbox (press a master key, release it, then press another to exec/finish the action).
Offline
The commands of the configuration file have to be surrounded by double quotes and don't support environment variables.
There are two mechanisms for reloading the configuration file: none of them works.
These are the two reasons that I am going to start using this, especially the bolded one. Thanks.
Offline
How hard would it be to also add grabs for mouse-clicks on the root window?
I've implemented this in the mouse branch.
This branch provides the following new keysym names: button1, button2, button3, ..., button24.
The next important feature I plan to implement is templates:
super + alt + 0-9
mpc -q seek %{0-9%}0%
super + h,j,k,l
bspc focus %{left,down,up,right%}
Last edited by bloom (2013-01-04 22:01:53)
Offline
chneukirchen wrote:How hard would it be to also add grabs for mouse-clicks on the root window?
I've implemented this in the mouse branch.
This branch provides the following new keysym names: button1, button2, button3, ..., button24.
This seems to work on any click, not just on the root window. (Which perhaps is cool too, but not what I want.)
Offline
I've got a feature request:
Would it be possible to to have multiple config files that merge into one? What I mean is, when sxhkd runs it loads the default config file or whatever one is specified by -c. Then, if I were to later run the command sxhkd -merge CONF_FILE_2, the commands in CONF_FILE_2 would be added to those in the originally loaded file.
The reason for this is simple: you can maintain a list of universal hotkeys in one conf file, and a list that is specific to a different machine, WM, etc. You could simple create multiple list with the same commands defined, but then if you want to change one of the universal hotkeys, you have multiple files to edit instead of just one.
Offline
Would it be possible to to have multiple config files that merge into one? What I mean is, when sxhkd runs it loads the default config file or whatever one is specified by -c. Then, if I were to later run the command sxhkd -merge CONF_FILE_2, the commands in CONF_FILE_2 would be added to those in the originally loaded file.
That could be achieved by adding a -f FIFO option. Then you would output the content of your supplemental configuration files to it, but when receiving SIGUSR1, it would not be possible to reload the FIFO...
The reason for this is simple: you can maintain a list of universal hotkeys in one conf file, and a list that is specific to a different machine, WM, etc.
It makes sense.
Offline
I have implemented sequences, which means that you can now use the following:
super + {h,j,k,l}
bspc focus {left,down,up,right}
instead of
super + h
bspc focus left
super + j
bspc focus down
super + k
bspc focus up
super + l
bspc focus right
Last edited by bloom (2013-01-05 21:33:21)
Offline
[...] Another ideia would be to implement keychains in a similar way to subtle and openbox (press a master key, release it, then press another to exec/finish the action).
Take a look at xchainkeys, which is somewhat similar to this project, but has its emphasis on keychaining. Supports the crucial feature of passing through the prefix key to the focused application (e.g. what screen does with C-a a or ratpoison does with C-t t).
Offline
@bslackr:
I've added support for extra configuration files, and the synopsis is now:sxhkd [-h|-v|-c CONFIG_FILE] [EXTRA_CONFIG ...]
Awesome, thanks.
Offline
I'm trying to invoke sxhkd from my xinitrc with the default configuration file and one extra configuration file, but for some reason only the default configuration file is working. When I kill it, and then invoke the same command from the terminal, all hotkeys work. Do you have any reason why this might be?
Here's the command:
sxhkd ~/.config/sxhkd/$HOST &
Edit: Nevermind, this has nothing to do with sxhkd. $HOST doesn't exist in sh, which startx runs. I just had to change how slim invokes startx.
Last edited by bslackr (2013-01-06 18:50:14)
Offline
Hi, awesome tool, thanks for that. Especially the sequences stuff. Uses maybe one third of the lines I have with xbindkeys, allthough that always worked fine for me. Question: when run from commandline, sxhkd not only has output for sxhkd, but also for the apps you call with a keybinding. Not sure if that's a bug or a feature. Did you deliberately do this? Is it configurable? (apart from appending >/dev/null 2>&1 to every command line in sxhkdrc)
Offline
Very simple/sloppy vim syntax:
if exists("b:current_syntax")
finish
endif
syntax include @Shell syntax/sh.vim
syn match sxMapping "[^ #].*" contains=sxKey,sxMod,sxConj,sxTemplate
syn match sxKey "[^ {,}+]\+" contained contains=sxKeyMod
syn match sxKeyMod "[!@]" contained
syn keyword sxMod super hyper meta alt control ctrl shift mode_switch lock mod1 mod2 mod3 mod4 mod5 contained
syn match sxConj "+" contained
syn region sxTemplate matchgroup=sxBrace start=/{/ end=/}/ contained keepend oneline contains=sxKey,sxMod,sxConj,sxComma
syn match sxComma "," contained
syn match sxComment "^#.*$"
syn match sxCmd "^ .*$" containedin=ALL contains=@Shell
hi def link sxKey Identifier
hi def link sxKeyMod Special
hi def link sxMod Keyword
hi def link sxBrace Special
hi def link sxConj Delimiter
hi def link sxComma Delimiter
hi def link sxComment Comment
let b:current_syntax = "sxhkdrc"
Offline
Trying this out it looks very good. One issue I have though is I can't get it to recognise my windows key. It was "mod4" under xbindkeys (and my WM) and xev says it's "Super_L", but trying both "super" and "mod4" in sxhkd results in nothing happening.
If I use "super + F3" (and maybe some other combinations, I'd have to check) results in the following messages:
# F3 Contacts
super + F3
tmnl -title Contacts -e bash -i -c contacts
Could not grab key 69 with modfield 64: the combination is already grabbed.
Could not grab key 69 with modfield 80: the combination is already grabbed.
Could not grab key 69 with modfield 66: the combination is already grabbed.
Could not grab key 69 with modfield 82: the combination is already grabbed.
Could not grab key 69 with modfield 64: the combination is already grabbed.
Could not grab key 69 with modfield 80: the combination is already grabbed.
Could not grab key 69 with modfield 66: the combination is already grabbed.
Could not grab key 69 with modfield 82: the combination is already grabbed.
I do use the windows key in my WM (spectrwm) so these may be related to that - but not the with the Fx keys which I'm trying to map using sxhkd.
"alt + Fx" is working fine.
Finally, it's not recognising the XF86 audio keys:
#-- Audio Keys
XF86AudioRaiseVolume
amixer sset Master 1+ unmute
XF86AudioLowerVolum
amixer sset Master 1- unmute
XF86AudioMute
amixer sset Master toggle
Unrecognized key name: 'XF86AudioRaiseVolume'.
Invalid hotkey: 'XF86AudioRaiseVolume'.
Unrecognized key name: 'XF86AudioLowerVolum'.
Invalid hotkey: 'XF86AudioLowerVolum'.
Unrecognized key name: 'XF86AudioMute'.
Invalid hotkey: 'XF86AudioMute'
These are the names returned by xev.
Any ideas what I'm doing wrong?
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline