Update: My main goal is to change the function (or even turn off) the CAPSLOCK key.
At work, we have a long domain name. I'm lazy. I'd like to map my CAPSLOCK key to type out a string such as "outlongdomain.com". This is only to save me from typing.
I've seen numerous questions about how to remap the key to a different function. While neat; I couldn't see how to tell the system to "print out these next set of letters where the cursor has focus."
Update: I would like to use Autokey but I don't see an option for CAPSLOCK
If you can be satisfied with it just being disabled, here's what you can do.
sudo apt-get install gnome-tweak-tool
.Disabled
.Source: https://mkaz.com/2014/02/08/disable-caps-lock-in-ubuntu/
To remap the Capslock to something like Control, Esc, I'd recommend using the
gnome-tweak-tool
.Open the
Tweak Tool
application or press Alt-F2 and rungnome-tweak-tool
.Select the "Typing" tab, and change the dropdown for
Caps Lock key Behaviour
.Here's how it looks on my system:
Now for making a key combination to type "outlongdomain.com":
I have scoured the internet for an answer to this question, but I haven't found anything straightforward, so here's my workaround idea using the
xclip
package:Open
Settings > Keyboard > Shortcuts > Custom Shortcuts
and add a shortcut. Name it whatever you want, and use this command:But replacing "hello" with your long domain name that you want to type. Now just click the
Disabled
text on the shortcut and set it to whatever you set your Capslock key to.Now when you use the new keyboard shortcut, that long domain name will instantly be copied to your clipboard, ready to use with Ctrl-V
Solution #1:
Create a new shortcut in System Settings -> keyboard -> shortcuts tab -> custom shortcuts, click + in the lower left, and name it whatever you like. For command type `firefox yoururl.com.
Next , assign the buttons by clicking on the right side once, and pressing the buttons you want
Solution #2
Make sure you enable "Run executable files" in file manager preferences, create a text file on your Desktop with the following contents
Now, in terminal (CtrlAltT), make that file executable by running
sudo chmod +x Desktop/yourfilename
.Now you can double click on that file as if it were a shortcut.
Solution #3
With AltHOME buttons you can access homepage in firefox so you can also set your long URL as bookmark or home-page in firefox or whatever browser you use.
Check keycode of Caps key:
Run:
Press/Release Caps key.
To disable
Caps_Lock
Create
~/.xmodmap
file containsAdd this line to
~/.xinitrc
to be run on startupIf you want test run
xmodmap .xmodmap
in the terminal.Assign long string to its key
xbindkeys
&xautomation
Create
~/.xbindkeysrc
file containsAdd this line to
~/.xinitrc
to be run on startupAs above, to test run it in terminal.
References:
Why so complicated?
Just use an ALIAS for this. And for everything else that get's on your nerves, too.
It's easy to do, auto-loaded with the bash and you can even choose your own name for it. It so much fun and so easy to make.
You just need a file, and your command
Go into your home folder and create the file put an ALIAS into it. As an example
then to directly use it, do
I called the ALIAS hp. So you just type hp into a terminal and your command will be executed.
This works with any command or script.
To autoload the aliases when you open a terminal, make sure that the following section in your .bashrc file is not commented out.
but AFAIR correctly it's on by default.
To add more just