On my Windows machine I press Winkey + C and a calculator pops up. I find this very useful – is there any way to achieve this in Ubuntu?
Ubuntu – Assign keyboard shortcut to program
shortcut-keys
Related Solutions
While there isn't really a shortcut to what you asked, there are workarounds, the easiest being hitting F6 twice. The first time will take you to the URL-bar, the second will go back to the page (works in Firefox 3.6.16, didn't try Firefox 4 yet).
I know this it not really satisfying but you'll get used to it fast.
See http://support.mozilla.com/en-US/kb/Keyboard%20shortcuts#w_current-page.
Another thing mentioned on http://support.mozilla.com/en-US/kb/Accessibility#w_html-access-keys and the "proper" way is
HTML Access Keys On some web pages, keyboard shortcuts are assigned to different elements on the page. To move the cursor directly to one of these elements, press Shift+Alt+AccessKey. Which key AccessKey is depends on the website. It is determined by the website author, not Firefox.
It's declared like this <input type="text" size="40" value="Feld" accesskey="f">
so if you have this problem on a particular site just grep for accesskey in "Site Information" (STRG + I on german keyboard layout).
The command to get a fixed string into the clipboard is very easy, it's simply
xsel -ib <<< 'Your string goes here'
or if you want to read the string from a file
xsel -ib < your-file.txt
or from a command output
your-command | xsel -ib
Directly writing a fixed string by emulating keypresses is not much more complex though
xvkbd -file - <<< 'Your string goes here'
or if you want to read the string from a file
xvkbd -file your-file.txt
or from a command output
your-command | xvkbd -file -
You can simply create a custom shortcut in the System Settings → Keyboard → Shortcuts configuration and assign a command to the key combination you wish.
But take care that the shortcut interpreter is not Bash or a similar shell, so our <<<
("here string" syntax) or |
pipes will not work. To solve this anyway, we simply enclose our shell command with bash -c "INSERT COMMAND HERE"
. Just pay attention that you don't use double quotes inside the command then.
Here are the commands how you would have to enter them into the shortcut settings:
Copy "my string" to clipboard:
bash -c "xsel -ib <<< 'my string'"
Copy content of
my-file.txt
to clipboard:bash -c "xsel -ib < my-file.txt"
Copy output of
my-command
to clipboard:bash -c "my-command | xsel -ib"
Directly paste/write "my string":
bash -c "xvkbd -file - <<< 'my string'"
Directly paste/write content of
my-file.txt
:bash -c "xvkbd -file my-file.txt"
Directly paste/write output of
my-command
:bash -c "my-command | xvkbd -file -"
Please note that neither xsel
nor xvkbd
are installed by default, so you probably need to install them first using this command:
sudo apt-get install xsel xvkbd
Best Answer
Assuming you're using 11.10:
You can set a key for the calculator there by clicking the shortcut key in the row listing the shortcuts, and then pressing the desired shortcut keys on your keyboard. You can also set keys for any non-standard apps you like in the 'Custom Shortcuts' category. The only problem is finding a key that hasn't been used for something else.