Page 1 of 1
Keymapping in puppy Linux using bind function
Posted: Mon Apr 26, 2021 8:35 am
by balasahu
I am using puppy linux and I want to map function keys F2 and F3 according to our setup.
When I press F3 my setup file should be run. I tried bind function to bind keys. It is working properly.
But I want to make this changes permanently I used to put this in .xinitrc file to take effect but it is not working. How to make this effect permanent?
Re: Keymapping in puppy Linux using bind function
Posted: Mon Apr 26, 2021 10:48 am
by foxpup
Welcome to the kennels @balasahu !
I think you have to set it in /etc/inputrc
By the way, F3 is "\e[13~" on my laptop.
---
If you want to set general keys (not for bash specifically), you should look at ~/.jwm/jwmrc-personal
That is the config for the window manager jwm.
I like the little C program sxhkd myself.
It allows for setting your shortcut keys independently of the window manager.
In these cases your shortcut key will have to open a terminal to execute the command pwd,
which seems to me a little silly thing to do.
Re: Keymapping in puppy Linux using bind function
Posted: Tue Apr 27, 2021 6:52 pm
by williams2
/etc/inputrc is readline's configuration file.
For example, you could put a line like this in inputrc:
"\e[13~": "pwd\n"
Open a new terminal window for the change to take effect.
Then when you press F3 it does this:
# pwd
/root
#
You can see what F3 is by typing cat -v <enter key>
then pressing the F3 key.
Press ctrl+C to stop cat.
Change ^[
at the beginning of the line to \e
If the bind command works properly if you type it in a text terminal window, it should work properly as a line in .xinitrc
It needs to be before (above) the line near the bottom: which $CURRENTWM && exec $CURRENTWM
It should also work from a script in /root/Startup (needs to be executable.)
Maybe with a sleep 10
command near the top of the script.