diff --git a/modules/wm/hyprland/config/eww/eww.scss b/modules/wm/hyprland/config/eww/eww.scss index a36d952..fd3f5f5 100644 --- a/modules/wm/hyprland/config/eww/eww.scss +++ b/modules/wm/hyprland/config/eww/eww.scss @@ -8,14 +8,10 @@ border: 2px solid #80A0C0; } -.notes { - padding: 10px 20px 10px 5px; -} - window { background: #2e3440; color: #ebcb8b; - //border-radius: 2rem; + border-radius: 1rem; border: 3px solid #80A0C0; } @@ -68,21 +64,12 @@ window { color: #BF616A; } -.appbar{ - font-size: 2rem; -} - .cal { color: #8fbcbb; padding: 5px; padding-bottom: 1px; } -.favs { - color: #ECEFF4; - font-size: 2rem; -} - .small-date { font-weight: 700; } diff --git a/modules/wm/hyprland/config/eww/eww_variables.yuck b/modules/wm/hyprland/config/eww/eww_variables.yuck index a868abe..e0fadeb 100644 --- a/modules/wm/hyprland/config/eww/eww_variables.yuck +++ b/modules/wm/hyprland/config/eww/eww_variables.yuck @@ -1,8 +1,8 @@ -;;;; QUOTE +(defvar hostname "") -(defpoll quote_text :interval "3600s" `./scripts/quote.sh`) +(defpoll quote_text :interval "3600s" `fortune -n 90 -s`) -;;;; FETCH AND DATE +(defpoll gpu_load :interval "1s" `gpustat --json | jq '.gpus[]."utilization.gpu"'`) (defpoll host :initial-value "" @@ -17,15 +17,9 @@ "date +'%H:%M:%S'" ) -(defpoll TODAY :interval "1s" `date +%m/%d/%y`) -(defpoll distro :interval "12h" "awk '/^ID=/' /etc/*-release | awk -F'=' '{ print tolower($2) }'") -(defpoll de :interval "12h" "echo $XDG_CURRENT_DESKTOP") -(defpoll shell :interval "5m" "echo $SHELL | awk -F'/' '{print $NF}'") -(defpoll packages :interval "5m" "pacman -Q | wc -l") +(defpoll TODAY :interval "1s" `date +'%d %b %y'`) +(defpoll distro :interval "12h" `nixos-version | sed -r 's/^(.....).*?\\((.*?)\\)/NixOS \\1/'`) -;;;; NOTES, MUSIC, NETWORKING - -(defpoll NOTES :interval "1s" "cat -s ~/Documents/notes.txt") (defpoll music_current :interval "1s" "mpc current") (defpoll ssid :interval "1s" "iwgetid -r || echo 'Disconnected'") diff --git a/modules/wm/hyprland/config/eww/eww_widgets.yuck b/modules/wm/hyprland/config/eww/eww_widgets.yuck index 29f2840..c1b06fa 100644 --- a/modules/wm/hyprland/config/eww/eww_widgets.yuck +++ b/modules/wm/hyprland/config/eww/eww_widgets.yuck @@ -4,7 +4,7 @@ (include "/home/horseman/.config/eww/eww_variables.yuck") ;;;; Metric (cpu, ram, etc bars) constructor widget -(defwidget metric [label value onchange] +(defwidget metric [label value ?onchange] (box :orientation "h" :class "metric" :space-evenly false (box :class "label" label) (scale :min 0 :max 101 :active {onchange != ""} :value value :onchange onchange))) @@ -14,27 +14,12 @@ (defwidget bg [] (box :class "bg-box" :orientation "v" :space-evenly false)) - -;;;; Favorite App Locations - -(defwidget favorites[] - (box :class "favs" :orientation "v" :space-evenly false :halign "center" :valign "center" - (button :onclick "pcmanfm ~ &" "") - (button :onclick "pcmanfm ~/.config/ &" "漣") - (button :onclick "pcmanfm ~/Downloads &" "") - (button :onclick "pcmanfm ~/Pictures &" ""))) - -;;;; Small date in mm/dd/yy format - -(defwidget smalldate [] - (label :class "small-date" :valign "center" :halign "center" :text TODAY)) - ;;;; User information fetch widget (defwidget uinfo [] (box :class "uinfo" :orientation "v" :space-evenly false :halign "center" :valign "center" (label :style "color: #5e81ac;" :text {host} :halign "center" :valign "center" :wrap "false" :limit-width 25) - (label :style "color: #efefef;" :text "⎯⎯⎯⎯⎯⎯⎯⎯" :halign "center" :valign "center" :wrap "false" :limit-width 25) + (label :style "color: #efefef;" :text "─────────────" :halign "center" :valign "center" :wrap "false" :limit-width 25) ;; Tags for values (box :orientation "h" :space-evenly "false" :spacing 10 @@ -48,18 +33,21 @@ (box :orientation "v" :class "fetch" (label :style "color: #b48ead;" :halign "start" :text ": ${distro}") (label :style "color: #ebcb8b;" :halign "start" :text ": Hyprland") - (label :style "color: #80a0c0;" :halign "start" :text ": ${shell}") + (label :style "color: #80a0c0;" :halign "start" :text ": ${TODAY}") (label :style "color: #b48ead;" :halign "start" :text ": ${time}") )))) ;;;; System Information Widget -(defwidget sys[] +(defwidget sys [] (box :class "cpu" :orientation "v" :space-evenly false :halign "center" :valign "center" - (metric :label "﬙" :value {EWW_CPU.avg} :onchange "") - (metric :label "" :value {EWW_RAM.used_mem_perc} :onchange "") - (metric :label "龍" :value {(EWW_NET.wlan0.NET_UP)/100} :onchange "") - (metric :label "" :value {(EWW_DISK["/"].free / EWW_DISK["/"].total) * 100} :onchange ""))) + (box :space-evenly false (image :path "images/cpu.svg")(metric :label "" :value {EWW_CPU.avg}) ) + (box :space-evenly false (image :path "images/ram.svg")(metric :label "" :value {EWW_RAM.used_mem_perc}) ) + (box :space-evenly false (image :path "images/disk.svg")(metric :label "" :value {EWW_DISK["/"].used_perc}) ) + (box :space-evenly false :visible { hostname == "luna" } (image :path { EWW_BATTERY.BAT1.status == "Discharging" ? "images/battery.svg" : "images/charging.svg" })(metric :label "" :value {EWW_CPU.avg}) ) + (box :space-evenly false :visible { hostname == "terra" } (image :path "images/gpu.svg")(metric :label "" :value gpu_load) ) + ) +) ;;;; Random Quote Widget @@ -70,26 +58,18 @@ ;;;; QuickSettings widget (defwidget quicksettings [] (box :orientation "h" :space-evenly true :class "quicksettings" :spacing "10" :halign "center" :valign "center" - (button :onclick "playerctl previous &" (image :path "images/prev.svg" :width 32 :height 32)) - (button :onclick "playerctl play-pause &" (image :path "images/play.svg" :width 32 :height 32)) - (button :onclick "playerctl next &" (image :path "images/next.svg" :width 32 :height 32)))) + (button :onclick "playerctl previous &" (image :path "images/prev.svg")) + (button :onclick "playerctl play-pause &" (image :path "images/play.svg")) + (button :onclick "playerctl next &" (image :path "images/next.svg")))) ;;;; AppBar widget (defwidget appbar [] - (box :orientation "h" :space-evenly true :class "appbar" :spacing "5" :halign "center" :valign "center" - (button :style "color: #5e81ac;" :onclick "krita&" (image :path "images/krita.svg" :width 32 :height 32)) - (button :style "color: #81a1c1;" :onclick "firefox&" (image :path "images/firefox.svg" :width 32 :height 32)) - (button :style "color: #b48ead;" :onclick "vscodium&" (image :path "images/vscode.svg" :width 32 :height 32)) - (button :style "color: #bf616a;" :onclick "gimp&" (image :path "images/gimp.svg" :width 32 :height 32)))) - -;;;; TODO Notes Displaying widget - -(defwidget notes [] - (box :spacing 5 :class "notes" :orientation "v" :space-evenly false :halign "center" :valign "center" - (label :style "color: #5e81ac;" :text NOTES :halign "center" :valign "center" :wrap true :limit-width 150 :vexpand false :hexpand false) - (box :orientation "h" - (button :onclick "echo '' > ~/Documents/notes.txt" "[ Empty ]") - (button :onclick "pcmanfm ~/Documents/notes.txt" "[ Edit TODO ]")))) + (box :orientation "h" :space-evenly false :class "appbar" :spacing "10" :halign "center" :valign "center" + (button :onclick "firefox &" (image :path "images/firefox.svg")) + (button :onclick "kitty vim &" (image :path "images/vim.svg")) + (button :onclick "kitty &" (image :path "images/kitty.svg")) + ) +) ;;;; Rofi style search (defwidget searchapps [] diff --git a/modules/wm/hyprland/config/eww/eww_windows.yuck b/modules/wm/hyprland/config/eww/eww_windows.yuck index f5321fa..2707c78 100644 --- a/modules/wm/hyprland/config/eww/eww_windows.yuck +++ b/modules/wm/hyprland/config/eww/eww_windows.yuck @@ -65,36 +65,10 @@ :geometry (geometry :x "20" :y "335px" :width "170px" - :height "70px" + :height "74px" :anchor "top left") (appbar)) -;;;; Favorite Locations Window - -(defwindow favorites - :wm-ignore: true - :monitor 0 - :windowtype "dock" - :geometry (geometry :x "270px" - :y "415px" - :width "100px" - :height "160px" - :anchor "top left") -(favorites)) - -;;;; Small date Window - -(defwindow smalldate - :wm-ignore: true - :monitor 0 - :windowtype "dock" - :geometry (geometry :x "270px" - :y "580px" - :width "100px" - :height "39px" - :anchor "top left") -(smalldate)) - ;;;; Background Container Window (defwindow bg :class "bg" @@ -108,18 +82,6 @@ :anchor "top left") (bg)) -;;;; TODO Notes window -(defwindow notes - :wm-ignore: true - :monitor 0 - :windowtype "dock" - :geometry (geometry :x "20px" - :y "630px" - :width "350px" - :height "100px" - :anchor "top left") -(notes)) - ;;;; Searching Windows (defwindow searchapps diff --git a/modules/wm/hyprland/config/eww/images/battery.svg b/modules/wm/hyprland/config/eww/images/battery.svg new file mode 100644 index 0000000..57ef09f --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/battery.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/modules/wm/hyprland/config/eww/images/charging.svg b/modules/wm/hyprland/config/eww/images/charging.svg new file mode 100644 index 0000000..8132d9a --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/charging.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/modules/wm/hyprland/config/eww/images/cpu.svg b/modules/wm/hyprland/config/eww/images/cpu.svg new file mode 100644 index 0000000..8129356 --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/cpu.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/modules/wm/hyprland/config/eww/images/disk.svg b/modules/wm/hyprland/config/eww/images/disk.svg new file mode 100644 index 0000000..c12660a --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/disk.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/modules/wm/hyprland/config/eww/images/firefox.svg b/modules/wm/hyprland/config/eww/images/firefox.svg new file mode 100644 index 0000000..96287d7 --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/firefox.svg @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/wm/hyprland/config/eww/images/gpu.svg b/modules/wm/hyprland/config/eww/images/gpu.svg new file mode 100644 index 0000000..0889b0e --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/gpu.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/modules/wm/hyprland/config/eww/images/kitty.svg b/modules/wm/hyprland/config/eww/images/kitty.svg new file mode 100644 index 0000000..ba0088e --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/kitty.svg @@ -0,0 +1 @@ + diff --git a/modules/wm/hyprland/config/eww/images/ram.svg b/modules/wm/hyprland/config/eww/images/ram.svg new file mode 100644 index 0000000..ffdd637 --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/ram.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + diff --git a/modules/wm/hyprland/config/eww/images/vim.svg b/modules/wm/hyprland/config/eww/images/vim.svg new file mode 100644 index 0000000..fb226d9 --- /dev/null +++ b/modules/wm/hyprland/config/eww/images/vim.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/wm/hyprland/config/eww/scripts/open.sh b/modules/wm/hyprland/config/eww/scripts/open.sh index f32d050..ee3ea0a 100755 --- a/modules/wm/hyprland/config/eww/scripts/open.sh +++ b/modules/wm/hyprland/config/eww/scripts/open.sh @@ -1,3 +1,5 @@ #!/bin/sh -eww open-many --toggle notes quote smalldate quicksettings favorites appbar fetch sys +eww update hostname="$(hostname)" + +eww open-many --toggle quote quicksettings appbar fetch sys diff --git a/modules/wm/hyprland/config/hypr/keybinds.conf b/modules/wm/hyprland/config/hypr/keybinds.conf index 001ce92..efa68e1 100644 --- a/modules/wm/hyprland/config/hypr/keybinds.conf +++ b/modules/wm/hyprland/config/hypr/keybinds.conf @@ -1,8 +1,8 @@ $mainMod = SUPER $terminal = kitty -$launcher = wofi --show drun +$launcher = pkill wofi || wofi --show drun -bind = ALT, SPACE, exec, $launcher +bindr = SUPER, SUPER_L, exec, $launcher bind = ALT, Q, exec, $terminal diff --git a/modules/wm/hyprland/default.nix b/modules/wm/hyprland/default.nix index d7b890a..c11fde6 100644 --- a/modules/wm/hyprland/default.nix +++ b/modules/wm/hyprland/default.nix @@ -34,6 +34,7 @@ in { swaybg jq fortune + python312Packages.gpustat ]; services.logind.extraConfig = ''