You could try this: Open your gnome-shell, type keyboard layout and open it up. There should be three tabs in this window. Click the one on the right that says "Layouts." Click the "Options" button in the bottom-right corner of the window. You should see a list with the entries preceded by arrows. The third one down says "Alt/Win key behavior." Click this and it will drop down a list of options. The second-to-last option is "Meta is mapped to left Win key." Choose this one, close out the layouts menu, and it should be disabled.
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
An slightly edited version of this script allows multiple selection of applications at once:
The script
To use
list_apps.py
Test- run it by the command (open a terminal window, type the command and press Return):
If all works fine, add it to a shortcut key: choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:
to a shortcut key combination you like.
Explanation
The script lists all
.desktop
files in/usr/share/applications
, and checks if the lineNoDisplay=true
is in the file (which means it is not meant to be used as a GUI). Then it looks into the files, looks up the application name and the command to run it.The difference with the linked answer is mainly the fact that the zenity window is set to allow multiple selections.