How do I setup fn+f3 keys to work as airplane mode on/off?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
IBM wrote a set of hardware-specific utilities that allowed using the Fn keys of my old Thinkpad. Search for support for your specific machine: I suspect it's not a general thing.
By 'airplane mode' do you mean turning the wireless on & off? I do that with a short script that loads or unloads the drivers.
I would like to make it like this: "Airplane mode" "on" = wireless "off", bluetooth "off". When turning "airplane mode" "off" = wireless "on", bluetooth "off".
Isn't there a way to create button combination Fn+f3 with these functions? And maybe without being in root? If yes, how?
ps.
I dont get support for linux from the company I bought laptop, even though it looks like the slimbook, but with different specs, maybe same OEM.
Last edited by Chripcikas; 12-16-2017 at 02:28 PM.
Use the search term "linux mint custom keyboard shortcuts" and choose a guide.
For wireless I would look at the 'rfkill' command, although if you use NetworkManager, then you can simply right click on the nm-applet icon to turn wifi on and off.
1. a script (*) that toggles airplane mode on/off, and is executable.
2. assign execution of that script top a hotkey of your choice. on my system, that's baked right into the windowmanager, but many desktop environments have a separate utility for that.
(*) i'd make that a shell script - e.g. bash - but it could be anything really.
airplane mode on = rfkill block all & nmcli radio all off
airplane mode off = nmcli radio all on
How do I make it as a script that you have mentioned?
I've tried to set up custom keyboard shortcut on KDE but it doesn't allow me to set the particular FN+F3 combination.
ps.
You see I have this FN+F3 key with "airplane logo" and the airplane mode that Mint KDE has in nm-applet just turns wifi on/off and leaves bluetooth on.
How do I make it as a script that you have mentioned?
By creating a file with the commands you want to execute.
Code:
#!/bin/sh
# Script to toggle wlan and bluetooth soft blocked status
rfkill list wlan | grep -q "Soft blocked: no" && rfkill block wlan || rfkill unblock wlan
rfkill list bluetooth | grep -q "Soft blocked: no" && rfkill block bluetooth || rfkill unblock bluetooth
rfkill needs to be turned on in the kernel. check gentoo wiki for example
certain notebooks need certain options turned on in the kernel => the reason why I recommend building the kernel yourself.
You should use xev to debug your keyboard. Does these special "ACPI key EVENTS KEYs" generate any events in xev?
And than there is the question on how you add that functionality in your desctop environment. e.g. i3wm uses /home/ USERNAME /.i3/config for example. There i have set my custom ACPI keys
Here when I hit the rfkill key and than check with dmesg. i replaced mac with snip
Quote:
[ 9453.971033] wlan0: deauthenticating from snip by local choice (Reason: 3=DEAUTH_LEAVING)
[ 9461.791100] wlan0: authenticate with snip
[ 9461.812811] wlan0: send auth to snip (try 1/3)
[ 9461.815146] wlan0: authenticated
[ 9461.815710] wlan0: associate with snip (try 1/3)
[ 9461.819659] wlan0: RX AssocResp from snip (capab=0x1411 status=0 aid=2)
[ 9461.819805] wlan0: associated
ASUS-G75VW /home/roman # dmesg
My fn key is not being recognized when I try to set up fn+f3, but it allows shift+f3 or ctrl+f3 (these two hotkeys are already taken/in use). Do you know why?
no, i don't.
but YOU can do some troubleshooting:
open a terminal, and enter 'xev'.
now, test the keys in question and see what happens.
maybe your Fn key doesn't work at all?
...
somewhere in the xev output are the keycodes required to assign hotkeys.
no, i don't.
but YOU can do some troubleshooting:
open a terminal, and enter 'xev'.
now, test the keys in question and see what happens.
maybe your Fn key doesn't work at all?
...
somewhere in the xev output are the keycodes required to assign hotkeys.
I did test with "xev" and "fn" key on it's own doesn't register, fn+space, which turns on/off blacklight to keyboard, doesn't register also. But volume up fn+f12 and volume down fn+f11 do register briefly and goes away when the buttons are released.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.