feat: shoukei - add Lid & PowerKey settings (#207)

This commit is contained in:
Ryan Yin
2025-08-20 02:21:07 +08:00
committed by GitHub
parent d83cfcf681
commit d517d74bf7
3 changed files with 23 additions and 2 deletions

View File

@@ -40,7 +40,6 @@ bind = , XF86AudioPlay, exec, playerctl play-pause
bind = , XF86AudioNext, exec, playerctl next
bind = , XF86AudioPrev, exec, playerctl previous
bind = , XF86Search, exec, anyrun
bind = , XF86PowerOff, exec, shutdown -h now
# WORKSPACES
# ============================================================================

View File

@@ -24,6 +24,29 @@
# since mesa 25.1(already in nixpkgs), support for asahi is enabled by default.
};
# Lid & PowerKey settings
#
# Suspend: Store system state to RAM - fast, requires minimal power to maintain RAM.
# Hibernate: Store system state & RAM to Disk, and then poweroff the system.
#
# NOTE: Hibernate is not supported by Asahi Linux.
services.logind = {
lidSwitch = "suspend";
lidSwitchExternalPower = "lock";
# 'Docked' means: more than one display is connected or the system is inserted in a docking station
lidSwitchDocked = "ignore";
powerKey = "suspend";
powerKeyLongPress = "poweroff";
};
systemd.targets.sleep.enable = true;
systemd.sleep.extraConfig = ''
AllowSuspend=yes
AllowHibernate=no
AllowSuspendThenHibernate=no
HibernateDelaySec=5min
'';
# After adding this snippet, you need to restart the system for the touchbar to work.
hardware.apple.touchBar = {
enable = true;

View File

@@ -6,4 +6,3 @@
# 1.33: scale to 1.33 times
# bitdepth,10: enable 10 bit support
monitor=eDP-1, highres@highrr, 0x0, 1.33, bitdepth,10