dotfiles/dot_config/polybar/scripts/executable_backlight.sh
punkfairie 90ca5ee74b
Update .config/packages/archgirlie
Add .config/polybar/colors.ini
Add .config/polybar/config.ini
Add .config/polybar/launch.sh
Add .config/polybar/scripts/backlight.sh
Add .config/polybar/scripts/launcher.sh
Add .config/polybar/scripts/player.sh
Add .config/polybar/scripts/powermenu.sh
Add .config/polybar/scripts/pywal.sh
Add .config/polybar/scripts/songname.sh
Add .config/polybar/scripts/wifi-menu.sh
Add .config/polybar/scripts/rofi/colors.rasi
Add .config/polybar/scripts/rofi/colors.rasi.backup
Add .config/polybar/scripts/rofi/confirm.rasi
Add .config/polybar/scripts/rofi/launcher.rasi
Add .config/polybar/scripts/rofi/message.rasi
Add .config/polybar/scripts/rofi/networkmenu.rasi
Add .config/polybar/scripts/rofi/powermenu.rasi
Add .config/polybar/scripts/rofi/styles.rasi
Add .config/polybar/scripts/scripts/checkupdates
Add .config/polybar/scripts/scripts/color-switch.sh
Add .config/polybar/scripts/scripts/colors-dark.sh
Add .config/polybar/scripts/scripts/colors-light.sh
Add .config/polybar/scripts/scripts/launcher.sh
Add .config/polybar/scripts/scripts/powermenu.sh
Add .config/polybar/scripts/scripts/pywal.sh
Add .config/polybar/scripts/scripts/random.sh
Add .config/polybar/scripts/scripts/updates.sh
Add .config/polybar/scripts/scripts/rofi/colors.rasi
Add .config/polybar/scripts/scripts/rofi/confirm.rasi
Add .config/polybar/scripts/scripts/rofi/launcher.rasi
Add .config/polybar/scripts/scripts/rofi/message.rasi
Add .config/polybar/scripts/scripts/rofi/networkmenu.rasi
Add .config/polybar/scripts/scripts/rofi/powermenu.rasi
Add .config/polybar/scripts/scripts/rofi/styles.rasi
2024-07-28 17:37:13 -07:00

30 lines
516 B
Bash

#!/bin/bash
device="intel_backlight"
current=$(brightnessctl -d "$device" g)
max=$(brightnessctl -d "$device" m)
current_value=$( echo "$current" | awk '{print $1}')
current_percent=$(( ($current_value * 100) / $max ))
function set() {
brightnessctl -d $device set $1%
}
case $1 in
up)
if [ $current_percent -le 100 ];then
new=$(($current_percent + 5))
set $new
fi
;;
down)
if [ $current_percent -ge 0 ];then
new=$(($current_percent - 5))
set $new
fi
;;
esac