diff options
| author | Caroline Larimore <caroline@larimo.re> | 2024-09-17 21:37:33 -0700 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2024-09-17 21:37:33 -0700 |
| commit | 6bc6e37af5b21b0356d0e008f83eee5378fc8b43 (patch) | |
| tree | 0fd4e2fdf9ddd1937b3a02de57d11e4ff1ade6fc /roles/home/desktop/eww/panels/bar.yuck | |
| parent | 485dc4b641f6b07def1bfa28c7c3ab83e764f29e (diff) | |
home: desktop: update eww widgets
Diffstat (limited to 'roles/home/desktop/eww/panels/bar.yuck')
| -rw-r--r-- | roles/home/desktop/eww/panels/bar.yuck | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/roles/home/desktop/eww/panels/bar.yuck b/roles/home/desktop/eww/panels/bar.yuck new file mode 100644 index 0000000..6dc4771 --- /dev/null +++ b/roles/home/desktop/eww/panels/bar.yuck @@ -0,0 +1,102 @@ +(defwidget bar [] + (centerbox :class "bar" + :orientation "h" + + (box + :orientation "h" + :spacing 8 + :space-evenly false + + (tooltip :class "panel" + {EWW_TIME} + {formattime(EWW_TIME, "%T", "America/Los_Angeles")} + ) + + (tooltip :class "panel" + {formattime(EWW_TIME, "%F", "America/Los_Angeles")} + {formattime(EWW_TIME, "%A, %B %d, %Y", "America/Los_Angeles")} + ) + ) + + (box + :orientation "h" + :spacing 8 + :space-evenly false + + ;(label :class "panel" + ; :text "i have no idea what to put here :3" + ;) + + (box :class "unpadded panel" + (ws :num 0 :icon "" :name "Main") + (ws :num 1 :icon "" :name "Terminal") + (ws :num 2 :icon "" :name "Browser") + (ws :num 3 :icon "" :name "Chat") + (ws :num 4 :icon "" :name "Gaming") + (ws :num 5 :icon "" :name "5") + (ws :num 6 :icon "" :name "6") + (ws :num 7 :icon "" :name "7") + (ws :num 8 :icon "" :name "Meow") + (ws :num 9 :icon "" :name "Music") + (ws :num 10 :icon "" :name "Misc") + ) + ) + + (box + :orientation "h" + :spacing 8 + :space-evenly false + :halign "end" + + (box :class "unpadded panel" + :space-evenly false + (button :class "sleep icon" + :width 31 + "" + ) + + (button :class "restart icon" + :width 33 + "" + ) + + (button :class "shutdown icon" + :width 31 + "" + ) + ) + + (box :class "unpadded panel" + (button :class "dismiss icon" + :width 29 + :onclick `${EWW_CMD} close sys` + "" + ) + ) + ) + ) +) + +(defwidget ws [num icon name] + (tooltip {name} + (button :class {"ws" + + (ws-status[num].active ? " active" : "") + + (ws-status[num].visible ? " visible" : "") + + (ws-status[num].focused ? " focused" : "") + + (ws-status[num].urgent ? " urgent" : "") + } + :width { + num == 0 ? 31 : + num == 10 ? 31 : + 33 + } + + {icon} + ) + ) +) + +(defpoll ws-status + :interval "0.1s" + `i3-msg -t get_workspaces | jq -caM 'map({"ws-\\(.num)": {visible, focused, urgent, active: true}}) | add as $orig | [range(0;11)] | [.[] as $i | $orig."ws-\\($i)" // {visible: false, focused: false, urgent: false, active: false}]'` +) |