Merge with Coded's config

As we're working on similar things, it makes sense to make a single
config with all our stuff together. We've named our coalition "chimera"
as Coded's devices are named after cat breeds and mine are named after
bird species. We'll be using NixOS options to enable us to have
different configurations anywhere we want that

Co-Authored-By: Samuel Shuert <coded@clicks.codes>
Change-Id: Idb102526d84e76edb0bfe7153bd18dfe8566516b
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/382
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/modules/home/eww/config/eww.scss b/modules/home/eww/config/eww.scss
index eae0b3c..ad16c17 100644
--- a/modules/home/eww/config/eww.scss
+++ b/modules/home/eww/config/eww.scss
@@ -1,61 +1,82 @@
 * {
     all: unset; //Unsets everything so you can style everything from scratch
-}
-
-.bar {
-    background-color: #ccd0da;
-    color: #4c4f69;
+  }
+  
+  $surface-color: #CCD0DA;
+  $contrast-color: #4C4F69;
+  $accent-color: #F27878;
+  
+  .bar {
+    background-color: $surface-color;
+    color: $contrast-color;
     border-radius: 10px;
-    padding: 10px 15px;
+    padding: 5px 15px;
     margin: 0 20px;
     margin-top: 20px;
-}
-
-// Styles on classes (see eww.yuck for more information)
-
-.sidestuff slider {
+  }
+  
+  // Styles on classes (see eww.yuck for more information)
+  
+  .sidestuff slider {
     all: unset;
-    color: #ffd5cd;
-}
-
-.metric scale trough highlight {
+    color: $surface-color;
+  }
+  
+  .radio button {
     all: unset;
-    background-color: #D35D6E;
-    color: #000000;
+    min-width: 25px;
+    min-height: 25px;
+    margin-right: 10px;
+    border-radius: 100%;
+  }
+  
+  .radio button.unblocked {
+    background-color: $accent-color;
+  }
+  
+  .radio button.blocked {
+    background-color: $contrast-color;
+  }
+  
+  .metric scale trough highlight {
+    all: unset;
+    background-color: $accent-color;
+    color: $contrast-color;
     border-radius: 10px;
-}
-
-.metric scale trough {
+  }
+  
+  .metric scale trough {
     all: unset;
-    background-color: #4e4e4e;
+    background-color: $contrast-color;
     border-radius: 50px;
     min-height: 3px;
     min-width: 50px;
     margin-left: 10px;
     margin-right: 20px;
-}
-
-.metric scale trough highlight {
+  }
+  
+  .metric scale trough highlight {
     all: unset;
-    background-color: #D35D6E;
-    color: #000000;
+    background-color: $accent-color;
+    color: $contrast-color;
     border-radius: 10px;
-}
-
-.metric scale trough {
+  }
+  
+  .metric scale trough {
     all: unset;
-    background-color: #4e4e4e;
+    background-color: $contrast-color;
     border-radius: 50px;
     min-height: 3px;
     min-width: 50px;
     margin-left: 10px;
     margin-right: 20px;
-}
-
-.label-ram {
+  }
+  
+  .label-ram {
     font-size: large;
-}
-
-.workspaces button:hover {
-    color: #D35D6E;
-}
\ No newline at end of file
+  }
+  
+  .workspaces button:hover {
+    color: $accent-color;
+  }
+  
\ No newline at end of file
diff --git a/modules/home/eww/config/eww.yuck b/modules/home/eww/config/eww.yuck
index 598646e..a7695ac 100644
--- a/modules/home/eww/config/eww.yuck
+++ b/modules/home/eww/config/eww.yuck
@@ -9,14 +9,38 @@
   (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
     (metric :label "🔊"
       :value volume
-    :onchange "amixer -D pulse sset Master {}%")
-    (metric :label "īĄš"
+    :onchange "nix run nixpkgs#pamixer -- --set-volume {}")
+    (radio)
+    (sysinfo)
+  time))
+
+(defwidget radio []
+  (box :class "radio" :orientation "h" :space-evenly false :halign "end"
+    (button :class bluetooth 
+      :onclick { bluetooth == "inactive" ? "bluetoothctl power on" : "bluetoothctl power off"}
+      "īŠ“")
+    (button :class wifi 
+      :onclick { wifi == "disabled" ? "nmcli radio wifi on" : "nmcli radio wifi off"}
+      "🛜")
+  )
+)
+
+(defwidget sysinfo []
+  (box :class "sysinfo"
+    ; (metric :label { battery_status == "Normal" ? "🔋" : "đŸĒĢ" }
+    ;   :value battery_cap
+    ; :onchange "")
+    (metric :label "🐏"
       :value {EWW_RAM.used_mem_perc}
     :onchange "")
     (metric :label "💾"
       :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
     :onchange "")
-  time))
+    (metric :label "🕓"
+      :value cpu_usage_percent
+    :onchange "")
+  )
+)
 
 (defwidget workspaces []
   (box :class "workspaces"
@@ -24,21 +48,24 @@
     :space-evenly true
     :halign "start"
     :spacing 10
-    (button :onclick "wmctrl -s 0" 1)
-    (button :onclick "wmctrl -s 1" 2)
-    (button :onclick "wmctrl -s 2" 3)
-    (button :onclick "wmctrl -s 3" 4)
-    (button :onclick "wmctrl -s 4" 5)
-    (button :onclick "wmctrl -s 5" 6)
-    (button :onclick "wmctrl -s 6" 7)
-    (button :onclick "wmctrl -s 7" 8)
-    (button :onclick "wmctrl -s 8" 9)))
+    (button :onclick "hyprctl dispatch workspace 1" 1)
+    (button :onclick "hyprctl dispatch workspace 2" 2)
+    (button :onclick "hyprctl dispatch workspace 3" 3)
+    (button :onclick "hyprctl dispatch workspace 4" 4)
+    (button :onclick "hyprctl dispatch workspace 5" 5)
+    (button :onclick "hyprctl dispatch workspace 6" 6)
+    (button :onclick "hyprctl dispatch workspace 7" 7)
+    (button :onclick "hyprctl dispatch workspace 8" 8)
+    (button :onclick "hyprctl dispatch workspace 9" 9)
+    (button :onclick "hyprctl dispatch workspace 0" 0)
+  ))
 
 (defwidget music []
   (box :class "music"
     :orientation "h"
     :space-evenly false
     :halign "center"
+    :onclick ""
   {music != "" ? "đŸŽĩ${music}" : ""}))
 
 
@@ -53,18 +80,34 @@
       :value value
     :onchange onchange)))
 
-
-
 (deflisten music :initial ""
-"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
+"nix run nixpkgs#playerctl -- --follow metadata --format '{{ title }}' || true")
+
+(defpoll bluetooth :interval "1s"
+"rfkill -o TYPE,SOFT list -n | grep bluetooth | sed -E 's/bluetooth\s+//g'")
+
+(defpoll wifi :interval "1s"
+"rfkill -o TYPE,SOFT list -n | grep wlan | sed -E 's/wlan\s+//g'")
 
 (defpoll volume :interval "1s"
-"scripts/getvol")
+"nix run nixpkgs#pamixer -- --get-volume")
 
-(defpoll time :interval "10s"
-"date '+%H:%M %b %d, %Y'")
+(defpoll battery_cap :interval "5m"
+"cat /sys/class/power_supply/BAT*/capacity"
+)
 
-(defwindow bar-eDP1
+(defpoll battery_status :interval "1s"
+"cat /sys/class/power_supply/BAT*/status"
+)
+
+(defpoll cpu_usage_percent :interval "5s"
+"bash scripts/cpu_usage"
+)
+
+(defpoll time :interval "1s"
+"date '+%H:%M:%S  %b %d, %Y'")
+
+(defwindow bar-primary
   :monitor 0
   :windowtype "dock"
   :geometry (geometry :x "0%"
@@ -74,25 +117,3 @@
   :anchor "top center")
   :exclusive true
   (bar))
-
-(defwindow bar-HDMI-A-1
-  :monitor 0
-  :windowtype "dock"
-  :geometry (geometry :x "0%"
-    :y "0%"
-    :width "100%"
-    :height "10px"
-  :anchor "top center")
-  :exclusive true
-  (bar))
-
-(defwindow bar-DP7
-  :monitor 0
-  :windowtype "dock"
-  :geometry (geometry :x "0%"
-    :y "0%"
-    :width "100%"
-    :height "10px"
-  :anchor "top center")
-  :exclusive true
-  (bar))
\ No newline at end of file
diff --git a/modules/home/eww/config/scripts/cpu_usage b/modules/home/eww/config/scripts/cpu_usage
new file mode 100644
index 0000000..62d9af7
--- /dev/null
+++ b/modules/home/eww/config/scripts/cpu_usage
@@ -0,0 +1,7 @@
+CPU=$(sed -n 's/^cpu\s//p' /proc/stat);
+TOTAL=$(($(T=0; for VAL in $CPU; do T=($((T))+$((VAL))); done; echo $T)));
+IDLE=${CPU[4]};
+IDLE_FRAC=$(echo $(($IDLE.00/$TOTAL)));
+IN_USE=$(echo $(( 1.00 - $IDLE_FRAC )));
+NUM=$(( $IN_USE * 100 ));
+echo $NUM
\ No newline at end of file
diff --git a/modules/home/eww/default.nix b/modules/home/eww/default.nix
index 2159bfe..b9a60be 100644
--- a/modules/home/eww/default.nix
+++ b/modules/home/eww/default.nix
@@ -1,7 +1,20 @@
-{ inputs, pkgs, ... }: {
+{ inputs, pkgs, ... }:
+{
   programs.eww = {
     enable = true;
     package = pkgs.eww-wayland;
     configDir = ./config;
   };
-}
\ No newline at end of file
+
+  /* bluetoothctl
+     wpa_cli
+     pamixer
+     rfkill -> util-linux
+     cat
+     bash
+     date
+  */
+  # wpa_cli disable_network
+
+  # $RUN_wpa_cli
+}