From 448bdfc23171eb04e4b76a058282272b0d1469d9 Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sun, 22 Jun 2025 13:32:57 -0400 Subject: [PATCH] Customize Framework docked bars --- eww/eww.yuck | 70 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/eww/eww.yuck b/eww/eww.yuck index 05b2063..90a9884 100644 --- a/eww/eww.yuck +++ b/eww/eww.yuck @@ -59,16 +59,10 @@ (tooltip (graph :value {interfaces?.[interface]?.combined_raw ?: 0} :thickness 2 :time-range 60000 :dynamic true :line-style "round" :width 60 :height 20) (label_value :text label :value {(interfaces?.[interface]?.up ?: false) ? (combined_interface ? interfaces?.[interface]?.combined : "󰶡${interfaces?.[interface]?.rx} 󰶣${interfaces?.[interface]?.tx}") : "dc"} :value_class {(interfaces?.[interface]?.up ?: false) ? "" : "disabled"})))) -(defwidget eth [] - (network_speed :label "󰈀" :interface "enp6s0")) -(defwidget wlan [] - (network_speed :label "" - {% if host.name == "chonk" %} - :interface "wlo1" - {% else %} - :interface "wlp1s0" - {% endif %} - )) +(defwidget eth [interface] + (network_speed :label "󰈀" :interface {interface})) +(defwidget wlan [interface] + (network_speed :label "" :interface {interface})) (defwidget date [] (tooltip @@ -123,6 +117,9 @@ (clicker :text "󰸉" :command "~/.config/eww/scripts/wallpaper-shell")) (defwidget sunset [] (clicker :text "" :command "python -OO ~/scripts/sunset.py")) +(defvar docked false) +(defwidget docked [] + (clicker :text {docked ? "󰌢" : "󰛧"} :command "${EWW_CMD} update docked=${!docked} ; hyprctl keyword monitor eDP-1,${docked ? "" : "disabled"}")) (defpoll brightness :interval 60 "~/.config/eww/scripts/backlight get") @@ -159,11 +156,13 @@ (box :class "right" :orientation "h" :space-evenly false :halign "end" (volume)(sep) (audio_source)(space) - (audio_sink)))) + (audio_sink)(sep) + (datetime)))) (defwidget right_bar [] (centerbox :class "bar" :orientation "h" (box :class "left" :orientation "h" :space-evenly false :halign "begin" - (workspaces :monitor "DP-1")) + (workspaces :monitor "DP-1")(sep :class "no-left-pad") + (window)) (systray :pack_direction "ltr" :icon-size 20) (box :class "right" :orientation "h" :space-evenly false :halign "end" (gametime)(space) @@ -174,29 +173,58 @@ (mountpoint :label "󰋊" :mount "/home/mbradley/hdd")(sep) (ram)(space) (cpu)(sep) - (eth)(sep) + ;(wlan :interface "wlo1")(space) + (eth :interface "enp6s0")(sep) (datetime)(sep) (power)))) (defwidget laptop_bar [] (centerbox :class "bar" :orientation "h" (box :class "left" :orientation "h" :space-evenly false :halign "begin" - (workspaces :monitor "eDP-1" :all true)(sep) + (workspaces :monitor "eDP-1" :all true)(sep :class "no-left-pad") (window)) (systray :pack_direction "ltr" :icon-size 20) (box :class "right" :orientation "h" :space-evenly false :halign "end" (weather)(sep) ;(colour_selector)(space) (sunset)(space) - (wallpaper)(sep) + (wallpaper)(space) + (docked)(sep) (ram)(space) (cpu)(sep) - (wlan)(space) + (wlan :interface "wlp1s0")(space) (battery)(sep) (brightness)(space) (volume)(sep) (datetime)(sep) (power)))) +(defwidget laptop_left_bar [] + (centerbox :class "bar" :orientation "h" + (box :class "left" :orientation "h" :space-evenly false :halign "begin" + (workspaces :monitor "DP-3" :all true)(sep :class "no-left-pad") + (window)) + (box) + (box :class "right" :orientation "h" :space-evenly false :halign "end" + (volume)(sep) + (datetime)))) +(defwidget laptop_right_bar [] + (centerbox :class "bar" :orientation "h" + (box :class "left" :orientation "h" :space-evenly false :halign "begin" + (workspaces :monitor "DP-2" :all true)(sep :class "no-left-pad") + (window)) + (systray :pack_direction "ltr" :icon-size 20) + (box :class "right" :orientation "h" :space-evenly false :halign "end" + (weather)(sep) + (sunset)(space) + (wallpaper)(space) + (docked)(sep) + (ram)(space) + (cpu)(sep) + (eth :interface "enp193s0f3u2")(space) + (battery)(sep) + (volume)(sep) + (datetime)(sep) + (power)))) (defwindow left @@ -224,7 +252,7 @@ (right_bar)) (defwindow laptop - :monitor 0 + :monitor "eDP-1" :geometry (geometry :x "0px" :y "4px" :width "1912px" @@ -235,7 +263,7 @@ :focusable false (laptop_bar)) (defwindow laptop_left - :monitor 1 + :monitor "DP-3" :geometry (geometry :x "0px" :y "4px" :width "2552px" @@ -244,9 +272,9 @@ :stacking "fg" :exclusive true :focusable false - (laptop_bar)) + (laptop_left_bar)) (defwindow laptop_right - :monitor 2 + :monitor "DP-2" :geometry (geometry :x "0px" :y "4px" :width "2552px" @@ -255,4 +283,4 @@ :stacking "fg" :exclusive true :focusable false - (laptop_bar)) + (laptop_right_bar))