Page 24 of 24

Re: MX-Fluxbox

Posted: Sun Jul 10, 2022 8:55 am
by tequila
sorry, it works for me, here is the original:

Code: Select all

#!/usr/bin/env bash
YELLOW="\033[1;33m"
ENDCOLOR="\033[0m"

icon=cs-desktop

jas=$(xbacklight -get)

yad --mouse \
   --undecorated \
   --title "fenyerö"  \
   --image="$icon" \
   --window-icon="$icon" \
   --text="Valassz!     Aktualis=$jas%" \
   --button="10%":2 \
   --button="40%":3 \
   --button="60%":4 \
   --button="80%":5 \
   --button="100%":6 \
   --button=gtk-cancel:1 \
   --on-top
ret=$?

case $ret in
2) adj=10
   ;;
3) adj=40
   ;;
4) adj=60
   ;;
5) adj=80
   ;;
6) adj=100
   ;;
*) adj=$jas
  ;;
esac

if test $jas != $adj; then
   xbacklight -set $adj 
fi

echo -e $YELLOW"fenyerö bealitva!"$ENDCOLOR
exit 0
Original from link:https://linuxos.sk/blog/zaphod/detail/r ... -z-linuxu/


I found a better one:

Code: Select all

#!/bin/bash

# detect monitor
MON=$(xrandr -q | grep " connected" | cut -f1 -d ' ')
# find current xrandr brightness value
XR=$(xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1)
BrCur=`awk "BEGIN {print $XR*100}"` # calculate, so e.g. 0.5 gets 50
BrMax="100"
BrMin="10"
yad --undecorated --on-top --geometry=450x70+550+650 --scale --value $BrCur --print-partial --min-value $BrMin --max-value $BrMax --button="Done":1 | while read BrNew; do
# division using awk, so xrandr value gets e.g. 0.5 rather than 50
xrandr --output $MON --brightness $(awk "BEGIN {print $BrNew/100}")
done

Re: MX-Fluxbox

Posted: Sun Jul 10, 2022 10:24 am
by dolphin_oracle
not all backlights provide an interface that is operable with xbacklight.

Re: MX-Fluxbox

Posted: Sun Jul 10, 2022 11:03 am
by Huckleberry Finn
Afaik Xbacklight works (only) with Intel cards and also with Intel driver (not with modesetting). Therefore this may be required (even when the card is already Intel):

/etc/X11/xorg.conf.d/20-intel.conf

Code: Select all

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TearFree"     "true"
#  Option      "Backlight"  "intel_backlight"   # ( If the backlight directory is intel_backlight in /sys/class/backlight )
#  Option      "AccelMethod" "uxa"  #could also use the default "sna"
EndSection
And for non-Intel devices / drivers Acpilight might work (just maybe)

Re: MX-Fluxbox

Posted: Sun Jul 10, 2022 11:34 am
by tequila
Original script with ddcutil didn't work for me on notebook so i wrote at xbacklight,it would be nice to combine the two.
2.sript,maybe someone is interested in the alarm,works on mx:https://oldforum.puppylinux.com/viewtop ... 2#p1045692
on Antix to be rewritten >kill $! to>pkill -P,at the end of the script> yad --fixed --center --button=gtk-cancel:1