NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.31k stars 13.55k forks source link

Background command gets appended to custom Xsession with no option to disable it #32548

Open Slabity opened 6 years ago

Slabity commented 6 years ago

Issue description

Custom sessions added to xservices.xserver.desktopManager.session will have a command added to them that checks for $HOME/.background-image and applies it as the wallpaper using feh.

This breaks configurations that attempt to set the wallpaper in other ways. For example, my custom session looks like the following:

services.xserver.desktopManager.session = [
    {
        name = "custom";
        start = ''                                                                                                                                  
            # Set background                                                                                                                        
            ${pkgs.feh}/bin/feh --bg-scale ${./background.jpg}                                                                                      

            # Load custom Xresources                                                                                                                
            ${pkgs.xlibs.xrdb}/bin/xrdb -load ${./Xresources}                                                                                                                                                                                          
        '';
    }
];

However, the actual Xsession case looks like this:

# Start the desktop manager.                                                                                                                                 
case "$desktopManager" in
  (custom)
  # Set background                                                                                                                                           
/nix/store/mpvyhf3jgakzrdi55pyvkmdyv3rwaix7-feh-2.21/bin/feh --bg-scale /nix/store/q7q5zcmwxklg6wfhfmybkmvb0jczimbj-background.jpg

# Load custom Xresources                                                                                                                                     
/nix/store/namx115zb80hvmcybp6cr85ydqpl6l43-xrdb-1.1.0/bin/xrdb -load /nix/store/4nw6izywdgq20g0cqlzgcasmgcg67705-Xresources

if [ -e $HOME/.background-image ]; then
  /nix/store/mpvyhf3jgakzrdi55pyvkmdyv3rwaix7-feh-2.21/bin/feh --bg-scale  $HOME/.background-image
else
  # Use a solid black background as fallback                                                                                                                 
  /nix/store/7g7cyycaiymfs3ff96dczds2hpn0algg-xsetroot-1.1.0/bin/xsetroot -solid black
fi

This breaks any configuration that attempts to set the wallpaper themselves, or even configurations that expect the background to be already set by the display manager.

I don't mind having an option that sets the wallpaper, but I'd prefer it to be optional (and not enabled by default).

Steps to reproduce

  1. Add a custom session to desktopManager.session (or some other method of setting the wallpaper).
  2. Background is black (unless you have a .background-image file).

Technical details

Affects the unstable branch.

srhb commented 6 years ago

I'm not sure you're supposed to actually set that option directly, but if you do, try settings bgSupport = true.

rnhmjoj commented 6 years ago

I think you are supposed to set xserver.displayManager.sessionCommands instead. At least that's what I'm currently doing to set a background. Anyway we should add an option to change .background-image to something else.

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.