Explorar o código

add gruvchad theme

siduck76 %!s(int64=3) %!d(string=hai) anos
pai
achega
8992951c9e
Modificáronse 2 ficheiros con 79 adicións e 0 borrados
  1. 68 0
      .dwm/bars/gruvchad.sh
  2. 11 0
      chadwm/themes/gruvchad.h

+ 68 - 0
.dwm/bars/gruvchad.sh

@@ -0,0 +1,68 @@
+#!/bin/bash
+
+interval=0
+
+cpu() {
+  cpu_val=$(grep -o "^[^ ]*" /proc/loadavg)
+
+  printf "^c#222526^ ^b#89b482^ CPU"
+  printf "^c#c7b89d^ ^b#2b2e2f^ $cpu_val"
+}
+
+update_icon() {
+  printf "^c#89b482^ "
+}
+
+pkg_updates() {
+  updates=$(doas xbps-install -un | wc -l) # void
+  # updates=$(checkupdates | wc -l)   # arch , needs pacman contrib
+  # updates=$(aptitude search '~U' | wc -l)  # apt (ubuntu,debian etc)
+
+  if [ -z "$updates" ]; then
+    printf "^c#89b482^ Fully Updated"
+  else
+    printf "^c#89b482^ $updates"" updates"
+  fi
+}
+
+# battery
+batt() {
+  printf "^c#6f8faf^  "
+  printf "^c#6f8faf^ $(acpi | sed "s/,//g" | awk '{if ($3 == "Discharging"){print $4; exit} else {print $4""}}' | tr -d "\n")"
+}
+
+brightness() {
+
+  backlight() {
+    backlight="$(xbacklight -get)"
+    echo -e "$backlight"
+  }
+
+  printf "^c#ec6b64^   "
+  printf "^c#ec6b64^%.0f\n" $(backlight)
+}
+
+mem() {
+  printf "^c#7797b7^^b#222526^  "
+  printf "^c#7797b7^ $(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)"
+}
+
+wlan() {
+  case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
+  up) printf "^c#3b414d^ ^b#7681c5^ 󰤨 ^d^%s" " ^c#828dd1^Connected" ;;
+  down) printf "^c#3b414d^ ^b#7681c5^ 󰤭 ^d^%s" " ^c#828dd1^Disconnected" ;;
+  esac
+}
+
+clock() {
+  printf "^c#222526^ ^b#6080a0^ 󱑆 "
+  printf "^c#222526^^b#6f8faf^ $(date '+%a, %I:%M %p') "
+}
+
+while true; do
+
+  [ $interval == 0 ] || [ $(($interval % 3600)) == 0 ] && updates=$(pkg_updates)
+  interval=$((interval + 1))
+
+  sleep 1 && xsetroot -name "$(update_icon) $updates $(batt) $(brightness) $(cpu) $(mem) $(wlan) $(clock)"
+done

+ 11 - 0
chadwm/themes/gruvchad.h

@@ -0,0 +1,11 @@
+static const char black[]       = "#222526";
+static const char gray2[]       = "#3b3e3f"; // unfocused window border
+static const char gray3[]       = "#5d6061";
+static const char gray4[]       = "#6d8dad";
+static const char blue[]        = "#6f8faf";  // focused window border
+static const char green[]       = "#89b482";
+static const char red[]         = "#ec6b64";
+static const char orange[]      = "#d6b676";
+static const char yellow[]      = "#d1b171";
+static const char pink[]        = "#cc7f94";
+static const char col_borderbar[]  = "#222526"; // inner border