I know the easy way using the unity but is there a way to make a shortcut for chrome for example using the terminal.
1 Answers
One way of doing it is to use xbindkeys:
Install
xbindkeyssudo apt-get install xbindkeysCreate the default settings file:
xbindkeys --defaults > ~/.xbindkeysrcAdd the relevant lines to
~/.xbindkeysrc:printf '"google-chrome"\nControl+Shift+Mod2 + c\n' >> .xbindkeysrcThe keycodes above make Crtl Shift C launch
google-chrome.You might need to get the right keycodes for your keys. Run
xbindkeys -kand press your desired shortcut. That will print the relevant key sequence.Run
xbindkeys. To make this permanent, add a line containingxbindkeysto your~/.Xsession:echo xbindkeys >> ~/.Xsession
Now, once you have all that set up, and xbindkeys is running automatically every time you log in (because of step 4 above), you will be able to add new shortcut keys with this command:
printf '"ApplicationName"\n+Shortcut+Key\n' >> ~/.xbindkeysrc &&
killall xbindkeys ; xbindkyes
For example, this will make Ctrl+Shift+X launch xclock:
printf '"xclock"\nControl+Shift+Mod2 + x\n' >> ~/.xbindkeysrc &&
killall xbindkeys ; xbindkyes
You could then create a little script that does it for you. Save the following lines as ~/bin/keyb.sh:
#!/bin/bash
printf '"$1"\n$2\n' >> ~/.xbindkeysrc &&
killall xbindkeys ; xbindkyes
Make the script executable with chmod a+x ~/bin/keyb.sh. You can now add a new shortcut with
keyb.sh firefox 'Control+Shift+Mod2 + x'
- 104,119