device-nokia-n900: various fixes and improvements to the user experience in i3wm
These changes are aimed at minor improvements and fixes to the user interface in i3wm:
-
Fixing WiFi signal quality in i3blocks (https://gitlab.com/DvaMishkiLapa/pmaports/-/commit/e3a9b867ae6180ce1226a5493353d6de864aa716).
/proc/net/wireless
no longer exists in the system. I don't know exactly when this happened. On my device it disappeared when I switched from kernel5.*
to6.*
. Now you can get the same information fromnmcli
. -
Added battery temperature information to i3blocks (https://gitlab.com/DvaMishkiLapa/pmaports/-/commit/e7c5eca2c345097b13256fc1a124b4f3ab1c9ac0).
I think this is useful, so you can see at least some information about the heating of the device.
-
Added volume control in alsamixer using the volume buttons via i3wm (https://gitlab.com/DvaMishkiLapa/pmaports/-/commit/a060096b4abe8b614e9ae11aff29f133aa4486b9).
I tied the volume buttons to
amixer set PCM 5%+
andamixer set PCM 5%-
. -
Added hotkeys to create a screenshot with imagemagick via i3wm (https://gitlab.com/DvaMishkiLapa/pmaports/-/commit/35007eaefd0e471634c74aad9294234ceed260ae).
I wrote a simple script
screenshot.sh
that usesimport
from imagemagick and creates a screenshot of the entire display in theScreenshot
folder in the user's home directory. This script also takes as parameters a different path to save the screenshot, as well as the display number of the X server. This is tied toShift+Ctrl+p
. -
Added hotkeys to change the brightness of the display backlight and keypad LEDs via i3wm (https://gitlab.com/DvaMishkiLapa/pmaports/-/commit/968293603a3d55d1380fdff34d4c89d8bcd00bda).
I have written simple scripts
screen_brightness.sh
andkb_brightness.sh
that take as an argument the brightness intensity offset for the display and for the keyboard LEDs. Although these scripts are almost identical, I decided to separate them so that each of them would be responsible for its own function. This works through a separatemode "brightness"
wherew
ands
are responsible for the brightness of the display ande
andd
are responsible for the brightness of the keyboard LEDs.
Merge request reports
Activity
added 1 commit
- 10cbccd9 - device-nokia-n900: scripts use tabs as indents
By DvaMishkiLapa on 2023-05-29T20:28:33
@DvaMishkiLapa nice work, thank you!
Just a few comments:
Fixing WiFi signal quality in i3blocks (DvaMishkiLapa/pmaports@e3a9b867).
/proc/net/wireless no longer exists in the system. I don't know exactly when this happened. On my device it disappeared when I switched from kernel 5.* to 6.*. Now you can get the same information from nmcli.
Thank you. I completely agree. We could restore
/proc/net/wireless
via kernel config, but the change is appropriate nonethelessAdded battery temperature information to i3blocks (DvaMishkiLapa/pmaports@e7c5eca2).
I think this is useful, so you can see at least some information about the heating of the device.
While I do not oppose this change, I am not sure how necessary it is. In fact, I was thinking we need to shorten the information displayed on the status bar, and increase the font a little.
Added volume control in alsamixer using the volume buttons via i3wm (DvaMishkiLapa/pmaports@a060096b).
I tied the volume buttons to amixer set PCM 5%+ and amixer set PCM 5%-.
Nice, thanks .
Added hotkeys to create a screenshot with imagemagick via i3wm (DvaMishkiLapa/pmaports@35007eae).
I wrote a simple script screenshot.sh that uses import from imagemagick and creates a screenshot of the entire display in the Screenshot folder in the user's home directory. This script also takes as parameters a different path to save the screenshot, as well as the display number of the X server. This is tied to Shift+Ctrl+p.
You would need to also add
imagemagick
as a dependency for thenokia-n900
package since it is not installed by default. However,imagemagick
is quite a large package. Would you consider usingscrot
(or some other light utility) instead?Also, I am not sure about the standalone script, since we don't/can't pass parameters to shortcuts.
scrot
command added directly ini3wm-config
might be sufficient.Added hotkeys to change the brightness of the display backlight and keypad LEDs via i3wm (DvaMishkiLapa/pmaports@96829360).
I have written simple scripts screen_brightness.sh and kb_brightness.sh that take as an argument the brightness intensity offset for the display and for the keyboard LEDs. Although these scripts are almost identical, I decided to separate them so that each of them would be responsible for its own function. This works through a separate mode "brightness" where w and s are responsible for the brightness of the display and e and d are responsible for the brightness of the keyboard LEDs.
Cool. You could perhaps use the volume keys for the screen brightness in this mode? In future, especially for the keyboard LEDS, we should have them work via ambient light sensor.
As a minor improvement on the scripts, when the value is about to be >255 or <0, you could just
exit 0
, thus saving a few CPU cycles of rewriting the same value to 6 keyboard LEDSBy Sicelo on 2023-05-30T06:56:50
@DvaMishkiLapa on a different note, perhaps you would like to also join the Testing Team?
By Sicelo on 2023-05-30T08:10:03
While I do not oppose this change, I am not sure how necessary it is. In fact, I was thinking we need to shorten the information displayed on the status bar, and increase the font a little.
I had a couple of ideas about that, I'll see if I can do them. I don't know about the font, I've reduced the size of the fonts in my use case.
You would need to also add
imagemagick
as a dependency for the nokia-n900 package since it is not installed by default. However,imagemagick
is quite a large package. Would you consider usingscrot
(or some other light utility) instead?Yes, I agree, I didn't know about this analog, it looks lighter.
About the dependencies, I included
imagemagick
as a dependency in thedevice-nokia-n900
package, is that not enough, or should I specify this dependency elsewhere? I thought it was logical,device-nokia-n900
includes scripts fori3wm
, accordingly the dependency should be indevice-nokia-n900
. True, there is an exception with the shortcut fornetsurf
, which I didn't create. This browser is not listed anywhere as a dependency.Also, I am not sure about the standalone script, since we don't/can't pass parameters to shortcuts.
scrot
command added directly ini3wm-config
might be sufficient.I don't really know what labels we're talking about. Passing arguments when called via exec in i3config works.
Cool. You could perhaps use the volume keys for the screen brightness in this mode? In future, especially for the keyboard LEDS, we should have them work via ambient light sensor.
In this case you have to create two modes in
i3config
. Although, I can bind volume keys and some keyboard key for that. It's hard to say how to make it more convenient.@DvaMishkiLapa on a different note, perhaps you would like to also join the Testing Team?
Hmm, that sounds interesting.
By DvaMishkiLapa on 2023-05-30T12:45:20
Edited by Ghost UserI had a couple of ideas about that, I'll see if I can do them. I don't know about the font, I've reduced the size of the fonts in my use case.
I really do not think we should make font tiny for everyone. The status bar is (generally?) meant to make information easily accessible, so very small seems to defeat the purpose.
About the dependencies, I included imagemagick as a dependency in the device-nokia-n900 package, is that not enough, or should I specify this dependency elsewhere? I thought it was logical, device-nokia-n900 includes scripts for i3wm, accordingly the dependency should be in device-nokia-n900.
My bad. I missed that it was already added. I still think a utility with smaller install size is preferable.
I don't really know what labels we're talking about. Passing arguments when called via exec in i3config works.
I meant - the i3 onfig as submitted in the MR does not use feature of changing save location, or display server. Thus the script could be excluded and the actual command to tske screenshot be entered directly in i3 config.
In this case you have to create two modes in i3config. Although, I can bind volume keys and some keyboard key for that. It's hard to say how to make it more convenient.
Ok. Let's keep it simple. Was just an idea.
By Sicelo on 2023-05-30T12:45:20
While I do not oppose this change, I am not sure how necessary it is. In fact, I was thinking we need to shorten the information displayed on the status bar, and increase the font a little.
The status bar displays information about the voltage and current capacity of the battery. I am not sure if this is useful information (especially the voltage).
While I was thinking about removing unnecessary information from the status bar, I came to the idea that the user himself can later remove what he considers unnecessary. If he chooses i3wm as his working environment, he is able to do so. On the config side it will be possible to add/remove unnecessary sensors in the statusbar. The user won't have to look for those sensors themselves to add something new (like the same temperature).
Although, it's hard for me to say who will use the N900 now, I do it more as a fan :D.
By DvaMishkiLapa on 2023-05-30T15:33:42
13 fi 14 15 CURRENT=`cat /sys/class/leds/lp5523\:kb1/brightness` 16 if [[ $CURRENT -eq 255 && $1 -gt 0 ]] || [[ $CURRENT -eq 0 && $1 -lt 0 ]]; then 17 echo $CURRENT 18 exit 0 19 fi 20 21 NEW_VAL=$(( $CURRENT + $1 )) 22 if [ $NEW_VAL -gt 256 ] 23 then 24 NEW_VAL=255 25 elif [ $NEW_VAL -lt 0 ] 26 then 27 NEW_VAL=0 28 fi A block checking whether the new value is greater than 255 or less than 0 is still needed. I cannot write numbers outside this range (lines 21-28).
Lines 15-19 would work if the current value is already maximal, in case of an increase from the user, or minimal, in case of a decrease.
By DvaMishkiLapa on 2023-05-31T09:46:56
13 fi 14 15 CURRENT=`cat /sys/class/backlight/acx565akm/brightness` 16 if [[ $CURRENT -eq 255 && $1 -gt 0 ]] || [[ $CURRENT -eq 0 && $1 -lt 0 ]]; then 17 echo $CURRENT 18 exit 0 19 fi 20 21 NEW_VAL=$(( $CURRENT + $1 )) 22 if [ $NEW_VAL -gt 256 ] 23 then 24 NEW_VAL=255 25 elif [ $NEW_VAL -lt 0 ] 26 then 27 NEW_VAL=0 28 fi 66 76 # Pressing the power button suspends the device 67 77 bindsym XF86PowerOff exec --no-startup-id sudo pm-suspend 68 78 79 # Volume ALSA control 80 bindsym XF86AudioRaiseVolume exec amixer set PCM 5%+ 81 bindsym XF86AudioLowerVolume exec amixer set PCM 5%- 82 83 # Creating a screenshot of the entire display 84 bindsym Shift+Ctrl+p exec scrot '%Y-%m-%d_%H-%M-%S.png' -e 'mv $f ~/Screenshots' I think I'll close this MR by rethinking it at another time.
By DvaMishkiLapa on 2023-05-31T10:45:03
Edited by Ghost User
Ah, I think I misunderstood @sicelo .
I wanted to close because I thought there were a lot of commits to fixes on my part that came out in this MR. It's probably not the best practice, but if it's not a problem, I'll end MR.
By DvaMishkiLapa on 2023-06-01T09:17:47
Edited by Ghost User
@DvaMishkiLapa can we at least merge the first commit (WiFi strength fix)? It would be good to have that in stable, which is about to get released.
I guess the easiest way is to submit it as a separate MR.
By Sicelo on 2023-06-05T12:21:18
Edited by Ghost User@DvaMishkiLapa seems the release is imminent, so I took the liberty, while submitting other fixes, to include a variation of your first commit above, and credited you for that work. See !4157 (diffs)
By Sicelo on 2023-06-05T21:18:46
Edited by Administrator
mentioned in merge request !4157 (merged)
By Sicelo on 2023-06-05T21:10:28
added status::mr-stale label
Sorry to bother you @DvaMishkiLapa,
but we've detected that this merge request hasn't seen any recent activity. If you need help or want to discuss your approach with developers you can ping
@postmarketOS
. You can also ask on matrix in #devel:postmarketos.org or #postmarketos-devel on OFTC. If no further activity occurs in this MR, postmarketOS developers may close it in the future.Thanks for your contribution.
By * postmarketOS Bot on 2023-07-05T22:00:04