Skip to content

Instantly share code, notes, and snippets.

@LinArcX LinArcX/xinitrc_2
Last active 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, gnome-session, kde, xfce4, xterm, ...";
description = ''
Default session to login.
'';
};
autoNumlock = mkOption {
type = types.bool;
default = false;
description = "Activating Numlock on Bootup.";
};
};
};
config = mkIf cfg.enable (mkMerge [
{
home.file.".xinitrc".text = ''
${cfg.autoNumlock == true''
numlockx ''&
''}
${cfg.defaultSession != ""''
session=''${1:-${cfg.defaultSession}}
case $session in
awesome ) exec awesome;;
bspwm ) exec bspwm;;
cinnamon ) exec cinnamon-session;;
deepin ) exec startdde;;
dwm ) exec dwm;;
enlightenment ) exec enlightenment_start;;
fluxbox ) exec startfluxbox;;
gnome ) exec gnome-session;;
gnome-classic ) exec gnome-session --session=gnome-classic;;
i3|i3wm ) exec i3;;
jwm ) exec jwm;;
kde ) exec startkde;;
lxqt ) exec startlxqt;;
openbox ) exec openbox-session;;
mate ) exec mate-session;;
twm ) exec twm;;
xfce|xfce4 ) exec startxfce4;;
xmonad ) exec xmonad;;
xterm ) exec xterm;;
* ) 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.