switch to windows elevation prompt added

This commit is contained in:
Nickiel12 2023-11-06 15:57:15 -08:00
parent 3ef2a91b53
commit 6f81b30e06
4 changed files with 55 additions and 3 deletions

View file

@ -8,6 +8,32 @@
font-weight: bold; font-weight: bold;
} }
.input_popup {
// background-color: #6f6f6f;
background-image: linear-gradient(15deg, #212121, #004f4f);
border-radius: 8px;
padding: 15px;
}
.input_popup_label {
color: #FFFFFF;
padding-bottom: 5px;
font-size: 20px;
font-weight: bold;
}
.input_popup_input {
padding-left: 7px;
padding-right: 7px;
background-color: #252525;
border-radius: 2px;
}
.input_popup_input_box {
box-shadow: 0 0 0 2px #66cdaa;
border-radius: 2px;
}
.btn_logout { .btn_logout {
color: #7a49a5; color: #7a49a5;
} }

View file

@ -1,4 +1,22 @@
(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 [] (defwidget logout []
(box :class "dash_window" (box :class "dash_window"
@ -29,8 +47,7 @@
:vexpand "false" :vexpand "false"
:hexpand "false" :hexpand "false"
(button :class "btn_switch_windows" (button :class "btn_switch_windows"
:onclick "kitty @ launch" :onclick "eww open elevate_to_windows; eww update show_elevation_prompt=true"
;; :onclick "kitty --session /home/nixolas/.config/eww/scripts/switch-to-windows-kitty.conf -T switch-to-windows-elevation"
""))) "")))
;; Set up prompt window for sudo password ;; Set up prompt window for sudo password
@ -77,3 +94,12 @@
:width 75 :width 75
:height 75) :height 75)
(reboot_windows)) (reboot_windows))
(defwindow elevate_to_windows
:monitor 0
:exclusive false
:stacking "overlay"
:focusable true
:geometry (geometry :anchor "center center")
(elevate_to_windows)
)

View file

@ -160,4 +160,5 @@
(defvar open_vol_osd false) (defvar open_vol_osd false)
(defvar ANIM_DURATION "500ms") (defvar ANIM_DURATION "500ms")
(include "./modules/volume-osd.yuck") (include "./modules/volume-osd.yuck")
(defvar show_elevation_prompt false)
(include "./dashboard/dashboard.yuck") (include "./dashboard/dashboard.yuck")

View file

@ -1 +0,0 @@
launch echo "Elevation required to default to Grub entry 2 on reboot"; sudo grub-reboot 1; sudo reboot