Compare commits

...

5 Commits

Author SHA1 Message Date
Jean-Claude 925aa712da
Remove general handler, as it leads to interference
The backlight keys are triggered somehow twice when having these
handlers.
2023-10-27 10:55:54 +02:00
Jean-Claude ff5b0a6983
Load color profiles 2023-10-26 21:07:03 +02:00
Jean-Claude bf068844b1
Improve color levels again 2023-10-26 15:57:37 +02:00
Jean-Claude b5e270ff7f
Make robust for cases where acpi display multiple lines 2023-10-26 15:24:38 +02:00
Jean-Claude 3f31b28814
Improve steps between brightness levels 2023-10-26 15:23:39 +02:00
5 changed files with 8 additions and 88 deletions

View File

@ -5,10 +5,11 @@ APPNAME=$( basename "$0" | sed "s/\.sh$//" )
notification="false"
currentLevelCache=$XDG_CACHE_HOME/backlight/level
currentLevelCache=/tmp/backlight/level
backlightDev=/sys/class/backlight/intel_backlight
declare -a levels=(0 1 6 12 25 50 100 200 350 512)
declare -a levels=(0 1 2 3 5 10 15 20 25 50 75 100 125 150 175 200 225 250 300 325 350 375 400)
defaultValue=2
verbose="false"
@ -34,7 +35,7 @@ b_get_current_level() {
}
b_change_level() {
# Change the brightness level according the the provided $1. + for increase, - for decrease
# Change the brightness level according to the provided $1. + for increase, - for decrease
local currentLevel=$(b_get_current_level)

View File

@ -12,9 +12,9 @@ statusCache=~/.cache/battery/lastStatus
# Fetch data
## Status: Charging, Full, Discharging
status="$( acpi | grep -oP 'Battery 0:.*?\K\w+' )"
percentage="$( acpi | grep -oP '[0-9]+(?=%)' )"
time="$( acpi | grep -oP 'Battery 0:.*?\K\d\d:\d\d+' )"
status="$( acpi | head -n 1 | grep -oP 'Battery 0:.*?\K\w+' )"
percentage="$( acpi | head -n 1 | grep -oP '[0-9]+(?=%)' )"
time="$( acpi | head -n 1 | grep -oP 'Battery 0:.*?\K\d\d:\d\d+' )"
#doFixData() {
# # If time is not defined

View File

@ -1,3 +0,0 @@
# Pass all events to our one handler script
event=.*
action=/etc/acpi/handler.sh %e

View File

@ -1,77 +0,0 @@
#!/bin/bash
# Default acpi script that takes an entry for all actions
case "$1" in
button/power)
case "$2" in
PBTN|PWRF)
logger 'PowerButton pressed'
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
button/sleep)
case "$2" in
SLPB|SBTN)
logger 'SleepButton pressed'
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
ac_adapter)
case "$2" in
AC|ACAD|ADP0)
case "$4" in
00000000)
logger 'AC unpluged'
;;
00000001)
logger 'AC pluged'
;;
esac
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
battery)
case "$2" in
BAT0)
case "$4" in
00000000)
logger 'Battery online'
;;
00000001)
logger 'Battery offline'
;;
esac
;;
CPU0)
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/lid)
case "$3" in
close)
logger 'LID closed'
;;
open)
logger 'LID opened'
;;
*)
logger "ACPI action undefined: $3"
;;
esac
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
esac
# vim:set ts=4 sw=4 ft=sh et:

View File

@ -171,5 +171,4 @@ bindsym ctrl+space exec dunstctl close
exec_always --no-startup-id feh --no-fehbg --bg-fill '/home/jeanclaude/.config/feh/bg.jpg'
#exec --no-startup-id redshift -c ~/.config/redshift/redshift.conf
exec --no-startup-id dunst -config ~/.config/dunst/dunstrc
exec --no-startup-id dispwin -d1 /usr/share/color/icc/Internal.icc
exec --no-startup-id dispwin -d2 /usr/share/color/icc/Samsung27.icc
exec --no-startup-id xiccd