How to Configure Screen Brightness in mate on pinebook via terinal?
#4


Ok,  expanding on a theme, I have combined the scripts here into one script that takes two parameters;  the first is the direction ( U for up;  D for down ) and the second is the scalar value.


lcd_bright.sh

Code:
#!/bin/bash

MODE=`echo $1 |tr '[a-z]' '[A-Z]'`
LCDVALUE=`cat /sys/class/backlight/lcd0/brightness`

if [ "$MODE" = "U" ]
then
   NEWVALUE=$(( $LCDVALUE + $2 ))
   if [ $NEWVALUE -le 100 ]
   then
       echo $NEWVALUE > /sys/class/backlight/lcd0/brightness
       echo $NEWVALUE
   else
       echo $LCDVALUE
   fi
else
   NEWVALUE=$(( $LCDVALUE - $2 ))
   if [ $NEWVALUE -gt 30 ]
   then
       echo $NEWVALUE > /sys/class/backlight/lcd0/brightness
       echo $NEWVALUE
   else
       echo $LCDVALUE
   fi
fi


Run the script with :

       sudo  -i

       ./lcd_bright.sh  U  10

or

       ./lcd_bright.sh  D  10

Notes:
       The U and D  can be upper or lower case ( the script upper cases it for you ).
       The script might be changed to set a maximum or minimum based on parameter--  try it !

Shy
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, 03:58 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: 4 Guest(s)