Skip to content

Instantly share code, notes, and snippets.

@LinArcX LinArcX/xinitrc_1
Created Apr 6, 2019

Embed
What would you like to do?
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.xinitrc;
in
{
options = {
xinitrc = {
enable = mkEnableOption "X init";
defaultSession = mkOption {
type = types.nullOr types.str;
default = null;
example = "i3, kde, xfce4, ...";
description = ''
Default session
'';
};
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf (cfg.defaultSession != "") {
home.file.".xinitrc".text = ''
session=''${1:-${cfg.defaultSession}}
case $session in
i3|i3wm ) exec i3;;
kde ) exec startkde;;
xfce|xfce4 ) exec startxfce4;;
* ) exec $1;;
esac
'';
})
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.