nicks-nix-config/modules/ewwbar/eww-config/dashboard/dashboard.yuck

150 lines
4.2 KiB
Text
Raw Normal View History

2023-10-31 23:04:06 -07: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
(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"
: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")})
(box :vexpand "true")
))
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"
: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
:geometry (geometry :x 760
:y 200
:width 400
:height 150)
(dash_clock)
)
2023-10-31 23:04:06 -07:00
(defwindow dash_clock_bg
:stacking "bg"
:focusable "false"
:monitor 0
:geometry (geometry :x 760
:y 200
:width 400
:height 150)
(dash_clock_bg)
)
2023-10-31 23:04:06 -07:00
(defwindow logout
:stacking "bg"
:focusable "false"
:monitor 0
:geometry (geometry :x 1400
:y 200
:width 75
:height 75)
(logout))
(defwindow restart
:stacking "bg"
:focusable "false"
:monitor 0
:geometry (geometry :x 1400
:y 280
:width 75
:height 75)
(restart))
(defwindow shutdown
:stacking "bg"
:focusable "false"
:monitor 0
:geometry (geometry :x 1400
:y 360
:width 75
:height 75)
(shutdown))
(defwindow reboot_windows
:stacking "bg"
:focusable "false"
:monitor 0
:geometry (geometry :x 1400
:y 440
:width 75
:height 75)
(reboot_windows))
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
(defwindow elevate_to_windows
:monitor 0
:exclusive false
:stacking "overlay"
:focusable true
:geometry (geometry :anchor "center center")
(elevate_to_windows)
)