2024-05-29 16:24:43 +02:00
|
|
|
(deflisten batterystatus
|
|
|
|
:initial "unknown"
|
2024-06-10 08:33:20 +02:00
|
|
|
"listen/battery BAT0"
|
2024-03-05 10:53:32 +01:00
|
|
|
)
|
|
|
|
|
2024-05-29 16:24:43 +02:00
|
|
|
(deflisten workspaces
|
|
|
|
:initial '{"current":1,"used":[1]}'
|
|
|
|
"listen/hypr workspace"
|
|
|
|
)
|
|
|
|
|
|
|
|
(deflisten windowtitle
|
|
|
|
:initial ''
|
|
|
|
"listen/hypr activewindow"
|
|
|
|
)
|
|
|
|
|
|
|
|
(deflisten submap
|
|
|
|
:initial ''
|
|
|
|
"listen/hypr submap"
|
|
|
|
)
|
|
|
|
|
|
|
|
(deflisten network
|
2024-05-30 15:17:59 +02:00
|
|
|
:initial '{"state":"disconnect"}'
|
2024-05-29 16:24:43 +02:00
|
|
|
"listen/network"
|
|
|
|
)
|
|
|
|
|
2024-05-30 15:18:21 +02:00
|
|
|
(deflisten notifications
|
2024-05-31 14:51:23 +02:00
|
|
|
:initial '{"count":0}'
|
2024-05-30 15:18:21 +02:00
|
|
|
"swaync-client --subscribe"
|
|
|
|
)
|
|
|
|
|
2024-05-31 14:52:08 +02:00
|
|
|
(deflisten sound
|
|
|
|
:initial '{"output-volume":0,"input-volume":0,"output-muted":false}'
|
|
|
|
"listen/sound"
|
|
|
|
)
|
|
|
|
|
2024-05-29 16:24:43 +02:00
|
|
|
(defvar battery-icon '{
|
|
|
|
"unknown": "",
|
|
|
|
"critical": "",
|
|
|
|
"low": "",
|
|
|
|
"medium": "",
|
|
|
|
"high": "",
|
|
|
|
"full": ""
|
|
|
|
}')
|
|
|
|
|
|
|
|
(defvar network-icon '{
|
|
|
|
"disconnected": "",
|
|
|
|
"ethernet": "",
|
|
|
|
"wifi-terrible": "",
|
|
|
|
"wifi-bad": "",
|
|
|
|
"wifi-mediocre": "",
|
|
|
|
"wifi-good": "",
|
|
|
|
"wifi-excellent": "",
|
|
|
|
"tethering": ""
|
|
|
|
}')
|
|
|
|
|
2024-05-30 15:18:21 +02:00
|
|
|
(defvar notifications-icon '{
|
|
|
|
"nothing": "",
|
|
|
|
"new": "",
|
|
|
|
"dnd": ""
|
|
|
|
}')
|
|
|
|
|
2024-05-31 14:52:08 +02:00
|
|
|
(defvar sound-icon '{
|
|
|
|
"absent": "",
|
|
|
|
"moderate": "",
|
|
|
|
"loud": "",
|
2024-06-10 08:33:55 +02:00
|
|
|
"muted": ""
|
2024-05-31 14:52:08 +02:00
|
|
|
}')
|
|
|
|
|
2024-05-29 16:24:43 +02:00
|
|
|
(defwidget workspaces []
|
2024-05-30 15:19:07 +02:00
|
|
|
(eventbox :onscroll 'action/hyprland/nearby-workspace "{}"'
|
2024-05-29 16:24:43 +02:00
|
|
|
(box :class "workspaces"
|
|
|
|
(for workspace in {workspaces.used}
|
|
|
|
(eventbox
|
|
|
|
:class "workspace-button ${workspace == workspaces.current ? "workspace-current" : ""}"
|
2024-05-30 15:19:07 +02:00
|
|
|
:onclick 'hyprctl dispatch workspace "${workspace}"'
|
2024-05-29 16:24:43 +02:00
|
|
|
(box :width 25 "${workspace}")
|
2024-03-05 10:53:32 +01:00
|
|
|
)
|
2024-05-29 16:24:43 +02:00
|
|
|
)
|
2024-03-05 10:53:32 +01:00
|
|
|
)
|
2024-05-29 16:24:43 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defwidget submap []
|
|
|
|
(eventbox :onclick "hyprctl dispatch submap reset"
|
|
|
|
(box :class "submap" "${submap}")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defwidget window-title []
|
|
|
|
(box "${windowtitle ?: ''}")
|
|
|
|
)
|
|
|
|
|
2024-06-10 08:37:36 +02:00
|
|
|
(defwidget tray [] (box (systray
|
|
|
|
:icon-size 15
|
|
|
|
:spacing 10
|
|
|
|
)))
|
2024-05-29 16:24:43 +02:00
|
|
|
|
|
|
|
(defwidget time []
|
2024-05-31 14:52:59 +02:00
|
|
|
(box (eventbox
|
|
|
|
:onclick 'eww open --toggle calendar'
|
|
|
|
|
|
|
|
"${formattime(EWW_TIME, "%Y-%m-%d")} ${formattime(EWW_TIME, "%H:%M:%S")}"
|
|
|
|
))
|
2024-05-29 16:24:43 +02:00
|
|
|
)
|
|
|
|
|
2024-05-30 15:18:21 +02:00
|
|
|
(defwidget notifications []
|
|
|
|
(box (eventbox
|
|
|
|
:class "module"
|
|
|
|
:onclick 'swaync-client --toggle-panel'
|
|
|
|
:onrightclick 'swaync-client --toggle-dnd'
|
2024-05-31 14:55:01 +02:00
|
|
|
:onmiddleclick 'swaync-client --close-all'
|
2024-05-30 15:18:21 +02:00
|
|
|
|
|
|
|
"${
|
|
|
|
notifications.dnd == true
|
|
|
|
? notifications-icon["dnd"]
|
|
|
|
: notifications.count > 0
|
|
|
|
? notifications-icon["new"]
|
|
|
|
: notifications-icon["nothing"]
|
2024-05-31 14:51:23 +02:00
|
|
|
} ${notifications.count}"
|
2024-05-30 15:18:21 +02:00
|
|
|
))
|
|
|
|
)
|
|
|
|
|
2024-05-31 14:52:08 +02:00
|
|
|
(defwidget sound []
|
|
|
|
(box (eventbox
|
|
|
|
:onscroll 'action/volume "{}"'
|
2024-06-10 08:39:08 +02:00
|
|
|
:onclick 'hyprctl dispatch exec pavucontrol'
|
2024-05-31 14:52:08 +02:00
|
|
|
|
|
|
|
"${
|
|
|
|
sound.output-muted == true ? sound-icon["muted"] :
|
|
|
|
sound.output-volume < 33 ? sound-icon["absent"] :
|
|
|
|
sound.output-volume < 67 ? sound-icon["moderate"] :
|
|
|
|
sound-icon["loud"]
|
|
|
|
} ${sound.output-volume} %"
|
|
|
|
))
|
|
|
|
)
|
2024-05-30 15:18:21 +02:00
|
|
|
|
2024-05-29 16:24:43 +02:00
|
|
|
(defwidget network []
|
2024-05-30 15:17:59 +02:00
|
|
|
"${
|
|
|
|
network.state == "wireless"
|
|
|
|
? network-icon["wifi-${network.wifi.signal}"]
|
|
|
|
: network-icon[network.state]
|
2024-05-31 14:55:54 +02:00
|
|
|
} ${
|
2024-05-30 15:17:59 +02:00
|
|
|
network.state == "disconnected"
|
|
|
|
? "no network" :
|
|
|
|
network.state == "ethernet"
|
|
|
|
? "wired" :
|
|
|
|
network.state == "wireless"
|
|
|
|
? network.wifi.ssid : ''
|
|
|
|
}"
|
2024-05-29 16:24:43 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
(defwidget battery []
|
2024-06-10 08:33:20 +02:00
|
|
|
"${battery-icon[batterystatus]}${EWW_BATTERY.BAT0.status == "Charging" ? " " : ""} ${EWW_BATTERY.BAT0.capacity} %"
|
2024-03-05 10:53:32 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
(defwindow bar
|
2024-05-29 16:24:43 +02:00
|
|
|
:monitor 0
|
|
|
|
:geometry (geometry
|
|
|
|
:anchor "bottom center"
|
|
|
|
:width "100%"
|
|
|
|
:height 25
|
|
|
|
)
|
|
|
|
:exclusive true
|
|
|
|
|
|
|
|
(centerbox
|
|
|
|
(box
|
|
|
|
:halign "start"
|
|
|
|
:space-evenly false
|
|
|
|
:class "left"
|
|
|
|
|
|
|
|
(workspaces)
|
|
|
|
(submap)
|
|
|
|
(window-title)
|
2024-03-05 10:53:32 +01:00
|
|
|
)
|
2024-05-29 16:24:43 +02:00
|
|
|
(box
|
|
|
|
:space-evenly false
|
|
|
|
:class "middle"
|
|
|
|
|
2024-05-30 15:18:21 +02:00
|
|
|
(tray)
|
|
|
|
(time)
|
|
|
|
(notifications)
|
2024-05-29 16:24:43 +02:00
|
|
|
)
|
|
|
|
(box
|
|
|
|
:halign "end"
|
|
|
|
:space-evenly false
|
|
|
|
:class "right"
|
|
|
|
|
2024-05-31 14:52:08 +02:00
|
|
|
(sound)
|
2024-05-29 16:24:43 +02:00
|
|
|
(network)
|
|
|
|
(battery)
|
2024-03-05 10:53:32 +01:00
|
|
|
)
|
2024-05-29 16:24:43 +02:00
|
|
|
)
|
2024-03-05 10:53:32 +01:00
|
|
|
)
|
2024-05-31 14:52:59 +02:00
|
|
|
|
|
|
|
(defwindow calendar
|
|
|
|
:monitor 0
|
|
|
|
:geometry (geometry
|
|
|
|
:anchor "bottom center"
|
|
|
|
:width "350px"
|
|
|
|
:height "200px"
|
|
|
|
)
|
|
|
|
:exclusive false
|
|
|
|
; :stacking "fg"
|
|
|
|
|
|
|
|
(calendar)
|
|
|
|
)
|