Bläddra i källkod

Add files via upload

KlemensMaentele 3 år sedan
förälder
incheckning
10af3f6d5f
2 ändrade filer med 12 tillägg och 7 borttagningar
  1. 1 1
      scripts/autostart
  2. 11 6
      scripts/bar.sh

+ 1 - 1
scripts/autostart

@@ -9,5 +9,5 @@ xrdb merge ~/.Xresources &
 feh --bg-fill ~/Pictures/wall/gruvchad.png &
 
 # run bar script and dwm ( do not remove this )
-~/.config/chadwm/scripts/./bar.sh &
+bash ~/.config/chadwm/scripts/./bar.sh &
 dwm

+ 11 - 6
scripts/bar.sh

@@ -23,18 +23,23 @@ pkg_updates() {
 	if [ -z "$updates" ]; then
 		printf "^c$green^  Fully Updated"
 	else
-		printf "^c$green^  $updates"" updates"
+		printf "^c$red^  $updates"" updates"
 	fi
 }
 
 battery() {
-	get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)"
-	printf "^c$blue^   $get_capacity"
+	get_capacity="$(cat /sys/class/power_supply/BAT0/capacity)"
+	get_status="$(cat /sys/class/power_supply/BAT0/status)"
+	if [ $get_status == 'Discharging' ]; then
+		printf "^c$blue^  $get_capacity"
+	else
+		printf "^c$blue^  $get_capacity"
+	fi
 }
 
 brightness() {
-	printf "^c$red^   "
-	printf "^c$red^%.0f\n" $(cat /sys/class/backlight/*/brightness)
+	printf "^c$red^  "
+	printf "^c$red^%.0f\n" $(cat /sys/class/backlight/acpi_video0/brightness)
 }
 
 mem() {
@@ -59,5 +64,5 @@ while true; do
 	[ $interval = 0 ] || [ $(($interval % 3600)) = 0 ] && updates=$(pkg_updates)
 	interval=$((interval + 1))
 
-	sleep 1 && xsetroot -name "$updates $(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)"
+	sleep 1 && xsetroot -name "$(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)"
 done