Here’s a small tip that I thought should be documented.
If your fn key is behaving opposite to the way you want it to, there are likely 2 causes:
- Either your bios setting is the opposite of what you want
- Or your linux is interpreting differently.
Here are a few solutions :
- Try pressing fn + NumLock key
- Try pressing fn + ~ key (it’s the one before a 1 on most US keyboards)
- Press fn + Esc Key (Or look for a key with a lock sign on it)
- Go to the bios and look for the function key option to change it.
2 worked for me on linux!
To create a keyboard shortcut for putting your laptop to sleep/suspend mode with lockscreen on return: Copy the below script into a file
gnome-screensaver-command --lock && dbus-send --system --print-reply \
Before naming the file, check if a command of that name doesn’t already exist. you can do this by the which command
Name the file to the command you wanna use. I use compsleep.
With the terminal, reach the file, and convert it into an executable:
chmod +x compsleep
now copy this file into the bin folder, as done at the end of this post.
Check the command in the terminal by writing the filename and pressing enter. If this works, proceed to next step.
system settings >> (Keyboard Shortcuts)/(Keyboard>>shortcuts)>>+ or add new shortcut.
Enter name of file we created above in the command text box. Set a shortcut for it.
[Update:] custom shortcuts with Alt don’t work from 12.04 onward. It’s a bug.
[Update:2 (August 2016)] The above mentioned command doesn’t work on the newer systems. A simple replacement to that is this: