(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") )))) (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" ""))) ;; Set up prompt window for sudo password ;; that trigglers on reboot_windows, ;; and runs the windows command (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)) (defwindow elevate_to_windows :monitor 0 :exclusive false :stacking "overlay" :focusable true :geometry (geometry :anchor "center center") (elevate_to_windows) )