Qtile: Difference between revisions

From NixOS Wiki
imported>Wingej0
No edit summary
imported>Jooooscha
m fix: greater sign (and remove now redundant explanation)
Line 5: Line 5:
To enable Qtile as your windowManager, set: <code>services.xserver.windowManager.qtile.enable</code> to <code>true</code>. For example:
To enable Qtile as your windowManager, set: <code>services.xserver.windowManager.qtile.enable</code> to <code>true</code>. For example:


{{file|/etc/nixos/configuration.nix|nix|
{{file|/etc/nixos/configuration.nix|nix|}}
<nowiki>
<syntaxHighlight lang=nix>
{ config, pkgs, ... }:  
{ config, pkgs, ... }:  
   ...
   ...
Line 18: Line 18:
   ...
   ...
}
}
</nowiki>
</syntaxHighlight>
}}


{{file|/etc/nixos/qtile.nix|nix|
{{file|/etc/nixos/qtile.nix|nix|}}
<nowiki>
<syntaxHighlight lang=nix>
{ config, pkgs, lib, ... }:
{ config, pkgs, lib, ... }:


Line 49: Line 48:
services.xserver.displayManager.sessionPackages = [ pkgs.qtile-unwrapped ];
services.xserver.displayManager.sessionPackages = [ pkgs.qtile-unwrapped ];
}
}
</nowiki>
</syntaxHighlight>
}}
 
Please note, the wiki renders the greater than sign in the code above with the HTML code & followed by gt;.  It needs to be the actual symbol ">" not the HTML code, ie. echo "${qtileSession}" > $out/share/wayland-sessions/qtile.desktop


== Warning ==
== Warning ==

Revision as of 20:33, 6 March 2024

Qtile is a full-featured, hackable tiling window manager written and configured in Python.

Enabling

To enable Qtile as your windowManager, set: services.xserver.windowManager.qtile.enable to true. For example:

/etc/nixos/configuration.nix
{ config, pkgs, ... }: 
  ...
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      # For wayland support see the following config
      ./qtile.nix
    ];
  services.xserver.windowManager.qtile.enable = true;
  ...
}
/etc/nixos/qtile.nix
{ config, pkgs, lib, ... }:

{
  nixpkgs.overlays = [
  (self: super: {
    qtile-unwrapped = super.qtile-unwrapped.overrideAttrs(_: rec {
      postInstall = let
        qtileSession = ''
        [Desktop Entry]
        Name=Qtile Wayland
        Comment=Qtile on Wayland
        Exec=qtile start -b wayland
        Type=Application
        '';
        in
        ''
      mkdir -p $out/share/wayland-sessions
      echo "${qtileSession}" > $out/share/wayland-sessions/qtile.desktop
      '';
      passthru.providedSessions = [ "qtile" ];
    });
  })
];

services.xserver.displayManager.sessionPackages = [ pkgs.qtile-unwrapped ];
}

Warning

The installation of Qtile leads to several of its dependencies being leaked in the user's PATH. This prevents the user from running a custom installation of python3 as Qtile will shadow the systemPackages in the PATH with its own python3. For more information see: Cannot use Globally Defined Python Environment While Inside Qtile and Kitty leaks packages into system environment (Additional context)