mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-22 20:59:32 -08:00
switch to windows elevation prompt added
This commit is contained in:
parent
3ef2a91b53
commit
6f81b30e06
4 changed files with 55 additions and 3 deletions
|
@ -8,6 +8,32 @@
|
|||
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 {
|
||||
color: #7a49a5;
|
||||
}
|
||||
|
|
|
@ -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 []
|
||||
(box :class "dash_window"
|
||||
|
@ -29,8 +47,7 @@
|
|||
:vexpand "false"
|
||||
:hexpand "false"
|
||||
(button :class "btn_switch_windows"
|
||||
:onclick "kitty @ launch"
|
||||
;; :onclick "kitty --session /home/nixolas/.config/eww/scripts/switch-to-windows-kitty.conf -T switch-to-windows-elevation"
|
||||
:onclick "eww open elevate_to_windows; eww update show_elevation_prompt=true"
|
||||
"")))
|
||||
|
||||
;; Set up prompt window for sudo password
|
||||
|
@ -77,3 +94,12 @@
|
|||
: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)
|
||||
)
|
||||
|
|
|
@ -160,4 +160,5 @@
|
|||
(defvar open_vol_osd false)
|
||||
(defvar ANIM_DURATION "500ms")
|
||||
(include "./modules/volume-osd.yuck")
|
||||
(defvar show_elevation_prompt false)
|
||||
(include "./dashboard/dashboard.yuck")
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
launch echo "Elevation required to default to Grub entry 2 on reboot"; sudo grub-reboot 1; sudo reboot
|
Loading…
Reference in a new issue