diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-23 17:36:20 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-23 17:36:53 +0100 |
commit | 0946b5e1a42b5cb64c5b78a33dd89f3647d43903 (patch) | |
tree | 1db2900ef52cabcca00de33c6dd7ae7b1d68bb30 /infra/libkookie/modules/workstation/ui/i3/core/setup.nix | |
parent | 93bda8ccf0fa2c3db7d3ab570ec49066bdc66249 (diff) |
libkookie: net: init module to handle networking configuration
Diffstat (limited to 'infra/libkookie/modules/workstation/ui/i3/core/setup.nix')
-rw-r--r-- | infra/libkookie/modules/workstation/ui/i3/core/setup.nix | 77 |
1 files changed, 45 insertions, 32 deletions
diff --git a/infra/libkookie/modules/workstation/ui/i3/core/setup.nix b/infra/libkookie/modules/workstation/ui/i3/core/setup.nix index 80d1827d881c..76b4b61ac696 100644 --- a/infra/libkookie/modules/workstation/ui/i3/core/setup.nix +++ b/infra/libkookie/modules/workstation/ui/i3/core/setup.nix @@ -8,6 +8,8 @@ { config, lib, pkgs, home-manager, ... } @ args: +let cfg = config.libkookie.ui.i3; +in { xsession.windowManager.i3 = let config = (import ./config.nix args); @@ -19,39 +21,50 @@ # TODO: move this into the config module? - extraConfig = with pkgs; '' - # Setup compositor - exec_always --no-startup-id "${coreutils}/bin/pkill picom; ${picom}/bin/picom --config ~/.config/i3/picom.conf" - - # Make CAPSLOCK into ESC because it's 2018 - # - # Okay actually this is slightly more complicated than that. I'm binding - # CAPSLOCK to HYPER, so that I can use it as a modifier in emacs, but then - # using xcape(1) to also make short CAPSLOCK presses into ESCAPE. - - exec_always --no-startup-id "${xorg.xmodmap}/bin/setxkbmap -layout us -variant altgr-intl -option caps:hyper" - exec ${xcape}/bin/xcape -e "#66=Escape" -t 150 - - # Always set a wallpaper - # exec_always --no-startup-id ${feh}/bin/feh --bg-fill config.libkookie.ui.i3.wallpaper ????? - - bar { - status_command ${i3status}/bin/i3status -c ~/.config/i3/i3status.conf - position bottom - bindsym button4 nop - bindsym button5 nop - colors { - background #0F0F0F - statusline #D5D5D5 + extraConfig = with pkgs; + let + fehCmd = "${feh}/bin/feh --bg-fill ${cfg.wallpaper}"; + picomCmd = ""; + nmCmd = if cfg.networkmanager + then "exec_always --no-startup-id ${networkmanagerapplet}/bin/nm-applet" + else ""; + in + '' + # Setup compositor // TODO: gate this on the hm-module + exec_always --no-startup-id "${coreutils}/bin/pkill picom; ${picom}/bin/picom --config ~/.config/i3/picom.conf" + + # Make CAPSLOCK into ESC because it's 2018 + # + # Okay actually this is slightly more complicated than that. I'm binding + # CAPSLOCK to HYPER, so that I can use it as a modifier in emacs, but then + # using xcape(1) to also make short CAPSLOCK presses into ESCAPE. + + exec_always --no-startup-id "${xorg.xmodmap}/bin/setxkbmap -layout us -variant altgr-intl -option caps:hyper" + exec ${xcape}/bin/xcape -e "#66=Escape" -t 150 + + # Set the desired wallpaper + exec_always --no-startup-id ${fehCmd} + + # Start nm-applet if networkmanager is enabled + ${nmCmd} + + bar { + status_command ${i3status}/bin/i3status -c ~/.config/i3/i3status.conf + position bottom + bindsym button4 nop + bindsym button5 nop + colors { + background #0F0F0F + statusline #D5D5D5 + } } - } - - focus_follows_mouse no - - # Layout and design settings that should _really_ be in the module - default_border pixel 3 - client.focused #4c7899 #285577 #ffffff #F73E5F #666666 - ''; + + focus_follows_mouse no + + # Layout and design settings that should _really_ be in the module + default_border pixel 3 + client.focused #4c7899 #285577 #ffffff #F73E5F #666666 + ''; }; xdg.configFile."i3/picom.conf" = (import ./picom.nix args); |