How to Configure Screen Brightness in mate on pinebook via terinal?
#3
(08-31-2017, 12:28 PM)shirman Wrote: I found this, but it is not working with sudo, only after sudo su

Code:
root@pinebook:/home/pine64# echo 50 > /sys/class/backlight/lcd0/brightness

Okay, now is the question how to make my own xbacklight with -dec 10 and -inc 10 to bind this for keyboard keys Smile


... two scripts , one for key +  one for key -

Your script needs to read the value into a variable ,  add 10 to it ,  and then write the variable back out;  but, only if the +10 will not exceed 100.

Do the same for the minus key binding, only don't allow it to go below say 30 ( idk, experiment ).

also,  try:    sudo  -i


Shy

Ok, here are the scripts :



lcd_plus.sh

Code:
#!/bin/bash

LCDVALUE=`cat /sys/class/backlight/lcd0/brightness`
NEWVALUE=$(( $LCDVALUE + 10 ))

if [ $NEWVALUE -le 100 ]
then
   echo $NEWVALUE > /sys/class/backlight/lcd0/brightness
   echo $NEWVALUE
else
   echo $LCDVALUE
fi


lcd_minus.sh

Code:
#!/bin/bash

LCDVALUE=`cat /sys/class/backlight/lcd0/brightness`
NEWVALUE=$(( $LCDVALUE - 10 ))

if [ $NEWVALUE -gt 30 ]
then
   echo $NEWVALUE > /sys/class/backlight/lcd0/brightness
   echo $NEWVALUE
else
   echo $LCDVALUE
fi

try running them with  :

     sudo  -i

     ./lcd_plus.sh

     ./lcd_minus.sh

Now all that has to be done in i3 is to bind them to a keysym  using exec !
Works well.
Shy


Note:  of course,  you could combine them into a single script and pass a parm (up) or (down) 

try it !
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )


Messages In This Thread
RE: How to Configure Screen Brightness in mate on pinebook via terinal? - by MarkHaysHarris777 - 08-31-2017, 01:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  DietPi OS for Pinebook MichaIng 3 6,956 03-11-2024, 05:02 PM
Last Post: oxoocoffee
  Slarm64 on Pinebook [Slackware Arm - 64 bit] KRT 46 70,936 09-26-2023, 03:18 PM
Last Post: mara
  Broke pinebook GUI, what to do, fix or install new? acruhl 2 1,547 07-13-2023, 05:43 PM
Last Post: acruhl
  Orignal PineBook jwp1000 1 1,164 07-10-2023, 07:44 AM
Last Post: tophneal
  Pinebook no longer boots rjtanner 12 5,666 04-13-2023, 01:09 PM
Last Post: tophneal
  Stock Debian on original Pinebook moonwalkers 1 3,758 01-29-2022, 10:37 PM
Last Post: cel
  Write image to eMMC - Pinebook 11.6" irongarment 4 4,702 01-04-2022, 09:22 PM
Last Post: irongarment
  E: The repository 'http://pinebook.kde.org.uk bionic Release' no longer has a Release pixelpaperyarn 3 5,922 05-07-2021, 10:20 AM
Last Post: tophneal
  pinebook.kde.org.uk no longer has release file?? supermassive 1 4,218 01-20-2021, 11:18 AM
Last Post: tophneal
Question Ran apt update on my Pinebook.. ford442 0 3,130 12-25-2020, 04:40 PM
Last Post: ford442

Forum Jump:


Users browsing this thread: 3 Guest(s)