[SOLVED] Is it possible to get exact command when triggering shortcut?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
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?
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?
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.
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?
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.
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?
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/
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.
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) 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.
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.
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/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.