Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1736798a8724
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3e3c38aaef02
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on May 6, 2017

  1. nixos/display-managers: Quote "$vars" (#25199)

    (cherry picked from commit 0d72629)
    nyarly authored and primeos committed May 6, 2017
    Copy the full SHA
    c893d7a View commit details
  2. display-managers: Fix the xsession parameters

    The xsession script was called with inconsistent (depending on the
    display managers) and wrong parameters. The main reason for this where
    the spaces the parameter syntax. In order to fix this the old syntax:
    $1 = '<desktop-manager> + <window-manager>'
    Will be replaced with a new syntax:
    $1 = "<desktop-manager>+<window-manager>"
    
    This assumes that neither "<desktop-manager>" nor "<window-manager>"
    contain the "+" character but this shouldn't be a problem.
    
    This patch also fixes the quoting by using double quotes (") instead of
    single quotes (') [0].
    
    Last but not least this'll add some comments for the better
    understanding of the script.
    
    [0]: https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html
    
    (cherry picked from commit 1273f41)
    primeos committed May 6, 2017
    Copy the full SHA
    9283310 View commit details
  3. desktop-managers: Use a black BG as fallback

    Use a solid black background when no background image (via
    ~/.background-image) is provided. In my case this fixes the really
    strange behaviour when i3 without a desktop manager starts with the SDDM
    login screen as background image.
    
    (cherry picked from commit 8528136)
    primeos committed May 6, 2017
    Copy the full SHA
    3e3c38a View commit details
9 changes: 6 additions & 3 deletions nixos/modules/services/x11/desktop-managers/default.nix
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ let
cfg = xcfg.desktopManager;

# If desktop manager `d' isn't capable of setting a background and
# the xserver is enabled, the `feh' program is used as a fallback.
# the xserver is enabled, `feh' or `xsetroot' are used as a fallback.
needBGCond = d: ! (d ? bgSupport && d.bgSupport) && xcfg.enable;

in
@@ -44,8 +44,11 @@ in
manage = "desktop";
start = d.start
+ optionalString (needBGCond d) ''
if test -e $HOME/.background-image; then
if [ -e $HOME/.background-image ]; then
${pkgs.feh}/bin/feh --bg-scale $HOME/.background-image
else
# Use a solid black background as fallback
${pkgs.xorg.xsetroot}/bin/xsetroot -solid black
fi
'';
}) list;
@@ -80,6 +83,6 @@ in
config = {
services.xserver.displayManager.session = cfg.session.list;
environment.systemPackages =
mkIf cfg.session.needBGPackages [ pkgs.feh ];
mkIf cfg.session.needBGPackages [ pkgs.feh ]; # xsetroot via xserver.enable
};
}
48 changes: 38 additions & 10 deletions nixos/modules/services/x11/display-managers/default.nix
Original file line number Diff line number Diff line change
@@ -32,8 +32,32 @@ let
''
#! ${pkgs.bash}/bin/bash
# Handle being called by SDDM.
if test "''${1:0:1}" = / ; then eval exec $1 $2 ; fi
# Expected parameters:
# $1 = <desktop-manager>+<window-manager>
# Actual parameters (FIXME):
# SDDM is calling this script like the following:
# $1 = /nix/store/xxx-xsession (= $0)
# $2 = <desktop-manager>+<window-manager>
# SLiM is using the following parameter:
# $1 = /nix/store/xxx-xsession <desktop-manager>+<window-manager>
# LightDM keeps the double quotes:
# $1 = /nix/store/xxx-xsession "<desktop-manager>+<window-manager>"
# The fake/auto display manager doesn't use any parameters and GDM is
# broken.
# If you want to "debug" this script don't print the parameters to stdout
# or stderr because this script will be executed multiple times and the
# output won't be visible in the log when the script is executed for the
# first time (e.g. append them to a file instead)!
# All of the above cases are handled by the following hack (FIXME).
# Since this line is *very important* for *all display managers* it is
# very important to test changes to the following line with all display
# managers:
if [ "''${1:0:1}" = "/" ]; then eval exec "$1" "$2" ; fi
# Now it should be safe to assume that the script was called with the
# expected parameters.
${optionalString cfg.displayManager.logToJournal ''
if [ -z "$_DID_SYSTEMD_CAT" ]; then
@@ -107,15 +131,16 @@ let
fi
fi
# The session type is "<desktop-manager> + <window-manager>", so
# extract those.
windowManager="''${sessionType##* + }"
# The session type is "<desktop-manager>+<window-manager>", so
# extract those (see:
# http://wiki.bash-hackers.org/syntax/pe#substring_removal).
windowManager="''${sessionType##*+}"
: ''${windowManager:=${cfg.windowManager.default}}
desktopManager="''${sessionType% + *}"
desktopManager="''${sessionType%%+*}"
: ''${desktopManager:=${cfg.desktopManager.default}}
# Start the window manager.
case $windowManager in
case "$windowManager" in
${concatMapStrings (s: ''
(${s.name})
${s.start}
@@ -125,7 +150,7 @@ let
esac
# Start the desktop manager.
case $desktopManager in
case "$desktopManager" in
${concatMapStrings (s: ''
(${s.name})
${s.start}
@@ -142,6 +167,9 @@ let
exit 0
'';

# Desktop Entry Specification:
# - https://standards.freedesktop.org/desktop-entry-spec/latest/
# - https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html
mkDesktops = names: pkgs.runCommand "desktops"
{ # trivial derivation
preferLocalBuild = true;
@@ -155,7 +183,7 @@ let
Version=1.0
Type=XSession
TryExec=${cfg.displayManager.session.script}
Exec=${cfg.displayManager.session.script} '${n}'
Exec=${cfg.displayManager.session.script} "${n}"
X-GDM-BypassXsession=true
Name=${n}
Comment=
@@ -238,7 +266,7 @@ in
wm = filter (s: s.manage == "window") list;
dm = filter (s: s.manage == "desktop") list;
names = flip concatMap dm
(d: map (w: d.name + optionalString (w.name != "none") (" + " + w.name))
(d: map (w: d.name + optionalString (w.name != "none") ("+" + w.name))
(filter (w: d.name != "none" || w.name != "none") wm));
desktops = mkDesktops names;
script = xsession wm dm;
2 changes: 1 addition & 1 deletion nixos/modules/services/x11/display-managers/lightdm.nix
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ let
let
dm = xcfg.desktopManager.default;
wm = xcfg.windowManager.default;
in dm + optionalString (wm != "none") (" + " + wm);
in dm + optionalString (wm != "none") ("+" + wm);
in
{
# Note: the order in which lightdm greeter modules are imported
2 changes: 1 addition & 1 deletion nixos/modules/services/x11/display-managers/sddm.nix
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ let
let
dm = xcfg.desktopManager.default;
wm = xcfg.windowManager.default;
in dm + optionalString (wm != "none") (" + " + wm);
in dm + optionalString (wm != "none") ("+" + wm);

in
{