File tree Expand file tree Collapse file tree
nixos/modules/services/x11/display-managers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656 fi
5757 '' }
5858
59- ${ optionalString cfg . displayManager . desktopManagerHandlesLidAndPower ''
60- # Stop systemd from handling the power button and lid switch,
61- # since presumably the desktop environment will handle these.
62- if [ -z "$_INHIBITION_LOCK_TAKEN" ]; then
63- export _INHIBITION_LOCK_TAKEN=1
64- if ! ${ config . systemd . package } /bin/loginctl show-session $XDG_SESSION_ID | grep -q '^RemoteHost='; then
65- exec ${ config . systemd . package } /bin/systemd-inhibit --what=handle-lid-switch:handle-power-key --why="Desktop environment handles power events" "$0" "$sessionType"
66- fi
67- fi
68-
69- '' }
70-
7159 ${ optionalString cfg . startGnuPGAgent ''
7260 if test -z "$SSH_AUTH_SOCK"; then
7361 # Restart this script as a child of the GnuPG agent.
227215 '' ;
228216 } ;
229217
230- desktopManagerHandlesLidAndPower = mkOption {
231- type = types . bool ;
232- default = false ;
233- description = ''
234- Whether the display manager should prevent systemd from handling
235- lid and power events. This is normally handled by the desktop
236- environment's power manager. Turn this off when using a minimal
237- X11 setup without a full power manager.
238- '' ;
239- } ;
240-
241218 session = mkOption {
242219 default = [ ] ;
243220 example = literalExample
You can’t perform that action at this time.
0 commit comments