OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Controlling brightness from other WMs, Can't get brightness controls working from i3
DonOregano
post Jul 7 2018, 11:59 AM
Post #1





Group: Members
Posts: 24
Joined: 26-June 18
Member No.: 825,047



I'm trying to configure i3 to run on my Gemini, which may seem like a very strange thing to do, but I think that a keyboard-centric environment may turn out to be a really nice thing for the Gemini. Anyway, I am having trouble with the brightmess controls, and I'm wondering if anyone has any tips for me.

I have tried running the brightness control scripts that LxQt uses, but nothing happens. Looking a little bit deeper into them, I realize that they send dbus commands to the repowerd daemon. And looking at the logs:

QUOTE
repowerd[683]: g_dbus_connection_call_sync_internal: assertion 'object_path != NULL && g_variant_is_object_path (object_path)' failed
repowerd[683]: LogindSessionTracker: dbus_get_session_uid() failed to get session uid:


Sooo, something is going on with a logind uid?

I tried looking at the logs that repowerd spits out when i log into LxQt vs i3, and it appears that when I log into LxQt a lot of stuff happens, like logind/seat/dbus stuff. But when I log into i3, nothing. However, if I log in to LxQt and log out and into i3 without a reboot I get working brightness controls.

What is the magic that LxQt does, and how do i replicate it?
Go to the top of the page
 
+Quote Post
Eric BF
post Jul 8 2018, 04:54 AM
Post #2





Group: Members
Posts: 66
Joined: 25-June 18
Member No.: 824,997



QUOTE(DonOregano @ Jul 7 2018, 08:59 PM) *
I'm trying to configure i3 to run on my Gemini, which may seem like a very strange thing to do, but I think that a keyboard-centric environment may turn out to be a really nice thing for the Gemini.
[...]
What is the magic that LxQt does, and how do i replicate it?

Not a strange thing to do at all! I'm running stumpwm on mine. Makes full use of the screen with nothing wasted and having a keyboard is perfect for this wm.

In any case, I have the same problem as you. I've not figured out how lxqt does it. What I have figured out is that you can adjust the brightness manually by changing the value in /sys/class/leds/lcd-backlight/brightness. The value should be an integer in the range 1-255. I am writing a shell script to do this but it needs root access. I'm getting around this by using sudo within the script and having my account set up so that it does need a password to invoke sudo.
Go to the top of the page
 
+Quote Post
Da_Blitz
post Jul 8 2018, 11:02 PM
Post #3





Group: Members
Posts: 1,579
Joined: 7-April 05
From: Sydney, Australia
Member No.: 6,806



QUOTE(Eric BF @ Jul 8 2018, 10:54 PM) *
QUOTE(DonOregano @ Jul 7 2018, 08:59 PM) *
I'm trying to configure i3 to run on my Gemini, which may seem like a very strange thing to do, but I think that a keyboard-centric environment may turn out to be a really nice thing for the Gemini.
[...]
What is the magic that LxQt does, and how do i replicate it?

Not a strange thing to do at all! I'm running stumpwm on mine. Makes full use of the screen with nothing wasted and having a keyboard is perfect for this wm.

In any case, I have the same problem as you. I've not figured out how lxqt does it. What I have figured out is that you can adjust the brightness manually by changing the value in /sys/class/leds/lcd-backlight/brightness. The value should be an integer in the range 1-255. I am writing a shell script to do this but it needs root access. I'm getting around this by using sudo within the script and having my account set up so that it does need a password to invoke sudo.


One thing i do at my end is use the command 'id' to see if the script is being run as root and if not rexec the script via sudo meaning i do not have to worry about which comamnds need to be runa s root and which do not there are also some more subtle security issues this can fix but they are more of a concern for the environment i was working in with hostile users with high skll levels

the trick i use on my own systems is to use tmpfiled from systemd to change the group owner of the brightness file to that of the 'input' user that is avialbie on most modern distros and already have my user added to that group allowing myself access without root privileges

i stole the chromebook backlight animations and converted them to a cli script at http://blitz.works/text11/file/b405360ab31...11/backlight.py may need some work to update paths to point ot the LED backlight but if there is a brightness file that is autodetected i would recommend using that one rather than the LED one
Go to the top of the page
 
+Quote Post
Eric BF
post Jul 9 2018, 02:50 AM
Post #4





Group: Members
Posts: 66
Joined: 25-June 18
Member No.: 824,997



QUOTE(Da_Blitz @ Jul 9 2018, 08:02 AM) *
the trick i use on my own systems is to use tmpfiled from systemd to change the group owner of the brightness file to that of the 'input' user that is avialbie on most modern distros and already have my user added to that group allowing myself access without root privileges

Useful trick! Thanks.
Go to the top of the page
 
+Quote Post
DonOregano
post Jul 11 2018, 05:58 AM
Post #5





Group: Members
Posts: 24
Joined: 26-June 18
Member No.: 825,047



QUOTE(Da_Blitz @ Jul 9 2018, 08:02 AM) *
the trick i use on my own systems is to use tmpfiled from systemd to change the group owner of the brightness file to that of the 'input' user that is avialbie on most modern distros and already have my user added to that group allowing myself access without root privileges


Hmm, I can't get that to work. I created a file /etc/tmpfiles.d/backlight.conf, containing
CODE
#Type Path        Mode UID  GID  Age Argument
z     /sys/devices/platform/leds-mt65xx/leds/lcd-backlight/brightness   0666 - - - -


But it does not appear to have any effect. Help?
Go to the top of the page
 
+Quote Post
frnzndr
post Aug 30 2018, 12:18 PM
Post #6





Group: Members
Posts: 13
Joined: 14-July 18
Member No.: 826,111



Has anyone figured out a solution for getting the relevant start scripts from lxqt working on i3, in particular for things like brightness control? If there was a solution above, I did not understand how it would work - was the idea that the linked script

I also have noticed the issue that at least on the default settings, the fonts are not rendered at all on the i3bar/i3status. Just asking as this question mentiones i3 specifically and I'd love to use it too, alternatively I can open a new thread for this.
Go to the top of the page
 
+Quote Post
Eric BF
post Sep 29 2018, 02:11 AM
Post #7





Group: Members
Posts: 66
Joined: 25-June 18
Member No.: 824,997



QUOTE(frnzndr @ Aug 30 2018, 09:18 PM) *
Has anyone figured out a solution for getting the relevant start scripts from lxqt working on i3, in particular for things like brightness control?

I use stumpwm and simply wrote my own scripts. You can control the brightness directly by putting a value (<256) in /sys/class/leds/lcd-backlight/brightness. I bind the script to a particular key of my choosing.
Go to the top of the page
 
+Quote Post
frnzndr
post Oct 28 2018, 01:07 PM
Post #8





Group: Members
Posts: 13
Joined: 14-July 18
Member No.: 826,111



Finally got back to looking into this, it seems that i3 is not able to evaluate the XF86MonBrightnessUp/Down key events for some reason. I've established with xev that the keypress events are properly generated on pressing Fn+b and Fn+n, but I cannot use that to trigger an event (such as calling a script to change brightness).
The same issue probably applies to the XF86AudioLowerVolume and XF86AudioRaiseVolume buttons.
Has anyone had similar issues, or a pointer for some solution? It's quite annoying to not be able to use those keycombinations. Could it be that the version of i3 supplied via Debian stretch is simply too old?
How does the standard window manager use them?
Go to the top of the page
 
+Quote Post
Eric BF
post Oct 28 2018, 11:19 PM
Post #9





Group: Members
Posts: 66
Joined: 25-June 18
Member No.: 824,997



QUOTE(frnzndr @ Oct 28 2018, 10:07 PM) *
Has anyone had similar issues, or a pointer for some solution? It's quite annoying to not be able to use those keycombinations. Could it be that the version of i3 supplied via Debian stretch is simply too old?
How does the standard window manager use them?

stumpwm has the same problem. All keys generated using the Fn key are not understood by the window manager itself (even keys like : and ;, surprisingly). Something to do with the underlying X libraries used by these window managers. I am not sure why the default window manager is able to process these keys.

However, note that the actual key codes are transmitted to applications. As I "live" in Emacs, it was simply a matter of binding the key to specific code, e.g.:
CODE
(global-set-key [XF86MonBrightnessDown] #'(lambda () (interactive) (shell-command "sudo /.../gemini.backlight.sh down")))
Go to the top of the page
 
+Quote Post
Adam Boardman
post Oct 29 2018, 02:36 AM
Post #10





Group: Members
Posts: 155
Joined: 29-December 17
Member No.: 815,489



QUOTE(frnzndr @ Oct 28 2018, 10:07 PM) *
Could it be that the version of i3 supplied via Debian stretch is simply too old?

I'd suggest that as unlikely, the whole linuxy key grabbing stuff is all based upon grabbing named keys as whole keys. Cite for example original LXQT and current KDE's/Gnome key grabbers eat 'r' keys as 'Print' on the UK keyboard, so you just have to disable the short-cut's or fix the code.

QUOTE(frnzndr @ Oct 28 2018, 10:07 PM) *
How does the standard window manager use them?

Had be fixed with some changes to make it work with keys that do both letters and 'named functions', from commit messages:
https://github.com/gemian/lxqt-globalkeys/c...4b3c775ed18631f
and:
https://github.com/gemian/lxqt-globalkeys/c...d9b26447a1baa34

But its a while ago that I made those changes not certain that there aren't other tweaks in the other commits that might also be important.
Go to the top of the page
 
+Quote Post
Eric BF
post Oct 30 2018, 10:55 PM
Post #11





Group: Members
Posts: 66
Joined: 25-June 18
Member No.: 824,997



QUOTE(Adam Boardman @ Oct 29 2018, 10:36 AM) *
I'd suggest that as unlikely, the whole linuxy key grabbing stuff is all based upon grabbing named keys as whole keys. Cite for example original LXQT and current KDE's/Gnome key grabbers eat 'r' keys as 'Print' on the UK keyboard, so you just have to disable the short-cut's or fix the code.


You can add ratpoison to that list. That was my first port-of-call in terms of tiling window manager for the gemini but it's unusable due to the r key (and some others, from memory) getting swallowed up. I thought I was going crazy... It's strange that some window managers work out of the box (i.e. stumpwm in my case).
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th March 2019 - 06:28 PM