fixup gtklock layout, fade to black before suspend
This commit is contained in:
parent
8950720040
commit
554fdffd6a
2 changed files with 119 additions and 85 deletions
|
|
@ -16,8 +16,18 @@ let
|
|||
layout = pkgs.writeText "gtklock.ui" ''
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkBox" id="window-box">
|
||||
<object class="GtkScrolledWindow" id="window-box">
|
||||
<property name="name">window-box</property>
|
||||
<!-- Never ask for more width than the screen has: the lock surface has to stay the size
|
||||
the compositor gave it, or it gets disconnected and the session stays locked. -->
|
||||
<property name="hscrollbar-policy">external</property>
|
||||
<property name="vscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="content-box">
|
||||
<property name="name">content-box</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="orientation">vertical</property>
|
||||
|
|
@ -67,6 +77,7 @@ let
|
|||
<signal name="activate" handler="window_pw_check"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
@ -93,21 +104,26 @@ let
|
|||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="halign">center</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="warning-label">
|
||||
<property name="name">warning-label</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="error-label">
|
||||
<property name="name">error-label</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="warning-label">
|
||||
<property name="name">warning-label</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -118,6 +134,7 @@ let
|
|||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
@ -126,6 +143,10 @@ let
|
|||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
'';
|
||||
in
|
||||
|
|
@ -157,6 +178,11 @@ in
|
|||
background-position: center;
|
||||
}
|
||||
|
||||
#window-box,
|
||||
#window-box viewport {
|
||||
background: none;
|
||||
}
|
||||
|
||||
#clock-label {
|
||||
font-size: 96pt;
|
||||
color: white;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ let
|
|||
before_sleep_cmd = loginctl lock-session
|
||||
}
|
||||
'';
|
||||
|
||||
suspend = pkgs.writeShellScript "suspend" ''
|
||||
${lib.getExe pkgs.niri} msg action power-off-monitors
|
||||
exec ${config.systemd.package}/bin/systemctl suspend
|
||||
'';
|
||||
in
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
|
|
@ -54,6 +59,8 @@ in
|
|||
|
||||
input {
|
||||
touch { edge-swipe-size 24; }
|
||||
// The power key is bound below instead.
|
||||
disable-power-key-handling
|
||||
}
|
||||
|
||||
layout {
|
||||
|
|
@ -115,6 +122,7 @@ in
|
|||
spawn-at-startup "${lib.getExe pkgs.hypridle}" "--config" "${hypridleConfig}"
|
||||
|
||||
binds {
|
||||
XF86PowerOff allow-when-locked=true { spawn "${suspend}"; }
|
||||
XF86AudioRaiseVolume allow-when-locked=true { spawn "${swayosd-client}" "--output-volume" "raise"; }
|
||||
XF86AudioLowerVolume allow-when-locked=true { spawn "${swayosd-client}" "--output-volume" "lower"; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue