(SOLVED) Fn + F3 and Fn + F4 not reconized

Forum rules
Before you post please read how to get help
Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Sun Oct 12, 2014 6:58 pm

Yep, i do that, but it said there is a syntax error in the line. So i don't know what to do.
Sorry, commands in terminal are rather new for me :-/

User avatar
roblm
Level 11
Level 11
Posts: 3518
Joined: Sun Feb 24, 2013 2:41 pm

Re: Fn + F3 and Fn + F4 not reconized

Post by roblm » Sun Oct 12, 2014 8:20 pm

I'll be continuing this topic by contacting you by e-mail through the Mint Forum, because this will become a hot topic at 24 posts.
I don't want other users to have to read many pages of posts without a resolution. If we find one, then it can be posted here.

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Sun Oct 12, 2014 9:00 pm

Ok, thank you.

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Mon Oct 13, 2014 11:20 am

Problem solved for me.

The Fn + F3 and Fn + F4 are not working, but i have 4 icons on my desktop, each corresponding at one level of backlight keeboard brightness.

Many many thanks to roblm, for the long time you spent to help and your patience.

Here is how to do :

Open the file with this command:
sudo visudo

Using the arrow keys, go to the bottom and add this line :

ALL ALL=(ALL) NOPASSWD: /usr/bin/tee /sys/class/leds/asus\:\:kbd_backlight/brightness

Save the file by pressing Ctrl+X. Type “Y” for yes, then press Enter at the next line. (If you receveive an error message, DO NOT type “Q” or you will get an error message and the sudo command will no longer work. You will need to use the
distribution's installation disk to edit the file).

We are now able to execute the command to change the keyboard brightness without having to enter the sudo password.

Now, create one icon on the desktop like this :

Right Click on the desktop
Create New Document -> Empty Document
Name it something to your taste
Open the file with text editor
Write :

#!/bin/bash
echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness

And save the file.

Right click on the file

Select Properties>Permissions

Check the box following Execute: which allows the file to be executed

Repeat that for each level of brightness of your keyboard. For example, a second icon with the command :
echo 1 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness

For me, echo 0 to echo 3 work.

So, i have now 4 icons on my desktop, each corresponding at one different level of keyboard brightness. When i doubble click on one of them, the keyboard brightness instantly changes into the value of my choice.

That perfectly works wainting a fix to make the Fn keys working.

Thanks again roblm, you've been very helpful.

User avatar
roblm
Level 11
Level 11
Posts: 3518
Joined: Sun Feb 24, 2013 2:41 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by roblm » Mon Oct 13, 2014 11:39 am

Gerapa,

Could you still run this command which I asked about in the e-mail message and post the output:
ls /sys/class/leds/*/*

Here is a suggestion for using easily recognized icons. They can be found in this location:

/usr/share/icons/Mint-X/status/48

gpm-primary-020.png
gpm-primary-040.png
gpm-primary-060.png
gpm-primary-100.png

nm-signal-00.png
nm-signal-50.png
nm-signal-75.png
nm-signal-100.png
Keyboard backlight.png
In the picture below, I removed the red color from the "Off" icon in the top row using GIMP.
Keyboard backlight2.png

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Mon Oct 13, 2014 11:46 am

Hey, nice icons, i try them.

I have sent in private to you the result of ls /sys/class/leds/*/*

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Mon Oct 13, 2014 12:03 pm

I cannot change my icons. They represent a little terminal. If i right click on one of them, then click on properties, i see the name of the file and the image of the icon, but it cannot be changed. The image is not clickable ?!?!

JeremyB
Level 20
Level 20
Posts: 10937
Joined: Fri Feb 21, 2014 8:17 am

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by JeremyB » Mon Oct 13, 2014 12:55 pm

Gerapa

Can you open a terminal window and run

Code: Select all

acpi_listen
and change your keyboard backlighting up and down to see if anything shows in the terminal window? Press CTRL+c to stop acpi_listen

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Mon Oct 13, 2014 1:17 pm

Hello Jeremy,

No, i think that's the problem. Xfce does'nt recognize the keys. Here the result :

serge@serge-G74Sx ~ $ acpi_listen
PNP0C14:00 000000ff 00000000
PNP0C14:00 000000ff 00000000
^C

And in comparison the same with the fuctions keys to change volume (those keys work) :

serge@serge-G74Sx ~ $ acpi_listen
PNP0C14:00 000000ff 00000000
button/volumedown VOLDN 00000080 00000000 K
PNP0C14:00 000000ff 00000000
button/volumeup VOLUP 00000080 00000000 K
^C
serge@serge-G74Sx ~ $

JeremyB
Level 20
Level 20
Posts: 10937
Joined: Fri Feb 21, 2014 8:17 am

Re: Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by JeremyB » Mon Oct 13, 2014 2:14 pm

Gerapa wrote:Hello Jeremy,

No, i think that's the problem. Xfce does'nt recognize the keys. Here the result :

serge@serge-G74Sx ~ $ acpi_listen
PNP0C14:00 000000ff 00000000
PNP0C14:00 000000ff 00000000
^C

And in comparison the same with the fuctions keys to change volume (those keys work) :

serge@serge-G74Sx ~ $ acpi_listen
PNP0C14:00 000000ff 00000000
button/volumedown VOLDN 00000080 00000000 K
PNP0C14:00 000000ff 00000000
button/volumeup VOLUP 00000080 00000000 K
^C
serge@serge-G74Sx ~ $
Actually I wanted you to use your new shortcuts that you made but I see your other post you were using xev to get that info. I will check into a few things as I am not using Xfce

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Mon Oct 13, 2014 2:23 pm

Ok thanks.
Anyway, don't spend too much time. Icons on my desktop are good enough for me.
Maybe it will be fixed in a next version of Xfce.

JeremyB
Level 20
Level 20
Posts: 10937
Joined: Fri Feb 21, 2014 8:17 am

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by JeremyB » Mon Oct 13, 2014 6:18 pm

I do have a couple commands for you to try, as there was a file I saw a while back that got my attention, unfortunately with acpi_listen not seeing your hotkeys the acpi trigger will not work but there may be options

Code: Select all

sudo chmod +x /etc/acpi/asus-keyboard-backlight.sh

Code: Select all

/etc/acpi/asus-keyboard-backlight.sh up

Code: Select all

/etc/acpi/asus-keyboard-backlight.sh down
The first command will make sure the code that is there is able to be run(executable) and the second should increase keyboard backlighting and the third should decrease backlighting and it would be interesting to see if you could tie these commands into the xev results you had in post 15 that had XF86KbdBrightnessDown and XF86KbdBrightnessUp in Xfce keyboard shortcuts

User avatar
roblm
Level 11
Level 11
Posts: 3518
Joined: Sun Feb 24, 2013 2:41 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by roblm » Mon Oct 13, 2014 8:19 pm

Gerapa,

With me and JeremyB requesting information from you, we're keeping you busy.

Colons, along with other characters, can have a special meaning in coding, so they should not be used in filenames and
directories, such as "asus::kbd_backlight", so that they will be read correctly. A backslash removes the special meaning of a
character following it.

With your method of making a desktop icon, there will be a menu displayed with four options when you click the icon. Then you
have to click a second time on “Run”. You can eliminate the second step if you make the icon a different way.

In your Home directory (/home/user-name), right click in the empty space and select > Create New Document > Empty Document.
Name the document, for example “backlight-control-1”. Then open it and put your two lines in it:

#!/bin/bash
echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness

Save the file. It will now have the icon of a script file. Then right click on it and select > Properties > Permissions, and check the box
next to “Executing file as program”.

Right click on the desktop and select > Create Launcher. Give it a name and in the “Command” window type:
sh <path-to-your-script>

So the command would be:

Code: Select all

sh /home/user-name/backlight-control-1
Now you just have to click the icon once and it is automatically executed. If you right click on it and select > Properties > Permissions,
the owner should be you, not root, so you should be able to change the icon. Are your icons owned by root?
Last edited by roblm on Thu Oct 16, 2014 5:55 pm, edited 1 time in total.

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Mon Oct 13, 2014 9:51 pm

To Jeremy : if i do : sudo /etc/acpi/asus-keyboard-backlight.sh up, that works, brightness go up. And go down with the other command. I think the problem is to associate that with the Fn + F3 and Fn + F4, since it seems they are not recongnized in Xfce ?!?!

To roblm : i'm not sure i understand well what you mean. I have 4 icons on my desktop. I have to double click on them to make them work. It's the same with other shortcuts. I could do that in 1 click if i change the settings of file management. And when i click on an icon, the brightness changes. There is no menu nor terminal window opening. That works without seeing other that the brightness changing. So it's ok for me.

About the icons, they represent a terminal window. I'm the owner, but cannot change them.

JeremyB
Level 20
Level 20
Posts: 10937
Joined: Fri Feb 21, 2014 8:17 am

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by JeremyB » Tue Oct 14, 2014 5:29 am

Gerapa wrote:To Jeremy : if i do : sudo /etc/acpi/asus-keyboard-backlight.sh up, that works, brightness go up. And go down with the other command. I think the problem is to associate that with the Fn + F3 and Fn + F4, since it seems they are not recongnized in Xfce ?!?!

To roblm : i'm not sure i understand well what you mean. I have 4 icons on my desktop. I have to double click on them to make them work. It's the same with other shortcuts. I could do that in 1 click if i change the settings of file management. And when i click on an icon, the brightness changes. There is no menu nor terminal window opening. That works without seeing other that the brightness changing. So it's ok for me.

About the icons, they represent a terminal window. I'm the owner, but cannot change them.
Gerapa wrote:I don't know if that can help, but here is the result when i write in terminal :

xev | sed -n 's/^.*state \([0-9].*\), keycode *\([0-9]\+\) *\(.*\), .*$/keycode \2 = \3, state = \1/p'

and then hit Fn + F3 and Fn + F4 :

keycode 237 = (keysym 0x1008ff06, XF86KbdBrightnessDown), state = 0x10
keycode 237 = (keysym 0x1008ff06, XF86KbdBrightnessDown), state = 0x10
keycode 238 = (keysym 0x1008ff05, XF86KbdBrightnessUp), state = 0x10
keycode 238 = (keysym 0x1008ff05, XF86KbdBrightnessUp), state = 0x10

But if i hit Fn + F5 or Fn + F6 (those combinations work in Xfce to make the screen more or less brighter), nothing is written in the terminal but the brightness of the screen changes.
If this happened the following should work as the key presses are recognized by the x server-


This should be pain free, can you go to applications Menus/settings/keyboard and then select application shortcuts
The result should look like this- https://www.dropbox.com/s/87x2zdd8vzkte ... M.png?dl=0
You can click add enter

Code: Select all

/etc/acpi/asus-keyboard-backlight.sh up
click ok and see if it will accept FN+F4- this might be shown as XF86KbdBacklightUp or similar
If it works just have to add another for brightness down command is

Code: Select all

/etc/acpi/asus-keyboard-backlight.sh down

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Tue Oct 14, 2014 4:34 pm

I had a good feeling since the keys seemed to be detected. It is shown "XF86KbdBrightnessDown" and "XF86KbdBrightnessUp" when i press Fn + F3 and Fn + F4. But even after rebooting, that does'nt work.

JeremyB
Level 20
Level 20
Posts: 10937
Joined: Fri Feb 21, 2014 8:17 am

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by JeremyB » Tue Oct 14, 2014 6:43 pm

Gerapa wrote:I had a good feeling since the keys seemed to be detected. It is shown "XF86KbdBrightnessDown" and "XF86KbdBrightnessUp" when i press Fn + F3 and Fn + F4. But even after rebooting, that does'nt work.
I had to try, is there an error if you try

Code: Select all

/etc/acpi/asus-keyboard-backlight.sh up
in terminal without sudo?

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Tue Oct 14, 2014 7:01 pm

Yes, there is an arror :

serge@serge-G74Sx ~ $ /etc/acpi/asus-keyboard-backlight.sh up
/etc/acpi/asus-keyboard-backlight.sh: 24: /etc/acpi/asus-keyboard-backlight.sh: cannot create /sys/class/leds/asus::kbd_backlight/brightness: Permission denied
serge@serge-G74Sx ~ $

There is no problem with the sudo passwaord, the command works.

User avatar
roblm
Level 11
Level 11
Posts: 3518
Joined: Sun Feb 24, 2013 2:41 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by roblm » Tue Oct 14, 2014 8:01 pm

Gerapa,

Here's why I got you confused about running the scripts. In Mint 17 Cinnamon, the file manager's preferences has these
options when an executable text file is clicked, which I had forgotten about:
File preferences-1.png
The default setting is “Ask each time”. Then you will see this popup menu:
File preferences-2.png
If the first option in the top picture is selected , then the file will automatically be executed. Mint 17 Xfce doesn't have these options,
so the file is always executed immediately, and the icon can't be changed with the method you used.
So you would have to use my procedure to make the scripts, to be able to change the icon.

Gerapa
Level 2
Level 2
Posts: 63
Joined: Sun Dec 01, 2013 7:06 pm

Re: (SOLVED) Fn + F3 and Fn + F4 not reconized

Post by Gerapa » Tue Oct 14, 2014 9:19 pm

Thank you roblm, that works with your procedure. I have been able to change the icons.

Post Reply

Return to “Xfce”