Creating a very useful (for me) keyboard shortcut on Linux LXDE/Openbox
Just open this file
~/.config/openbox/lxde-rc.xml
Find a suitable section to introduce this
<!-- open new window and search whatever is on clipboar/selection -->
<keybind key="C-numbersign">
<action name="Execute">
<command>/bin/bash -c '/opt/waterfox/waterfox --new-window "https://www.google.com/search?q=`xclip -o -selection primary`"'</command>
</action>
</keybind>
I tried
#waterfox --search blah blah ...
but it wasn't working (opening window but not searching) that's why I added the search term to the url.
I normally have the right hand over the arrow keys, so I like to have shortcuts on that area.
This one is Ctrl+# (being # the key on the left of Enter)
After saving the file run
# openbox-lxde --reconfigure
And you are done!
I really love it. Whether something is just selected OR copied to clipboard, it will search for it on a new browser window.
--------------------
I have another to quickly close the main window.
<!-- AltGr+Up to close the window (like Alt+F4) -->
<keybind key="mod5-Up">
<action name="Close"/>
</keybind>
1 Comments:
With this other shortcut, you can select anything (text or URL) and get it open in a new TAB just pressing Ctrl+' (I chose that because is beside Ctrl+# which I use to open whatever is on clipboard on a new window).
/bin/bash -c '/opt/waterfox/waterfox -new-tab "https://www.google.com/search?q=`xclip -o -selection primary`"'
To know the 'name' of a specific key or combination, run
# xev | sed -ne '/^KeyPress/,/^$/p'
and press the desired keys
This last info comes from https://askubuntu.com/questions/466646/how-to-get-the-name-of-the-key-combination-keybind-key-for-the-openbox-confi
Post a Comment
<< Home