You are not logged in.

#1 2020-10-13 02:36:56

cstn
Member
Registered: 2019-12-24
Posts: 17

[SOLVED]How to change screen backlight without backlight-keys

I got a new 2 in1 laptop called 'VOYO vbook A1', it's a slight machine with intel N4200 processor and a touchscreen, also with a keyboards. Archlinux goes fine on this new laptop for me, but a problem. I can't control the screen backlight. Because the keyboard has no backlight_control keys, and when it runs windows, it can control screen backlight with the touchscreen in windows UI botton.

I checked this touchscreen in archlinux, it doesn't work. And I also don't care the touchscreen. I prefer the keyboard to control most things.

So, my question is, how to control the screen backlight with keyboard?

PS: I have two idears to make it , one is modifying some other multimedia_keys to control it. two is to write a shell scripts to  control it.

and, there's another weird problem, if I want to change it:

$ sudo echo 30 > /sys/class/backlight/acpi_video0/brightness
bash: /sys/class/backlight/acpi_video0/brightness: Permission denied

this command does't work, even i give a "sudo".

but, i change to 'su':

# echo 30 > /sys/class/backlight/acpi_video0/brightness

it works.

this archlinux copy restored from my old laptop with N3450, and this command with 'sudo' works before in my old laptop. Theoretically N3450 and N4200 is the same, I think. so, i got no idear.

I would be appreciative If anyone can give some advices. thanks!



another problem is:
I can't get the 'keycode' of some multikeys of this keyboard from 'xev'. such as I pressed the audio_volume_control keys, it just look like this:

FocusOut event, serial 34, synthetic NO, window 0x2e00001,
    mode NotifyGrab, detail NotifyAncestor

FocusOut event, serial 34, synthetic NO, window 0x2e00001,
    mode NotifyUngrab, detail NotifyPointer

FocusIn event, serial 34, synthetic NO, window 0x2e00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 34, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   4294967168 0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0  

but the keys can control the audio volume normally.

so i can't modify the keys with keycode using 'xmodmap'.

Last edited by cstn (2020-10-15 02:54:32)

Offline

#2 2020-10-13 02:58:36

Pellaeon
Member
Registered: 2020-06-15
Posts: 12
Website

Re: [SOLVED]How to change screen backlight without backlight-keys

You are only running echo via sudo, your output redirect is not running as sudo, so permission is denied.

The easiest solution would be putting it all in a bash script, and running the script itself as sudo.

#!/bin/sh

echo 30 > /sys/class/backlight/acpi_video0/brightness
# sudo brightness.sh

Offline

#3 2020-10-13 03:11:23

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 382

Re: [SOLVED]How to change screen backlight without backlight-keys

There’s also a neat example of a script here:
https://bbs.archlinux.org/viewtopic.php … 1#p1927131

You only need the keybind for your...whatever.

And solve the access through group control, iirc video is enough.
That for the sake of not calling sudo just to make the screen a little more bright/dark

Also said in that post that I linked, Trilby is quite efficient. smile

Last edited by GaKu999 (2020-10-13 03:15:39)


My reposSome snippets

Heisenberg might have been here.

Offline

#4 2020-10-13 04:32:38

cstn
Member
Registered: 2019-12-24
Posts: 17

Re: [SOLVED]How to change screen backlight without backlight-keys

I was careless forgot to check my user group. By adding my USER to video group,values can be echoed into the 'brightness' file

# usermod -a -G video user

it's weird that using 'useradd' can't make it:

#useradd -G video user
useradd: user 'user' already exists

check 'user'

$ grep 'video' /etc/group
video:x:986:sddm

sddm...what?!  I don't know the 'sddm' exactly is. maybe beacause of the archlinux restored from old laptop?
whatever, i use 'usermod' and made the scripts runs in normall user level.


Pellaeon wrote:

You are only running echo via sudo, your output redirect is not running as sudo, so permission is denied.

The easiest solution would be putting it all in a bash script, and running the script itself as sudo.

#!/bin/sh

echo 30 > /sys/class/backlight/acpi_video0/brightness
# sudo brightness.sh

Offline

#5 2020-10-13 04:44:30

cstn
Member
Registered: 2019-12-24
Posts: 17

Re: [SOLVED]How to change screen backlight without backlight-keys

very helpful informations! if i couldn't modify the keys, this will be the nice method to control the backlight. As a newbie,I need some time to understand the script, and I'd like try to customize the script into my archlinux.

of course i am also seeking to convert some other multimedia keys to control the backlight. it would be more straight.



GaKu999 wrote:

There’s also a neat example of a script here:
https://bbs.archlinux.org/viewtopic.php … 1#p1927131

You only need the keybind for your...whatever.

And solve the access through group control, iirc video is enough.
That for the sake of not calling sudo just to make the screen a little more bright/dark

Also said in that post that I linked, Trilby is quite efficient. smile

Last edited by cstn (2020-10-13 04:55:13)

Offline

Board footer

Powered by FluxBB