LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-16-2017, 10:53 AM   #1
Chripcikas
Member
 
Registered: Jun 2017
Distribution: Kubuntu 20.04
Posts: 88

Rep: Reputation: Disabled
Question How do I setup fn+f3 keys to work as airplane mode on/off?


I'm using linux mint 18.3 KDE.
 
Old 12-16-2017, 11:38 AM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,970

Rep: Reputation: 271Reputation: 271Reputation: 271
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.
 
Old 12-16-2017, 01:53 PM   #3
Chripcikas
Member
 
Registered: Jun 2017
Distribution: Kubuntu 20.04
Posts: 88

Original Poster
Rep: Reputation: Disabled
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.
 
Old 12-16-2017, 06:13 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,374

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
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.
 
Old 12-17-2017, 03:56 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
to explain:

your task consists of 2 parts:

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.
 
Old 12-17-2017, 05:05 AM   #6
Chripcikas
Member
 
Registered: Jun 2017
Distribution: Kubuntu 20.04
Posts: 88

Original Poster
Rep: Reputation: Disabled
I figured out this far:

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.
 
Old 12-17-2017, 08:38 AM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,374

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Quote:
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
Associate that script with your Fn-F3 key combination. https://docs.kde.org/trunk5/en/kde-w...eys/index.html
 
Old 12-18-2017, 07:19 AM   #8
Chripcikas
Member
 
Registered: Jun 2017
Distribution: Kubuntu 20.04
Posts: 88

Original Poster
Rep: Reputation: Disabled
Where should I save this text editor file with commands? What is advised?

Last edited by Chripcikas; 12-18-2017 at 07:37 AM.
 
Old 12-19-2017, 08:45 AM   #9
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 29
Guys who posted before me are quite right

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

Last edited by _roman_; 12-19-2017 at 08:51 AM.
 
Old 12-19-2017, 08:47 AM   #10
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 29
Quote:
Originally Posted by Chripcikas View Post
Where should I save this text editor file with commands? What is advised?
That depends on your desktop environment and distro.

Usually add it to the desktop environment configuration file. This has to be done for every user in question.
 
Old 01-20-2018, 08:49 PM   #11
Chripcikas
Member
 
Registered: Jun 2017
Distribution: Kubuntu 20.04
Posts: 88

Original Poster
Rep: Reputation: Disabled
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?
 
Old 01-21-2018, 01:51 AM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Chripcikas View Post
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.
 
Old 01-21-2018, 12:16 PM   #13
Chripcikas
Member
 
Registered: Jun 2017
Distribution: Kubuntu 20.04
Posts: 88

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
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.
 
Old 01-22-2018, 12:14 PM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
so why didn't you test fn+f3?
 
Old 01-24-2018, 10:41 PM   #15
Chripcikas
Member
 
Registered: Jun 2017
Distribution: Kubuntu 20.04
Posts: 88

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
so why didn't you test fn+f3?
My bad, I forgot to mention also that the fn+f3 combo does not register in "xev".
 
  


Reply

Tags
setup



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't turn airplane mode off jswervedizzle Linux - Newbie 6 12-13-2016 05:04 PM
LXer: GNOME 3.20 to Finally Integrate Airplane Mode LXer Syndicated Linux News 0 01-10-2016 03:42 PM
Can't get rid of "airplane mode" in Ubuntu 11.10 juanctes Linux - Networking 2 11-07-2011 06:56 AM
In terminal mode, why the arrows and delete keys doesn't work alejandroye Mandriva 5 05-05-2009 01:09 AM
arrow keys in vi insert mode sanjeev.naik Linux - Software 6 09-04-2004 12:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration