diff --git a/de/home/.config/eww/eww.yuck b/de/home/.config/eww/eww.yuck index 1a81b81..7083f8f 100644 --- a/de/home/.config/eww/eww.yuck +++ b/de/home/.config/eww/eww.yuck @@ -1,32 +1,9 @@ -(defwidget bar [] - (centerbox :orientation "h" - (leftgroup) - (centergroup) - (rightgroup))) +(deflisten workspacesArray :initial "${[1]}" + `~/.config/eww/scripts/getWorkspaces.sh`) -(defwidget leftgroup [] - (box :class "leftgroup" :orientation "h" :space-evenly false :halign "start" - (powermenu) - (profile) - (workspaces :array workspacesArray) - (windowtitle))) +(include "modules/bar.yuck") -(defwidget centergroup [] - (box :class "centergroup" :orientation "h" :space-evenly false :halign "start" - (music))) - -(defwidget rightgroup [] - (box :class "rightgroup" :orientation "h" :space-evenly false :halign "end" - (idleinhibit) - (volume) - (network) - (vpn) - (bluetooth) - (battery) - (sysdisk) - (sysmem) - (clock) - (tray))) +(include "modules/bar/workspaces.yuck") (deflisten workspacesArray :initial "${[1]}" `~/.config/eww/scripts/getWorkspaces.sh`) @@ -340,16 +317,7 @@ (defpoll time :interval "10s" "date '+%H:%M %b %d, %Y'") -(defwindow bar - :windowtype "dock" - :exclusive true - :geometry (geometry :x "0%" - :y "0%" - :width "100%" - :height "30px" - :anchor "top center") - :reserve (struts :side "top" :distance "4%") - (bar)) +(include "modules/bar.yuck") (defwidget widgets [] (box :class "widgets" @@ -380,7 +348,6 @@ :width 300 :height 125 :space-evenly true -; :spacing 20 "Eugene, OR | ${json.current_condition[0].weatherDesc[0].value}" "${json.current_condition[0].temp_F}°F (feels like ${json.current_condition[0].FeelsLikeF}°F)" "${json.weather[0].mintempF}°F / ${json.weather[0].maxtempF}°F" diff --git a/de/home/.config/eww/modules/bar.yuck b/de/home/.config/eww/modules/bar.yuck new file mode 100644 index 0000000..7f90842 --- /dev/null +++ b/de/home/.config/eww/modules/bar.yuck @@ -0,0 +1,29 @@ +(defwidget bar [] + (centerbox :orientation "h" + (leftgroup) + (centergroup) + (rightgroup))) + +(defwidget leftgroup [] + (box :class "leftgroup" :orientation "h" :space-evenly false :halign "start" + (powermenu) + (profile) + (workspaces :array workspacesArray) + (windowtitle))) + +(defwidget centergroup [] + (box :class "centergroup" :orientation "h" :space-evenly false :halign "start" + (music))) + +(defwidget rightgroup [] + (box :class "rightgroup" :orientation "h" :space-evenly false :halign "end" + (idleinhibit) + (volume) + (network) + (vpn) + (bluetooth) + (battery) + (sysdisk) + (sysmem) + (clock) + (tray))) diff --git a/de/home/.config/eww/modules/bar/workspaces.yuck b/de/home/.config/eww/modules/bar/workspaces.yuck new file mode 100644 index 0000000..54f95fa --- /dev/null +++ b/de/home/.config/eww/modules/bar/workspaces.yuck @@ -0,0 +1,10 @@ +(defwidget workspaces [array] +(box :class "workspaces" + :orientation "h" + :space-evenly true + :halign "start" + + (for entry in array + (button :onclick `swaymsg workspace "${entry.name}"` + :class {entry.focused ? "focused" : ""} + '${replace(entry.name,".*:","")}')))) diff --git a/t16g2/home/.config/sway/config.d/display.d/t16g2 b/t16g2/home/.config/sway/config.d/display.d/t16g2 index 069214b..37324f0 100644 --- a/t16g2/home/.config/sway/config.d/display.d/t16g2 +++ b/t16g2/home/.config/sway/config.d/display.d/t16g2 @@ -5,8 +5,8 @@ output eDP-1 { position 0 0 # bg $HOME/.config/sway/assets/wallpaper/eDP-1/_default.jpg fill } -exec_always sleep 1;eww open --screen "0x0A31" bar -exec_always sleep 1;eww open --screen "0x0A31" widgets +exec_always sleep 1;eww show --screen "0x0A31" bar +exec_always sleep 1;eww show --screen "0x0A31" widgets output DP-7 { scale 1