diff --git a/PKGBUILD b/PKGBUILD index e4225ea..4d1eb8c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ pkgname=archcraft-openbox pkgver=1.0 -pkgrel=1 +pkgrel=2 pkgdesc="Openbox WM Configurations for Archcraft" url="https://github.com/archcraft-os/archcraft-openbox" arch=('any') diff --git a/files/polybar/adaptive/config.ini b/files/polybar/adaptive/config.ini index e6bfd5e..46af859 100644 --- a/files/polybar/adaptive/config.ini +++ b/files/polybar/adaptive/config.ini @@ -134,7 +134,7 @@ font-2 = "Iosevka Nerd Font:size=20;5" ; modules-right = ipc clock # Default -modules-left = sepL menu 1LD openbox 2LD cpu 3LD memory 4LD filesystem 5LD +modules-left = sepL menu 1LD openbox 2LD cpu 3LD used-memory 4LD filesystem 5LD modules-center = mpd modules-right = 2RD volume 3RD backlight 4RD battery 5RD network 6RD date 7RD sysmenu sepR # Alternate diff --git a/files/polybar/adaptive/launch.sh b/files/polybar/adaptive/launch.sh index 9971e80..d294d16 100755 --- a/files/polybar/adaptive/launch.sh +++ b/files/polybar/adaptive/launch.sh @@ -4,16 +4,20 @@ ## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -CARD="$(ls /sys/class/backlight | head -n 1)" +CARD="$(light -L | grep 'backlight' | head -n1 | cut -d'/' -f3)" +INTERFACE="$(ip link | awk '/state UP/ {print $2}' | tr -d :)" RFILE="$DIR/.module" -# Fix backlight module for non intel machines -backlight() { - if [[ "$CARD" != *"intel_"* ]]; then - if [[ ! -f "$RFILE" ]]; then - sed -i -e 's/backlight/brightness/g' "$DIR"/config.ini - touch "$RFILE" - fi +# Fix backlight and network modules +fix_modules() { + if [[ -z "$CARD" ]]; then + sed -i -e 's/backlight/bna/g' "$DIR"/config.ini + elif [[ "$CARD" != *"intel_"* ]]; then + sed -i -e 's/backlight/brightness/g' "$DIR"/config.ini + fi + + if [[ "$INTERFACE" == e* ]]; then + sed -i -e 's/network/ethernet/g' "$DIR"/config.ini fi } @@ -30,5 +34,8 @@ launch_bar() { } # Execute functions -backlight +if [[ ! -f "$RFILE" ]]; then + fix_modules + touch "$RFILE" +fi launch_bar diff --git a/files/polybar/adaptive/modules.ini b/files/polybar/adaptive/modules.ini index 380c3f6..25a3fb4 100644 --- a/files/polybar/adaptive/modules.ini +++ b/files/polybar/adaptive/modules.ini @@ -90,6 +90,17 @@ ramp-headphones-1 =  ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +[module/bna] +type = custom/text + +content = " NA" +content-prefix =  +content-prefix-font = 2 +content-prefix-foreground = ${color.RED} +content-background = ${color.BG2} + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + [module/backlight] type = internal/xbacklight @@ -449,6 +460,27 @@ label = " %mb_used%" ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +[module/used-memory] +type = custom/script + +exec = free -m | sed -n 's/^Mem:\s\+[0-9]\+\s\+\([0-9]\+\)\s.\+/\1/p' + +tail = true +interval = 5 + +format =