Keymapping in puppy Linux using bind function

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
balasahu
Posts: 1
Joined: Mon Apr 26, 2021 8:01 am
Contact:

Keymapping in puppy Linux using bind function

Post 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.

Code: Select all

`bind '"\eOQ":"pwd\n"'`

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?

User avatar
foxpup
Posts: 186
Joined: Fri Jul 24, 2020 1:23 pm
Location: Europe near the Northsea
Has thanked: 75 times
Been thanked: 32 times

Re: Keymapping in puppy Linux using bind function

Post 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. :-)

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Keymapping in puppy Linux using bind function

Post 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.

Post Reply

Return to “Beginners Help”