OESF Portables Forum
Model Specific Forums => Gemini PDA => Gemini PDA - Linux => Topic started by: DonOregano on July 07, 2018, 03:59:21 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. 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:
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?
-
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.
-
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 (http://blitz.works/text11/file/b405360ab317/text11/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
-
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.
-
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
#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?
-
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.
-
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.
-
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?
-
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.:
(global-set-key [XF86MonBrightnessDown] #'(lambda () (interactive) (shell-command "sudo /.../gemini.backlight.sh down")))
-
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.
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 (https://github.com/gemian/lxqt-globalkeys/commit/c091680e4cea01c5289822fe94b3c775ed18631f)
and:
https://github.com/gemian/lxqt-globalkeys/c...d9b26447a1baa34 (https://github.com/gemian/lxqt-globalkeys/commit/d77d15b21b26614ebf072eb23d9b26447a1baa34)
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.
-
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).