Issues Installing NetBSD on a PineBook Pro
#12
I had some spare time today (!) and made a simple script that you might find interesting.

Code:
$ cat ~/s/ModBright

#!/bin/sh

level=`cat ~/.backlightlevel`
level=$(( $level + $1 ))

if [ "$level" -lt "0" ]; then
level=0
fi

if [ "$level" -gt "255" ]; then
level=255
fi

echo $level > ~/.backlightlevel
sudo sysctl -w hw.pwmbacklight0.level=$level

It requires 'sudo' unfortunately. But if you pass a value, it will dim or brighten the backlight. Passing "10" will increase the parameter by 10, passing "-15" will decrease the parameter by 15. I used xbindkeys and bound this script to the Alt comma and Alt period keys:

Code:
$ cat ~/.xbindkeysrc

#Mod4 is the Pine key

"konsole"
Mod4 + F1

"firefox78"
Mod4 + F2

"sh ~/s/ModBright -10"
Alt + comma

"sh ~/s/ModBright 10"
Alt + period

You might prefer to use Mod4 + F1 and Mod4 + F2 (which is Pine + F1 and Pine + F2). As you can see, I did not because I have those in use already. We cannot use Fn + F1 and Fn + F2 because the keyboard firmware returns both keys as the same single key.

I run this as a script at KDE startup, but you could put it in .xinitrc:

Code:
sysctl -n hw.pwmbacklight0.level > ~/.backlightlevel
xbindkeys

Surely there is a better way to do this, but until we get support for whatever the keyboard firmware does, it works. I'm not any kind of Unix guru, and I barely know how to make shell scripts work.
  Reply


Messages In This Thread
RE: Issues Installing NetBSD on a PineBook Pro - by KC9UDX - 01-25-2021, 08:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  2nd NetBSD boot goes dark donn 6 1,781 02-22-2024, 03:59 AM
Last Post: KC9UDX
  NetBSD 1.0 runs down battery donn 13 1,441 11-15-2023, 04:05 PM
Last Post: KC9UDX
  Booting NetBSD untitled 12 5,991 08-30-2022, 01:23 AM
Last Post: untitled
  NetBSD on the Pinebook Pro in August 2022 - or not? KC9UDX 6 3,698 08-24-2022, 01:49 AM
Last Post: KC9UDX
  NetBSD and pinebook keyboard/trackpad firmware updater mrgtwentythree 5 9,897 05-16-2021, 07:37 PM
Last Post: mrgtwentythree
  NetBSD Der Geist der Maschine 76 110,138 05-16-2021, 02:43 PM
Last Post: mrgtwentythree
Question OpenBSD 6.7 on Pinebook Pro SKG 27 49,509 05-07-2021, 04:03 PM
Last Post: bigtreeman
Music NetBSD and USB "sound cards" KC9UDX 2 5,329 05-07-2021, 12:11 PM
Last Post: elimark1
  OpenBSD on the pinebook pro e-minguez 5 11,155 04-27-2021, 04:06 AM
Last Post: dreamer_
  PINEBOOK Pro USB-C Docking Deck on FreeBSD S199pWa1k9r 2 4,504 03-04-2021, 01:53 PM
Last Post: Arwen

Forum Jump:


Users browsing this thread: 2 Guest(s)