Compare commits
5 Commits
903e66f1a1
...
925aa712da
Author | SHA1 | Date |
---|---|---|
Jean-Claude | 925aa712da | |
Jean-Claude | ff5b0a6983 | |
Jean-Claude | bf068844b1 | |
Jean-Claude | b5e270ff7f | |
Jean-Claude | 3f31b28814 |
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# Pass all events to our one handler script
|
||||
event=.*
|
||||
action=/etc/acpi/handler.sh %e
|
|
@ -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:
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue