(defwindow bar [monitor] :monitor monitor :class "ewwbar" :windowtype "dock" :geometry (geometry :x "0%" :y "1%" :width "99%" :height "60px" :anchor "top center") :exclusive true (bar :monitor_ monitor)) (defpoll battery :interval "2s" "~/.config/scripts/batteryperc") (defwidget bar [monitor_] (centerbox :orientation "h" (winsworks :monitor monitor_) (screenrotate ) (sidestuff))) (defwidget winsworks [monitor] (box :orientation "h" :space-evenly false :halign "start" (osk) (box :class "music" {"${battery}"}) (button :class "music menu-launcher" :onclick "~/.config/scripts/menu-toggle.sh toggle top" {""}) (button :class "orbit-launcher" :onclick "~/.config/scripts/orbit-menu.sh menu" {"󰀘"}) (metric :label "󰓃 " :value volume :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%" :onclick "killall pavucontrol || hyprctl dispatch exec \[tag +mixer\] pavucontrol") ) ) (defwidget sidestuff [] (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" (caffeine) (clock) (systray :class "music" :orientation "h" :spacing 2 :space-evenly true) )) (defwidget screenrotate [] (box :orientation "h" :space-evenly false :halign "center" (button :class "icon-btn" :valign "center" :width 26 :height 26 :orientation "h" :space-evenly false :halign "center" :onclick "~/.config/scripts/workspacefocus/focusleft.sh" {""} ) (button :class "icon-btn" :valign "center" :width 26 :height 26 :orientation "h" :space-evenly false :halign "center" :onclick "~/.config/scripts/screenrotationacw.sh" {"󱞧"} ) (button :class "icon-btn" :valign "center" :width 26 :height 26 :orientation "h" :space-evenly false :halign "center" :onclick "hyprctl dispatch 'hl.dsp.window.close()'" {""} ) (button :class "icon-btn" :valign "center" :width 26 :height 26 :orientation "h" :space-evenly false :halign "center" :onclick "~/.config/scripts/screenrotationwcw.sh" {"󱞫"} ) (button :class "icon-btn" :valign "center" :width 26 :height 26 :orientation "h" :space-evenly false :halign "center" :onclick "~/.config/scripts/workspacefocus/focusright.sh" {""} ) )) (defwidget music [] (button :class "music" :orientation "h" :space-evenly false :halign "center" :onclick "~/Dotfiles/desktopenvs/hyprland/scripts/playpause.sh" {music != "" ? " ${music}" : " None"})) (defwidget osk [] (button :class "icon-btn" :valign "center" :width 26 :height 26 :orientation "h" :space-evenly false :halign "center" :onclick "~/.config/scripts/onscreenkb.sh" {"󰌌"} ) ) (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))) (deflisten workspaces "hyprland-workspaces _") (defwidget workspaceWidget [monitor] (eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1" (box :class "workspaces" :space-evenly false :width 20 (for i in {workspaces[monitor].workspaces} (button :width 20 :onclick "hyprctl dispatch workspace ${i.id}" :class "${i.class}" {i.name == "special:magic" ? "󱂬" : "󱂬${i.name}"}))))) (deflisten workspace-old "~/Dotfiles/desktopenvs/hyprland/scripts/workspace") (defwidget workspaces-old [] (literal :content workspace-old)) (defpoll music :interval "0.5s" "~/Dotfiles/desktopenvs/hyprland/scripts/playerget") (defpoll activewindow :interval "0.5s" "~/Dotfiles/desktopenvs/hyprland/scripts/activewindow") (defpoll IP :interval "5s" "~/Dotfiles/desktopenvs/hyprland/scripts/ip") (defpoll volume :interval "0.5s" "~/Dotfiles/desktopenvs/hyprland/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" "~/Dotfiles/desktopenvs/hyprland/scripts/calender-fix.sh") ; caffeine-manual poll — true only when a MANUAL caffeine toggle holds the shared ; idle lock (i.e. the lock is held but the presence daemon does not own it). (defpoll caffeine-manual :interval "2s" "~/Dotfiles/desktopenvs/hyprlua/scripts/caffeine-manual-status.sh") ; presence-active poll — true when the webcam presence-detect daemon currently ; sees you, independent of the idle lock. A distinct input from a manual caffeine ; toggle, so the two can be true at the same time. (defpoll presence-active :interval "2s" "~/Dotfiles/desktopenvs/hyprlua/scripts/presence-status.sh") ; caffeine widget — two inputs (manual inhibit, presence detected) → four states: ; neither: 󰒲 sleep, purple ; manual only: ☕ coffee, purple ; presence only: 󰈈 eye, pink (.caffeine-presence) ; manual + presence: ☕ coffee, pink ; Colour tracks presence (pink accent); the glyph is coffee whenever manually ; inhibiting, else the eye when only presence holds it, else the sleep glyph. (defwidget caffeine [] (button :class {presence-active == "true" ? "music caffeine-presence" : "music"} :onclick "~/Dotfiles/desktopenvs/hyprlua/scripts/caffeine.sh" :tooltip {caffeine-manual == "true" ? (presence-active == "true" ? "Caffeine: ON (manual + presence)" : "Caffeine: ON (manual)") : (presence-active == "true" ? "Awake: presence detected" : "Idle: no inhibit")} {caffeine-manual == "true" ? "☕" : presence-active == "true" ? "󰈈" : "󰒲"}))