You are not logged in.
Hi,
I've found tons of tutorials on how to bind keys to keysyms/commands in all the different window managers (and using it as well in XFCE), but I want to bind certain keys to certain commands in the console. And I can't seem to find any info on how to do that... I want to setup some shortcut keys for when I'm working in a real console (Ctrl-ALt-F1...). Xmodmaps do not work anymore once you enter such a console.
Does anyone have some info on how I can accomplish this?
Offline
Not sure this is the answer, but you could use .inputrc.
For example you can set it up to use combination of keys to be read in certain ways. In mine I have:
"SV" = "sudo vim "
so that whenever I type SV, "sudo vim" comes up. Now I don't know how flexible this is, but it might be a starting point...
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
That is helpful yes... But how would you go about assigning for example a media button? Just ike you would assign the play button to XF86AudioPlay in Xmodmap, but instead I want to assign a fixed command to it. I know the kernel keycodes of the buttons using 'showkey'...
Offline
I am wondering the same.
it would be nice to have my volume keys work without starting X.
Offline
Offline
actkbd looks interesting, but it won't react at all to my input.
$ sudo actkbd --showexec --showkey -l -c /etc/actkbd.conf -v9 -D
Event interface present (handler 2)
Detected a usable keyboard device (event3)
Using configuration file /etc/actkbd.conf
Config: 232 -:- key -:- -:- mpc play
then whatever I press, nothing happens.
Offline
actkbd looks interesting, but it won't react at all to my input.
$ sudo actkbd --showexec --showkey -l -c /etc/actkbd.conf -v9 -D Event interface present (handler 2) Detected a usable keyboard device (event3) Using configuration file /etc/actkbd.conf Config: 232 -:- key -:- -:- mpc play
then whatever I press, nothing happens.
It probably did not detect your keyboard properly then. Look at your `dmesg' output and figure out the input device assigned to your keyboard. Then go to the appropriate sysfs path to see which event interface it has. If it is for example event4, you can try
actkbd -d /dev/input/event4
Offline
Awesome, this worked like a charm! Thanks!
Offline
O.K. I got actkbd to use the right device.
However, not matter what I try, I can't get it to do what I want without either 1. passing the keypress on (e.g. setting a command to alt+a will also type 'a' when I press alt+a) or 2. grabbing the keyboard for an undetermined amount of time.
I'm not very good at this.
Offline
screen is the key.
i use screen shortcuts for all console apps i use, like mutt, htop, wyrd, different logs, slurm, root login. when you get use to screen, it's really handy. though it doesn't handle multimedia keys.
e.g., add smth like : "bind x screen -t 'mutt' 2 mutt" to your .screenrc, then hitting "C-a x" opens mutt in a new screen tab.
vlad
Offline
here is my current config, maybe that can help you?
it doesn't work to keep the buttons pressed, I haven't
had a look into that yet, but it should be fairly simple.
# actkbd configuration file
113:key:exec:amixer -q set Master toggle
114:key:exec:amixer -q set Master 2- unmute
115:key:exec:amixer -q set Master 2+ unmute
Offline