LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-15-2021, 10:59 AM   #1
alexander_linux_user
LQ Newbie
 
Registered: Apr 2021
Posts: 23
Blog Entries: 1

Rep: Reputation: Disabled
Is it possible to get exact command when triggering shortcut?


For example, I want to know what command invokes when I hit Fn + F12 to increase brightness. Can I get this or any other command when I trigger some shortcut (what's happening behind the scenes) somehow?

Distro: Debian 10 (stable) XFCE
 
Old 07-15-2021, 11:39 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,381

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Not a hope. We haven't got a clue, because you told us nothing except "I want to do this."

Imagine that we don't know your box, distro, version, what the Fn key is or does, (which is the actual case) & Try posting some real information.
 
Old 07-15-2021, 11:46 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
Quote:
Originally Posted by alexander_linux_user View Post
Distro: Debian 10 (stable) XFCE
In XFCE4, try the applications menu -> Settings -> Keyboard -> Application Shortcuts.

If no information is there, then it might be that the keys are being dealt with in the firmware.
 
1 members found this post helpful.
Old 07-15-2021, 02:33 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,005

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
Keystroke codes is all documented as to what the codes do. How your system interacts with that on each system I think would be documented but may be intercepted by local OEM firmware. Generally a laptop would have that shortcut that you mentioned. A keyboard takes keys and makes them into a code. At some point the code goes to a device in the computer. That computer can take the code and move it to the area needed. The OS and a program could also be part of this command string. https://pc.net/resources/shortcuts/windows_xp

I don't get the last part of question. You mean by a script?

https://www.arduino.cc/en/Reference/KeyboardModifiers
 
Old 07-16-2021, 03:17 AM   #5
alexander_linux_user
LQ Newbie
 
Registered: Apr 2021
Posts: 23

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
In XFCE4, try the applications menu -> Settings -> Keyboard -> Application Shortcuts.

If no information is there, then it might be that the keys are being dealt with in the firmware.
There is no information about what command Fn + F12 (XF86XK_MonBrightnessUp) triggers or several other Fn combinations, and that's why I'm here. Perhaps, it will allow me to remap Fn + F12 to something else but that's not what I'm trying to achieve. I have no clue how this combination increases brightness and wasn't able to find the right command to increase brightness from the command line by googling for it. xrandr, for example, can set a certain value but not increase/decrease it by step, and some other suggestions were about some tweaking, in other words, it's not like easily increasing/decreasing volume with amixer or something else. I should point out that I looked into kernel logs as well as other logs but couldn't find any event happening during the time when I pressed on Fn + F12.
 
Old 07-16-2021, 03:23 AM   #6
alexander_linux_user
LQ Newbie
 
Registered: Apr 2021
Posts: 23

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
Keystroke codes is all documented as to what the codes do. How your system interacts with that on each system I think would be documented but may be intercepted by local OEM firmware. Generally a laptop would have that shortcut that you mentioned. A keyboard takes keys and makes them into a code. At some point the code goes to a device in the computer. That computer can take the code and move it to the area needed. The OS and a program could also be part of this command string. https://pc.net/resources/shortcuts/windows_xp

I don't get the last part of question. You mean by a script?

https://www.arduino.cc/en/Reference/KeyboardModifiers
I know what the combination does but I'd like to know how it does it. The combination is XF86XK_MonBrightnessUp, and "keysym" is 0x1008ff02, the question is what is happening when I invoke it, and whether this action can be achieved from the command line. At least, I'd like to find out what is happening, so I could move on.
 
Old 07-16-2021, 03:34 AM   #7
alexander_linux_user
LQ Newbie
 
Registered: Apr 2021
Posts: 23

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
Not a hope. We haven't got a clue, because you told us nothing except "I want to do this."

Imagine that we don't know your box, distro, version, what the Fn key is or does, (which is the actual case) & Try posting some real information.
Quote:
For example, I want to know what command invokes when I hit Fn + F12 to increase brightness. Can I get this or any other command when I trigger some shortcut (what's happening behind the scenes) somehow?

Distro: Debian 10 (stable) XFCE
As you can see, my distro is Debian 10 (stable) on XFCE, Fn + F12 increases brightness (XF86XK_MonBrightnessUp, 0x1008ff02). My laptop is Dell Inspiron 3582, kernel 5.10, if that's what you're missing. The question is about what kind of process invokes in the background to increase brightness when I hit this combination (or any other combination). In other words, is there some log that contains information like that or some tool that can help retrieve this information?
 
Old 07-16-2021, 04:49 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,962

Rep: Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332
this action (monitor brightness up/down) can be activated from command line too, but actually I don't know how is it implemented in xfce. Probably it is built into a binary (executable) somewhere.
http://ddccontrol.sourceforge.net/
 
1 members found this post helpful.
Old 07-16-2021, 04:58 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,142

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
OP, have a read of this and see if you still think there is a simple CLI command for it. And no, I doubt every command invocation is logged.

Personally I have always used the sysfs route when I found it necessary. Worked most of the time.

Last edited by syg00; 07-16-2021 at 04:59 AM. Reason: OP, not pan64
 
1 members found this post helpful.
Old 07-16-2021, 04:59 AM   #10
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
Quote:
Originally Posted by alexander_linux_user View Post
whether this action can be achieved from the command line.
1) You probably can simulate keyboard press via xdotool.
Code:
xdotool key XF86XK_MonBrightnessUp
2) You may try xbacklight, and if that doesn't work then xrandr --brightness. Note however, that the latter doesn't actually change brightness: instead, it simulates the brightness change via gamma values.

Last edited by shruggy; 07-16-2021 at 05:06 AM.
 
Old 07-16-2021, 06:31 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,381

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Quote:
Originally Posted by alexander_linux_user
In other words, is there some log that contains information like that or some tool that can help retrieve this information?
Your computer manual might, if it's not one of those 'how to shine' manuals. Otherwise no, you're on your own against your particular bios version. The Dell guys glaze over when they hear 'Inspiron,' because all their serious customers buy Latitudes.
 
1 members found this post helpful.
Old 07-16-2021, 07:27 AM   #12
alexander_linux_user
LQ Newbie
 
Registered: Apr 2021
Posts: 23

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
1) You probably can simulate keyboard press via xdotool.
Code:
xdotool key XF86XK_MonBrightnessUp
2) You may try xbacklight, and if that doesn't work then xrandr --brightness. Note however, that the latter doesn't actually change brightness: instead, it simulates the brightness change via gamma values.
1) I've tried xdotool, and all it did was exactly like I'd hit this combination by myself, without showing any output on the terminal. I'm moving to Xmonad, and launching this command from the terminal did absolutely nothing because Xmonad doesn't know what to do with it unless you tell it in its config file. If I knew the actual command then I could make it work.

2) xbacklight outputs "No outputs have backlight property" message, and as I was reading about the message, folks suggested writing a script on startup to make it work but I don't want to do it for now. As for xrandr, it doesn't simulates +- behavior, and it also broke my redshift process somehow.

After all, it's not critical. I rarely change my brightness and if I need it then I'll log into XFCE to adjust brightness, and then log into Xmonad and the brightness will be the same.
 
Old 07-16-2021, 07:28 AM   #13
alexander_linux_user
LQ Newbie
 
Registered: Apr 2021
Posts: 23

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
Your computer manual might, if it's not one of those 'how to shine' manuals. Otherwise no, you're on your own against your particular bios version. The Dell guys glaze over when they hear 'Inspiron,' because all their serious customers buy Latitudes.
Thanks for the suggestions
 
Old 07-16-2021, 07:29 AM   #14
alexander_linux_user
LQ Newbie
 
Registered: Apr 2021
Posts: 23

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
OP, have a read of this and see if you still think there is a simple CLI command for it. And no, I doubt every command invocation is logged.

Personally I have always used the sysfs route when I found it necessary. Worked most of the time.
Thank you!
 
Old 07-16-2021, 07:31 AM   #15
alexander_linux_user
LQ Newbie
 
Registered: Apr 2021
Posts: 23

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
this action (monitor brightness up/down) can be activated from command line too, but actually I don't know how is it implemented in xfce. Probably it is built into a binary (executable) somewhere.
http://ddccontrol.sourceforge.net/
Thank you!
 
  


Reply

Tags
background, commands, shortcuts



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
I made a global shortcut to block an unwanted in-application shortcut newbiesforever LinuxQuestions.org Member Success Stories 0 07-22-2018 07:49 PM
[KDE]Shortcut Icons smaller, Shortcut And Tray icons on 2 lines xeross Linux - Newbie 2 04-10-2008 10:20 AM
VNC and Port Triggering Slackware 10 sovietpower Linux - Networking 1 02-08-2005 07:46 AM
triggering bash script if directory modified cbb Linux - Software 1 10-23-2004 07:52 AM
port triggering with iptables? injun Linux - Networking 2 08-29-2004 12:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:54 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