3
0
Fork 0
forked from mirrors/nixpkgs

services.xserver.windowManager.session: handle duplicate names (#37690)

This commit is contained in:
volth 2018-09-01 19:27:17 +00:00 committed by xeji
parent 37a45e5a97
commit 2413fcdfeb

View file

@ -27,6 +27,15 @@ let
Xft.hintstyle: hintslight Xft.hintstyle: hintslight
''; '';
mkCases = session:
concatStrings (
mapAttrsToList (name: starts: ''
(${name})
${concatMapStringsSep "\n " (n: n.start) starts}
;;
'') (lib.groupBy (n: n.name) session)
);
# file provided by services.xserver.displayManager.session.wrapper # file provided by services.xserver.displayManager.session.wrapper
xsessionWrapper = pkgs.writeScript "xsession-wrapper" xsessionWrapper = pkgs.writeScript "xsession-wrapper"
'' ''
@ -139,21 +148,13 @@ let
# Start the window manager. # Start the window manager.
case "$windowManager" in case "$windowManager" in
${concatMapStrings (s: '' ${mkCases wm}
(${s.name})
${s.start}
;;
'') wm}
(*) echo "$0: Window manager '$windowManager' not found.";; (*) echo "$0: Window manager '$windowManager' not found.";;
esac esac
# Start the desktop manager. # Start the desktop manager.
case "$desktopManager" in case "$desktopManager" in
${concatMapStrings (s: '' ${mkCases dm}
(${s.name})
${s.start}
;;
'') dm}
(*) echo "$0: Desktop manager '$desktopManager' not found.";; (*) echo "$0: Desktop manager '$desktopManager' not found.";;
esac esac