You are not logged in.
Could you provide further instructions on how to reproduce?
I'll assume urxvt is being used.
Open a virtual terminal on an empty desktop.
Execute:
tabbed urxvt -embed &
in said terminal.
Close said terminal, leaving only the tabbed window.
Close (via bspc window -c) the tabbed window.
sxhkd doesn't respond to keypresses.
Switch to alternative tty and execute:
DISPLAY=:0 urxvt &
and sxhkd becomes responsive again.
It may be worth noting that switching to an empty desktop during the last step (e.g. DISPLAY=:0 bspc desktop -f \^3, where the third desktop is empty) also works.
[edit]: Just a moment too late!
Last edited by Supplantr (2013-09-20 17:35:25)
I use linux and I dont understand nothing in this post.
Offline
if a tabbed instance containing any embedded windows is the only window on its bspwm desktop when it's closed, sxhkd becomes unresponsive.
It was a bspwm bug which is fixed by 0d1a111.
Thanks for reporting!
Last edited by bloom (2013-09-20 19:30:51)
Offline
Offline
is line length limited? This sequence can't be parsed rightly.
super + y;{0-6}
echo {\'xterm -title MAIN-TERMINAL -e tmux\' \'MAIN-TERMINAL\',\
\'wicd-client -n\' \'Wicd Network Manager\',\
\'xterm -title VIFM -e /usr/bin/vifm\' \'VIFM\',\
\'xterm -title TERMINAL-HTOP -e sudo htop\' \'TERMINAL-HTOP\',\
\'gvim\' \'MAIN-GVIM\',\
\'sgvim\' \'ROOT-GVIM\',\
\'firefox\' \'Vimperator\'
}
Offline
moneylcj wrote:\'firefox\' \'Vimperator\'
There's a missing backslash at the end of the above line.
Thanks bloom
modify \'firefox\' \'Vimperator\' to \'firefox\' \'Vimperator\'\
press super+o then 1-6, output is
{'xterm -title MAIN-TERMINAL -e tmux' 'MAIN-TERMINAL','wicd-client -n' 'Wicd Network Manager','xterm -title VIFM -e /usr/bin/vifm' 'VIFM','xterm -title TERMINAL-HTOP -e sudo htop' 'TERMINAL-HTOP','gvim' 'MAIN-GVIM','sgvim' 'ROO
But when delete the longest line, everything is ok.
Error:
super + y;{0-6}
echo {\'xterm -title MAIN-TERMINAL -e tmux\' \'MAIN-TERMINAL\',\
\'wicd-client -n\' \'Wicd Network Manager\',\
\'xterm -title VIFM -e /usr/bin/vifm\' \'VIFM\',\
\'xterm -title TERMINAL-HTOP -e sudo htop\' \'TERMINAL-HTOP\',\
\'gvim\' \'MAIN-GVIM\',\
\'sgvim\' \'ROOT-GVIM\',\
\'firefox\' \'Vimperator\'\
}
OK:
super + y;{0-5}
echo {\'xterm -title MAIN-TERMINAL -e tmux\' \'MAIN-TERMINAL\',\
\'wicd-client -n\' \'Wicd Network Manager\',\
\'xterm -title VIFM -e /usr/bin/vifm\' \'VIFM\',\
\'gvim\' \'MAIN-GVIM\',\
\'sgvim\' \'ROOT-GVIM\',\
\'firefox\' \'Vimperator\'\
}
Offline
what is the correct way to restart sxhkd?
i mean if i change my config file and want to reload sxhkd
I have this set up is it ok?
mode_switch + shift +r
sxhkd -c ~/.config/sxhkd/myconfig
Last edited by chickenPie4tea (2013-10-07 15:03:47)
You can like linux without becoming a fanatic!
Offline
@Stebalien thanks for that - I couldn't find the best way to do it in the documentation on sxhkd
the SIGUSR1 command, never come across it before, don't know the first thing abt signals, need to look it up, anyhow it works.
Last edited by chickenPie4tea (2013-10-07 16:56:26)
You can like linux without becoming a fanatic!
Offline
how do you refer to the arrow keys?
You can like linux without becoming a fanatic!
Offline
how do you refer to the arrow keys?
The sxhkd github readme includes:
The keysym names are given by the output of xev.
And according to the arch wiki page for Extra Keyboard Keys, "...in a graphical environment...with the following command you can start xev and show only the relevant parts:"
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
The result of which on my system, the arrow keys have the keysyms of:
113 Left
111 Up
116 Down
114 Right
And an example keybinding in my sxhkdrc is:
super + {Left,Right}
bspc desktop --focus {prev,next}
Offline
For thinkpad users, we have a key whereby you press "fn+home" and it increases brightness. That combination in xev is called "XFMonBrightnessUp".
I would like that hotkey to not only brighten up my screen, but also to run "notify-send 'brightness' '75%'" so that I will get a notification indicating the level it is at for dunst.
At the moment, I have placed this in my sxhkd:
XFMonBrightnessUp
notify-send "brighter"
as a test, and I haven't had any luck. Any ideas?
Edit: SOLVED.
I am an idiot, it is actually called "XF86MonBrightnessUp"
Last edited by 3xOSC (2014-01-05 21:00:30)
Offline
A small improvement could be made to the man page, clarifying that the '~' character replays the captured event/s -after- the command is executed.
(in the case of non-final elements in a key chain, earlier keys are replayed immediately since no command is bound directly to them.. I presume)
Also..
I take it that two-part brace expansion only works properly when the first expansion is part of the initial element of the keychain.
The reason I say this:
super + F6; {h,i,j} {x,y,z}
echo {hello,I\'m,John} {xylophone,yeti,zebra}
.. the first brace-expansion is always expanded to 'hello', even though the binding appears to work as intended (super+F6 followed by h|i|j then x|y|z).
In case further clarification is needed, I'm saying that only three possible strings can be echoed with the above config, and they are 'hello xylophone' 'hello yeti' 'hello zebra'.
Whether the first pressed key was h,i, or j has no effect.
Fact that may be related: if you use : instead of ;, the {h,i,j} clause is ignored completely.. it's as if you had written
super + F6: {x,y,z}
echo hello {xylophone,yeti,zebra}
Edit: Another bug report:
Synthetic key events that match an sxhkd rule will cause sxhkd to enter an infinite loop:
shift + s
xdotool type S
This is an unrealistic example; my actual use case involves conditionally passing the captured event to the current window (so I can't use ~, it will unconditionally pass on the event)
AFAICS the fix involves ungrabbing the key immediately before executing the command, and regrabbing it after the command returns. That still leaves the possibility of forking commands causing a loop, but nobody can do anything to avoid that, I think, aside from just not doing things that cause race conditions
EDIT2: posted on github.
Last edited by likytau (2014-01-11 05:28:06)
Offline
super + Menu
dmenu_run -i -q -h 24 -y 24 -o 0.83 -fn "Source Sans Pro-10" -nb "#000000" -nf "#aaaaaa" -sb "#3c3c3c" -sf "#ffffff" & \
bspc config top_padding 48
super + Menu ; {Return,Escape}
bspc config top_padding 24
My panel is 24px high, placed at the top of the screen. dmenu is also 24px high, placed directly beneath the panel. I'm trying to change the top padding to open space for dmenu when it is launched, and revert to the original padding when it is closed.
For this to be possible with sxhkd, it would need an option to allow chains that include grabbed chords and an option to allow nonconsecutive presses. The latter because when dmenu is launched, you need to type your command first then press return. I was wondering if you'd consider these features worthwhile to implement.
Also, I'm not sure if this is supposed to happen but when dmenu is launched, sxhkd chords won't work until dmenu is closed.
Offline
super + Menu dmenu_run -i -q -h 24 -y 24 -o 0.83 -fn "Source Sans Pro-10" -nb "#000000" -nf "#aaaaaa" -sb "#3c3c3c" -sf "#ffffff" & \ bspc config top_padding 48 super + Menu ; {Return,Escape} bspc config top_padding 24
My panel is 24px high, placed at the top of the screen. dmenu is also 24px high, placed directly beneath the panel. I'm trying to change the top padding to open space for dmenu when it is launched, and revert to the original padding when it is closed.
For this to be possible with sxhkd, it would need an option to allow chains that include grabbed chords and an option to allow nonconsecutive presses. The latter because when dmenu is launched, you need to type your command first then press return. I was wondering if you'd consider these features worthwhile to implement.
Also, I'm not sure if this is supposed to happen but when dmenu is launched, sxhkd chords won't work until dmenu is closed.
For any program at all to implement that, you'd first have to define how, exactly, they can distinguish between the [chord, secondkey] and [chord] cases, even in theory.
(BTW: dmenu grabs the entire keyboard, exclusively, my WM's bindings don't work in dmenu either.)
Offline
For any program at all to implement that, you'd first have to define how, exactly, they can distinguish between the [chord, secondkey] and [chord] cases, even in theory.
After some testing, I've found that identical functionality is actually already possible. In the chain, you just need to use the key release version of the original chord. Here is an example:
super + KP_Enter
pamixer --toggle-mute
@super + @KP_Enter; Return
pamixer --toggle-mute
However, this isn't an ideal implementation because you cannot use the key release version of the chord alone. I guess that doesn't matter much, though. I can't think of when it'd be useful, but I'm sure someone would want the option at some point.
(BTW: dmenu grabs the entire keyboard, exclusively, my WM's bindings don't work in dmenu either.)
Ah, okay.
Offline
Well, you surprised me. Because I was thinking of key events being singular, rather than split up into keydown and keyup, I was thinking that it's completely impossible to implement what you requested. Clearly that's not the case. But now that I think about it again, you could kind of kludge it to work in the way you originally requested by having the simpler keybinding have an implicit timeout period at the end.
That is, the simpler version could fire after [the user presses the shortcut, and the timeout runs out], the chain version could fire normally (pressing the consecutive keys before the timeout occurs). Seems irritating, I don't know of any better way yet though.
Offline
super + Menu dmenu_run -i -q -h 24 -y 24 -o 0.83 -fn "Source Sans Pro-10" -nb "#000000" -nf "#aaaaaa" -sb "#3c3c3c" -sf "#ffffff" & \ bspc config top_padding 48 super + Menu ; {Return,Escape} bspc config top_padding 24
My panel is 24px high, placed at the top of the screen. dmenu is also 24px high, placed directly beneath the panel. I'm trying to change the top padding to open space for dmenu when it is launched, and revert to the original padding when it is closed.
The proper way to do this is:
super + Menu
bspc config -d focused top_padding 24; \
$(dmenu_path | dmenu -i -q -h 24 -y 24 -o 0.83 -fn "Source Sans Pro-10" -nb "#000000" -nf "#aaaaaa" -sb "#3c3c3c" -sf "#ffffff"); \
bspc config -d focused top_padding 0
Remarks:
dmenu_run forks, that's why I replaced it by an explicit, non-forking call.
I changed the padding of the local desktop, to avoid altering the padding of another monitor.
You should use an environment variable for the panel height, instead of writing 24 everywhere.
Offline
Thank you.
Offline
I'll preface this by saying that, as a former xbindkeys user, sxhkd is truly a breath of fresh air. I honestly can't think of another program I have been more happy to stumble across. I especially love that it supports chaining and modes. I do a lot of remapping and have been experimenting with this to see what I can do and have had some interesting things happen.
I have grave set up as a prefix key and since setting up any mapping with "grave : something" will basically cause any "grave ; somethingelse" to also trigger a mode, I was trying to see if I could use both a prefix key and a mode when I double tap grave by doing the following:
grave ; grave : q
anything (I tested with 'xdotool key Escape' and 'urxvt')
This actually produces a sort of hybrid between a prefix key and a mode. When I have this set up and I press grave twice it results in an around 5 second time period where it will act as a mode and multiple commands can be entered as if grave had been pressed (i.e I have grave ; # set to go to # desktop.. If I press grave twice I can then hit 1 2 3 4 etc. and use any commands for a few seconds before it will stop).
Is this an intended effect? If not, it might make a great feature, for example if you wanted to do a few things without having to hit a prefix key every time but it wasn't going to take long enough that you wanted to have to escape it. I don't know just how useful it would be if you could specify seconds or if you could even do much else with it, but I think it's a pretty interesting result regardless.
Last edited by angelic_sedition (2014-01-20 09:27:07)
Offline
This actually produces a sort of hybrid between a prefix key and a mode.
There was a bug, the following:
a ; b : c
echo abc
was not working as expected.
It is fixed by 520b1f1.
Is this an intended effect?
No and I can't reproduce it.
If I understand you correctly, the following:
a ; c
echo ac
a ; a : b
echo aab
yields ac when you press aac?
Offline
Yes, that's correct. Not only that but if you also have the following,
a ; d
echo ad
aacdcdd.. will yeld acdcdd.. for a period of about five seconds.
I looked back through my sxhkdrc and commented out all grave mappings but the following and was still able to reproduce this effect.
grave ; grave : u
bspc control --toggle-visibility
grave ; m
urxvt
I tested it with different letters and commands, and the effect was still the same. Commenting out the first part made it stop working (meaning that I am successfully reloading my sxhkdrc). With these mappings, if I hit grave grave m m m, the result will be to spawn 3 urxvt terminals. Any other keypresses that aren't mapped during this five second time period have no effect.
Anyway, I don't know why this bug is only happening to me. Also, I installed sxhkd-git from the aur and the number is 114-1.
The updated version has no problems with this (though chaining only works to a certain depth; i.e. "a ; b : d ; c" will result in something mapped to "a ; b : c."
Last edited by angelic_sedition (2014-02-08 16:53:54)
Offline
Hello, I made a script for bspwm: http://hastebin.com/onepomojim.bash
When I execute the script from my terminal it works perfectly fine, however, if I execute the script with sxhkd it doesn't work, does anyone know why?
The script is binded with:
super + button1
selecto
(selecto is the name of the script, I placed it in my /usr/bin directory)
Offline
Hello, I made a script for bspwm: http://hastebin.com/onepomojim.bash
When I execute the script from my terminal it works perfectly fine, however, if I execute the script with sxhkd it doesn't work, does anyone know why?The script is binded with:
super + button1
selecto(selecto is the name of the script, I placed it in my /usr/bin directory)
Is the space in the hashband meant to be there?
Anyway try:
super + button1
/bin/zsh /usr/bin/selecto
Offline