From 02e6cfb1262d87e22b5cd3ff1173fa737b995810 Mon Sep 17 00:00:00 2001 From: ObeseTermite Date: Sat, 17 May 2025 18:55:34 -0700 Subject: [PATCH] changed volbright to work on new machine --- bin/volbright | 6 +++--- install | 2 +- installpackages.txt | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/volbright b/bin/volbright index a8c2615..8ce014f 100755 --- a/bin/volbright +++ b/bin/volbright @@ -21,7 +21,7 @@ function get_mute { # Uses regex to get brightness from xbacklight function get_brightness { - light | grep -Po '[0-9]{1,3}' | head -n 1 + printf "%.0f\n" $(bc -l <<< "$(brightnessctl g) / $(brightnessctl m)*100") } # Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume @@ -138,13 +138,13 @@ case $1 in brightness_up) # Increases brightness and displays the notification - light -A $brightness_step + brightnessctl s $(($(brightnessctl g)+1)) show_brightness_notif ;; brightness_down) # Decreases brightness and displays the notification - light -U $brightness_step + brightnessctl s $(($(brightnessctl g)-1)) show_brightness_notif ;; diff --git a/install b/install index 46e23e8..ed59dec 100755 --- a/install +++ b/install @@ -1,6 +1,6 @@ yay -Syu sudo pacman -S --needed --noconfirm - < installpackages.txt -yay -S light i3lock-color flat-remix-gtk --needed --noconfirm +yay -S i3lock-color flat-remix-gtk --needed --noconfirm mkdir -p ~/.config/i3 ln -sf ~/.dotfiles/i3config ~/.config/i3/config diff --git a/installpackages.txt b/installpackages.txt index 5054891..d256b05 100644 --- a/installpackages.txt +++ b/installpackages.txt @@ -28,3 +28,4 @@ rofi libqalculate rofi-calc xarchiver +brightnessctl