2023-10-31 23:04:06 -07:00
|
|
|
|
2023-11-06 15:57:15 -08:00
|
|
|
(defwidget elevate_to_windows []
|
|
|
|
(revealer :transition "slideup"
|
|
|
|
:reveal { show_elevation_prompt }
|
|
|
|
:duration { "0ms" } ;; needs to be close to the default timeout, because the timeout is broken
|
|
|
|
(box :class "input_popup"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
:orientation "v"
|
|
|
|
:spacing 2
|
|
|
|
(label :class "input_popup_label"
|
|
|
|
:text "Elevation Required"
|
|
|
|
:xalign 0.5)
|
|
|
|
(box :class "input_popup_input_box"
|
|
|
|
(input :class "input_popup_input"
|
|
|
|
:password true
|
|
|
|
:timeout "1000ms" ;; this does nothing :(
|
|
|
|
:onaccept "eww update show_elevation_prompt=false;eww close elevate_to_windows; echo \"{}\" | sudo -S grub-reboot 1 && systemctl reboot")
|
|
|
|
))))
|
2023-10-31 23:04:06 -07:00
|
|
|
|
2023-11-09 16:57:11 -08:00
|
|
|
(defpoll clock_gradient :interval "5m"
|
|
|
|
{"gcal --resource-file=/home/nixolas/.config/eww/scripts/gcalinfo -H no | ewwtilities calendar-background"})
|
|
|
|
|
|
|
|
(defwidget dash_clock_bg []
|
|
|
|
(box :class "dash_clock_bg"
|
|
|
|
:style "background-image: ${clock_gradient}"
|
|
|
|
))
|
|
|
|
|
2023-11-06 17:01:22 -08:00
|
|
|
(defwidget dash_clock []
|
|
|
|
(box :class "dash_clock"
|
2023-11-11 10:07:02 -08:00
|
|
|
:style "background-image: url('images/dash_clock_bg.png');"
|
2023-11-06 17:01:22 -08:00
|
|
|
:orientation "v"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
:spacing 1
|
|
|
|
(label :class "dash_clock_time"
|
|
|
|
:halign "center"
|
|
|
|
:text {formattime(EWW_TIME, "%H:%M:%S")})
|
|
|
|
(label :class "dash_clock_date"
|
|
|
|
:halign "center"
|
|
|
|
:text {formattime(EWW_TIME, "%B, %d %Y")})
|
|
|
|
))
|
|
|
|
|
2023-11-13 17:43:00 -08:00
|
|
|
(deflisten music_artist :initial ""
|
|
|
|
"playerctl --follow metadata artist || true")
|
|
|
|
|
|
|
|
(deflisten music_title :initial ""
|
|
|
|
"playerctl --follow metadata title || true")
|
|
|
|
(deflisten music_cover :initial ""
|
|
|
|
"playerctl --follow metadata mpris:artUrl || true")
|
|
|
|
(deflisten music_percentage :initial "0"
|
|
|
|
"playerctl --follow metadata \"{{ (position * 100 / mpris:length) }}\" || true")
|
|
|
|
(deflisten MUSIC_STATUS :initial "true"
|
|
|
|
"playerctl --follow status")
|
|
|
|
|
|
|
|
(defwidget dash_music_state []
|
|
|
|
(box :class "dash_window"
|
|
|
|
:orientation "h"
|
|
|
|
:space-evenly "false"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
(box :class "album_art"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
:style "background-image: url('${music_cover}');")
|
|
|
|
(box :orientation "v"
|
|
|
|
:class "music_controls"
|
|
|
|
:spacing 10
|
|
|
|
:space-evenly "false"
|
|
|
|
:vexpand "false"
|
2023-11-14 19:38:26 -08:00
|
|
|
:hexpand "true"
|
2023-11-13 17:43:00 -08:00
|
|
|
(label :class "music_title"
|
|
|
|
:halign "center"
|
|
|
|
:wrap "true"
|
2023-11-14 19:38:26 -08:00
|
|
|
:limit-width 30
|
2023-11-13 17:43:00 -08:00
|
|
|
:text music_title
|
|
|
|
)
|
|
|
|
(label :class "music_artist"
|
|
|
|
:halign "center"
|
|
|
|
:text music_artist
|
|
|
|
)
|
|
|
|
(box :orientation "h"
|
|
|
|
:spacing 20
|
|
|
|
:halign "center"
|
|
|
|
:space-evenly "true"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
(button :class "music_button" :onclick "playerctl previous" "")
|
|
|
|
(button :class "music_button" :onclick "playerctl play-pause" {
|
|
|
|
MUSIC_STATUS == "Playing" ? "" : MUSIC_STATUS == "Paused" ? "" : ""
|
|
|
|
})
|
|
|
|
(button :class "music_button" :onclick "playerctl next" "")
|
|
|
|
|
|
|
|
)
|
|
|
|
(box :class "music_bar" :halign "center" :vexpand "false" :hexpand "false"
|
|
|
|
(scale :min 0 :active "true" :max 100 :value music_percentage)
|
2023-11-14 19:38:26 -08:00
|
|
|
))))
|
|
|
|
|
|
|
|
(defwidget dash_computer_status []
|
|
|
|
(box :class "dash_window"
|
|
|
|
:orientation "v"
|
|
|
|
:space-evenly "false"
|
|
|
|
:hexpand "false"
|
|
|
|
:vexpand "false"
|
|
|
|
(box :class "arc_container"
|
|
|
|
:hexpand "false"
|
|
|
|
:width 200
|
|
|
|
:height 200
|
|
|
|
:valign "center"
|
|
|
|
:halign "center"
|
|
|
|
(circular-progress :class "res_cpu"
|
|
|
|
:value {EWW_CPU.avg}
|
|
|
|
:thickness 5
|
|
|
|
(box :orientation "v"
|
|
|
|
:halign "center"
|
|
|
|
:valign "center"
|
|
|
|
:vexpand "false"
|
|
|
|
(label :class "small_circle_text" :text "CPU")
|
|
|
|
(label :class "small_circle_text" :text "${round(EWW_CPU.avg, 2)}%")
|
|
|
|
))
|
2023-11-13 17:43:00 -08:00
|
|
|
)
|
2023-11-14 19:38:26 -08:00
|
|
|
(box :orientation "h"
|
|
|
|
:vexpand "true"
|
|
|
|
:valign "center"
|
|
|
|
(box :class "arc_container"
|
|
|
|
:width 125
|
|
|
|
:height 125
|
|
|
|
:valign "center"
|
|
|
|
:halign "center"
|
|
|
|
(circular-progress :class "res_mem"
|
|
|
|
:value {EWW_RAM.used_mem_perc}
|
|
|
|
:thickness 5
|
|
|
|
(box :orientation "v"
|
|
|
|
:halign "center"
|
|
|
|
:valign "center"
|
|
|
|
:vexpand "false"
|
|
|
|
(label :class "small_circle_text" :text "RAM")
|
|
|
|
(label :class "small_circle_text" :text "${round(EWW_RAM.used_mem_perc, 2)}%")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(box :class "arc_container"
|
|
|
|
:width 125
|
|
|
|
:height 125
|
|
|
|
:valign "center"
|
|
|
|
:halign "center"
|
|
|
|
(circular-progress :class "res_hdd"
|
|
|
|
:value {EWW_DISK["/"].used_perc}
|
|
|
|
:thickness 5
|
|
|
|
(box :orientation "v"
|
|
|
|
:halign "center"
|
|
|
|
:valign "center"
|
|
|
|
:vexpand "false"
|
|
|
|
(label :class "small_circle_text" :text "Disk")
|
|
|
|
(label :class "small_circle_text" :text "${round(EWW_DISK["/"].used_perc, 2)}%")
|
|
|
|
))
|
|
|
|
))))
|
|
|
|
|
2023-11-13 17:43:00 -08:00
|
|
|
|
2023-10-31 23:04:06 -07:00
|
|
|
(defwidget logout []
|
|
|
|
(box :class "dash_window"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
(button :class "btn_logout"
|
|
|
|
:onclick "hyprctl dispatch exit"
|
|
|
|
"")))
|
|
|
|
|
|
|
|
(defwidget restart []
|
|
|
|
(box :class "dash_window"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
(button :class "btn_restart"
|
|
|
|
:onclick "systemctl reboot"
|
|
|
|
"")))
|
|
|
|
|
|
|
|
(defwidget shutdown []
|
|
|
|
(box :class "dash_window"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
(button :class "btn_shutdown"
|
|
|
|
:onclick "systemctl poweroff"
|
|
|
|
"")))
|
|
|
|
|
|
|
|
(defwidget reboot_windows []
|
|
|
|
(box :class "dash_window"
|
|
|
|
:vexpand "false"
|
|
|
|
:hexpand "false"
|
|
|
|
(button :class "btn_switch_windows"
|
2023-11-06 15:57:15 -08:00
|
|
|
:onclick "eww open elevate_to_windows; eww update show_elevation_prompt=true"
|
2023-10-31 23:04:06 -07:00
|
|
|
"")))
|
|
|
|
|
|
|
|
|
2023-11-06 17:01:22 -08:00
|
|
|
(defwindow dash_clock
|
|
|
|
:stacking "bg"
|
|
|
|
:focusable "false"
|
|
|
|
:monitor 0
|
2023-11-14 19:38:26 -08:00
|
|
|
:geometry (geometry :x 710
|
|
|
|
:y 300
|
|
|
|
:width 500
|
2023-11-06 17:01:22 -08:00
|
|
|
:height 150)
|
|
|
|
(dash_clock)
|
|
|
|
)
|
2023-10-31 23:04:06 -07:00
|
|
|
|
2023-11-09 16:57:11 -08:00
|
|
|
(defwindow dash_clock_bg
|
|
|
|
:stacking "bg"
|
|
|
|
:focusable "false"
|
|
|
|
:monitor 0
|
2023-11-14 19:38:26 -08:00
|
|
|
:geometry (geometry :x 710
|
|
|
|
:y 300
|
|
|
|
:width 500
|
2023-11-09 16:57:11 -08:00
|
|
|
:height 150)
|
|
|
|
(dash_clock_bg)
|
|
|
|
)
|
|
|
|
|
2023-11-13 17:43:00 -08:00
|
|
|
(defwindow dash_music
|
|
|
|
:stacking "bg"
|
|
|
|
:focusable "false"
|
|
|
|
:monitor 0
|
2023-11-14 19:38:26 -08:00
|
|
|
:geometry (geometry :x 710
|
|
|
|
:y 475
|
|
|
|
:width 500
|
2023-11-13 17:43:00 -08:00
|
|
|
:height 150)
|
|
|
|
(dash_music_state)
|
|
|
|
)
|
|
|
|
|
2023-11-14 19:38:26 -08:00
|
|
|
(defwindow dash_computer_status
|
|
|
|
:stacking "bg"
|
|
|
|
:focusable "false"
|
|
|
|
:monitor 0
|
|
|
|
:geometry (geometry :x 450
|
|
|
|
:y 300
|
|
|
|
:width 250
|
|
|
|
:height 350)
|
|
|
|
(dash_computer_status)
|
|
|
|
)
|
|
|
|
|
2023-10-31 23:04:06 -07:00
|
|
|
(defwindow logout
|
|
|
|
:stacking "bg"
|
|
|
|
:focusable "false"
|
|
|
|
:monitor 0
|
2023-11-14 19:38:26 -08:00
|
|
|
:geometry (geometry :x 1220
|
|
|
|
:y 300
|
2023-10-31 23:04:06 -07:00
|
|
|
:width 75
|
|
|
|
:height 75)
|
|
|
|
(logout))
|
|
|
|
|
|
|
|
(defwindow restart
|
|
|
|
:stacking "bg"
|
|
|
|
:focusable "false"
|
|
|
|
:monitor 0
|
2023-11-14 19:38:26 -08:00
|
|
|
:geometry (geometry :x 1220
|
|
|
|
:y 395
|
2023-10-31 23:04:06 -07:00
|
|
|
:width 75
|
|
|
|
:height 75)
|
|
|
|
(restart))
|
|
|
|
|
|
|
|
(defwindow shutdown
|
|
|
|
:stacking "bg"
|
|
|
|
:focusable "false"
|
|
|
|
:monitor 0
|
2023-11-14 19:38:26 -08:00
|
|
|
:geometry (geometry :x 1220
|
|
|
|
:y 485
|
2023-10-31 23:04:06 -07:00
|
|
|
:width 75
|
|
|
|
:height 75)
|
|
|
|
(shutdown))
|
|
|
|
|
|
|
|
(defwindow reboot_windows
|
|
|
|
:stacking "bg"
|
|
|
|
:focusable "false"
|
|
|
|
:monitor 0
|
2023-11-14 19:38:26 -08:00
|
|
|
:geometry (geometry :x 1220
|
|
|
|
:y 580
|
2023-10-31 23:04:06 -07:00
|
|
|
:width 75
|
|
|
|
:height 75)
|
|
|
|
(reboot_windows))
|
2023-11-06 15:57:15 -08:00
|
|
|
|
2023-11-06 17:01:22 -08:00
|
|
|
;; Set up prompt window for sudo password
|
|
|
|
;; that trigglers on reboot_windows,
|
|
|
|
;; and runs the windows command
|
2023-11-06 15:57:15 -08:00
|
|
|
(defwindow elevate_to_windows
|
|
|
|
:monitor 0
|
|
|
|
:exclusive false
|
|
|
|
:stacking "overlay"
|
|
|
|
:focusable true
|
|
|
|
:geometry (geometry :anchor "center center")
|
|
|
|
(elevate_to_windows)
|
|
|
|
)
|