Closed netvl closed 11 years ago
Wingo's Shell
command is not very good. Actually, it's incredibly stupid. From config/key.wini
:
# Set up some common key bindings. "Shell" is Wingo's command for executing
# shell commands. In practice, I strongly recommend using `xbindkeys` to
# configure shortcuts for running programs. It's more mature and will work
# with *any* window manager.
...
# You could also use Wingo's Shell command to execute commands, but it
# isn't recommended since the shell lexer is extremely stupid.
Unless there is an easy way that I'm missing to improve the circumstances, it is unlikely that I (personally) will pursue a full shell lexer.
In short, use xbindkeys
to bind shell programs and some other launcher (like gmrun
) to run programs on-the-fly. Actually, xbindkeys
should be used on its own merits, since it decouples your application shortcuts from whatever WM you happen to be using.
Well, isn't it possible to add a command which passes its argument as-is to the shell? Like this: RunInShell "some long command"
is equivalent to bash -c "some long command"
. This should work fine if I'm not mistaken.
That's worth trying. I thought I had already tried that, but perhaps I didn't. I'll report back once I've added it.
However, even if that works, I still strongly recommend xbindkeys
. It will save you time in the future if you switch WMs again.
It happened that I have very little amount of keybindings which start programs (only browser, terminal and file manager, I guess), so it is not painful to repeat them in config file. My question is mostly related to starting programs on WM startup. It just feels wrong to me to use separate script for this.
My question is mostly related to starting programs on WM startup
This is my ~/.xinitrc
file:
#!/bin/sh
( xrdb $HOME/.Xresources
xsetroot -cursor_name left_ptr
setxkbmap -option terminate:ctrl_alt_bksp
xset r rate 300
xset b 0
xmodmap $HOME/.xmodmaprc
xbindkeys -f $HOME/.xbindkeysrc
numlockx on
dpms-settings
xset m 1 1
autobright
) &
nitrogen --restore
(
sleep 1
video laptop
kmix --keepvisibility &
wicd-client --tray &
gkrellm &
) &
exec dbus-launch run-wingo
I start tons of junk before Wingo ever starts. This is the preferred way (at the moment) to start apps when starting Wingo. Wingo does have the startup
hook, though. Which is useful if you need something to run right after Wingo has initialized.
Regardless, I will see what happens when I try bash -c ...
. If it works, then you can have your way :-)
I understand) but I'm not using xinitrc on my laptop, so it is not an option) currently I'm using separate script located near wingo configs. In any case, thanks again)
Okay, I've made the change. You were right, bash -c "..."
works much better. :-)
For instance, you could add this to your key bindings:
Control-r := Shell "xmessage \"$(ls -l ~)\""
And it should work.
Wow, great! Thank you very much!
As far as I understood from comments in config files and actual behavior of wingo,
Shell
command does not really starts system shell (e.g. bash) and supplies command to it; instead it uses native Go functions to start programs. This is somewhat inconvenient, for example, it does not understand~
in arguments and supplies the tilde as is to the program. It also didn't work for me when I tried to launch a command with argument containing spaces with them, surrounding these arguments with single quotes didn't work. Slightly related question: I didn't find any notice of escapes in strings. Is it possible at all to supply a string containing double quote to some command?