Dotfiles/desktopenvs/niri/eww/eww.yuck

94 lines
2.6 KiB
Plaintext

(defwindow bar [monitor]
:monitor monitor
:class "ewwbar"
:windowtype "dock"
:geometry (geometry :x "0%"
:y "1%"
:width "99%"
:height "20px"
:anchor "top center")
:exclusive true
(bar :monitor_ monitor))
(defwidget bar [monitor_]
(centerbox :orientation "h"
(winsworks :monitor monitor_)
(music)
(sidestuff)))
(defwidget winsworks [monitor]
(box :orientation "h" :space-evenly false :halign "start"
(workspaceWidget)
(button :onclick "~/.config/scripts/drawer.sh" :class "music" {" ${activewindow}"})
)
)
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(box :class "music" {"󰛳 ${IP}"})
(metric :label "󰓃"
:value volume
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"
:onclick "killall pavucontrol || pavucontrol")
(box
:tooltip {disks}
(metric :label ""
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange ""
:onclick ""))
(clock)
(systray :class "music" :orientation "h" :spacing 2 :space-evenly true)
))
(defwidget music []
(button :class "music"
:orientation "h"
:space-evenly false
:halign "center"
:onclick "~/.config/scripts/playpause.sh"
{music != "" ? " ${music}" : " None"}))
(defwidget metric [label value onchange onclick]
(box :orientation "h"
:class "metric"
:space-evenly false
(button :class "label" :onclick onclick label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
// Niri workspace widget — polls via niri IPC event-stream script
(deflisten workspace-niri "~/.config/scripts/workspace")
(defwidget workspaceWidget []
(eventbox
:onscroll "niri msg action $(echo {} | sed 's/up/focus-workspace-up/;s/down/focus-workspace-down/')"
(literal :content workspace-niri)))
(defpoll music :interval "0.5s"
"~/.config/scripts/playerget")
(defpoll activewindow :interval "0.5s"
"~/.config/scripts/activewindow")
(defpoll IP :interval "5s"
"~/.config/scripts/ip")
(defpoll volume :interval "0.5s"
"~/.config/scripts/getvol")
(defpoll time :interval "1s"
"date '+%H:%M:%S|%d.%m.%Y'")
(defwidget clock []
(box :class "clock"
:tooltip {calender}
(label :text {"${time}"})))
(defpoll calender :interval "600s"
"~/.config/scripts/calender-fix.sh")
(defpoll disks :interval "600s"
"~/.config/scripts/dysk-phydisks.sh")