Files
dotfiles/eww/Main/eww.yuck
2025-06-19 01:57:42 +02:00

99 lines
6.8 KiB
Plaintext

;; variables
(defvar window false)
(defpoll time :interval "1s" "date '+%I %M'")
(defpoll date :interval "1s" "date '+%A, %B %d'")
(deflisten notifications-cards "Main/scripts/logger.zsh subscribe")
(defpoll notifications-crits :interval "1s" "Main/scripts/logger.zsh crits")
(defpoll weather-icon :interval "20m" "Main/scripts/weather --icon")
(defpoll weather-temp :interval "20m" "Main/scripts/weather --temp")
(defpoll weather-desc :interval "20m" "Main/scripts/weather --stat")
(deflisten weather-color :initial "#7aa2f7" "Main/scripts/weather --hex")
(defpoll calendar-day :interval "20h" "+%d")
(defpoll calendar-year :interval "20h" "+%Y")
(defpoll calendar-month :interval "20h" "%+B")
(defpoll cpu :interval "1s" "Main/scripts/system --cpu")
(defpoll memory :interval "1s" "Main/scripts/system --mem")
(defpoll profile-image :interval "10h" "Main/scripts/details --image")
(defpoll profile-username :interval "1h" "whoami")
(defpoll profile-name :interval "1h" "Main/scripts/details --name")
(defpoll profile-kernel :interval "1h" "Main/scripts/details --kernel")
(defpoll profile-os :interval "1h" "Main/scripts/details --os")
(defpoll music-length :interval "1s" "Main/scripts/music-length")
(defpoll music-title :interval "1s" "Main/scripts/music-title --status")
(defpoll music-pp :interval "1s" "Main/scripts/music-title --icon")
(defpoll music-artist :interval "1s" "Main/scripts/music-artist")
(defpoll music-art :interval "1s" "Main/scripts/music-art")
(defpoll volume :interval "1s" "Main/scripts/system --vol")
(defpoll brightness :interval "1s" "Main/scripts/system --bri")
(defpoll fortune :interval "1h" "Main/scripts/fortune.py 32 9")
(deflisten cava "Main/scripts/cava")
(defpoll title :interval "1s" "Main/scripts/music-title --status")
(defpoll artist :interval "1s" "Main/scripts/player --artist")
(defpoll album :interval "1s" "Main/scripts/player --album")
(defpoll length-info :interval "1s" "Main/scripts/player --length-info")
(defpoll art :interval "1s" "Main/scripts/player --cover")
;; widgets
(defwidget main []
(box :class "main-window" :space-evenly "false" :orientation "v"
(box :class "top-row" :orientation "h" :space-evenly "false"
(box :class "date-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false"
(label :class "time" :text time)
(label :class "date" :text date))
(box :class "weather-box" :space-evenly "false" :hexpand "true" :orientation "v"
(label :class "weather-desc" :halign "start" :text weather-desc)
(label :class "weather-temp" :halign "start" :text weather-temp)
(label :class "weather-icon" :halign "end" :valign "end" :text weather-icon :style "color: ${weather-color}")))
(box :class "second-row" :orientation "h" :space-evenly "false"
(box :class "stats-box" :space-evenly "false" :orientation "v" :spacing 8
(label :class "stats-header" :halign "start" :text "Stats")
(box :class "volume-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
(label :tooltip "${volume}%" :class "volume-icon" :text "󰕾")
(scale :min 0 :max 101 :active false :value {volume == "" ? 0 : volume} :class "volume-scale" :width 150))
(box :class "brightness-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
(label :tooltip "${brightness}%" :class "brightness-icon" :text "󰃠")
(scale :min 0 :max 101 :active false :value {brightness == "" ? 0 : brightness} :class "brightness-scale" :width 150))
(box :class "cpu-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
(label :tooltip "${cpu}%" :class "cpu-icon" :text "󰘚")
(scale :min 0 :max 101 :active false :value {cpu == "" ? 0 : cpu} :class "cpu-scale" :width 150))
(box :class "memory-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
(label :tooltip "${memory}%" :class "memory-icon" :text "󰍛")
(scale :min 0 :max 101 :active false :value {memory == "" ? 0 : memory} :class "memory-scale" :width 150)))
(box :class "fortune-box" :space-evenly "false" :hexpand "true" :orientation "v"
(label :class "fortune-header" :halign "start" :text "Fortune")
(label :class "fortune-text" :halign "start" :text fortune :show-truncated true :wrap true)))
(box :class "third-row" :orientation "h" :space-evenly "false"
(box :class "music-art-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false" :style "background-image: url(\"${music-art}\");"
(box :class "music-stuff-box" :space-evenly "false" :hexpand "false" :vexpand "false" :orientation "v"
(box :class "player-box" :hexpand "false" :vexpand "false" :space-evenly "true"
(box :class "player-info-box" :hexpand "false" :vexpand "false" :space-evenly "false" :orientation "v" :spacing 15
(label :class "player-info-title" :text "󰝚 Title: ${title}" :halign "start" :limit-width 30 :tooltip "${title}")
(label :class "player-info-artist" :text "󰠃 Artist: ${artist}" :halign "start" :limit-width 30 :tooltip "${artist}")
(label :class "player-info-album" :text "󰀥 Album: ${album}" :halign "start" :limit-width 30 :tooltip "${album}")
(label :class "player-info-length" :text "󰦚 Length: ${length-info}" :halign "start" :tooltip "${length-info}"))
(box :class "player-cover-box" :hexpand "false" :halign "end" :vexpand "false" :space-evenly "false" :style "background-image: url('${art}');"))
(box :class "cava-box" :hexpand "false" :vexpand "false"
(label :vexpand "false" :hexpand "false" :space-evenly "false"
:class "cavabar"
:text cava
))))
(box :class "music-controls-box" :space-evenly "true" :hexpand "true" :vexpand "false" :orientation "v"
(button :class "music-previous" :halign "center" :onclick "playerctl previous" "󰒮")
(button :class "music-pp" :halign "center" :onclick "playerctl play-pause" "${music-pp}")
(button :class "music-next" :halign "center" :onclick "playerctl next" "󰒭")))
(box :class "profile-stuff-box" :space-evenly "false" :hexpand "false" :vexpand "false" :orientation "h" :height 140
(box :class "profile-img" :space-evenly "false" :hexpand "false" :vexpand "false" :orientation "v" :style "background-image: url(\"${profile-image}\");")
(box :class "profile-stuff" :orientation "v" :space-evenly "false" :hexpand "false" :vexpand "false" :spacing 8
(label :class "profile-name" :text profile-name :halign "start")
(label :class "profile-os" :text profile-os :halign "start")
(label :class "profile-kernel" :text profile-kernel :halign "start")))))
;; windows
(defwindow main
:windowtype "normal"
:wm-ignore true
:monitor 0
:geometry (geometry :x 2 :y 0 :width 600 :height 880)
(main))