tree-wide change. seperated config from 'real' modles.
This commit is contained in:
		
							parent
							
								
									3eee4e105d
								
							
						
					
					
						commit
						a0c1ad0beb
					
				
					 59 changed files with 377 additions and 424 deletions
				
			
		
							
								
								
									
										247
									
								
								configs/nixos/i3/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										247
									
								
								configs/nixos/i3/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,247 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  services.accounts-daemon.enable = true;
 | 
			
		||||
  services.displayManager = {
 | 
			
		||||
    defaultSession = "none+i3";
 | 
			
		||||
    autoLogin = {
 | 
			
		||||
      user = config.host.user;
 | 
			
		||||
      enable = true;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
  services.xserver = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    windowManager.i3.enable = true;
 | 
			
		||||
    displayManager.lightdm = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      greeters.gtk.enable = false;
 | 
			
		||||
      greeter.enable = false;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
  home-manager.users.${config.host.user} = {config, ...}: {
 | 
			
		||||
    home.packages = with pkgs; [
 | 
			
		||||
      maim
 | 
			
		||||
      brightnessctl
 | 
			
		||||
      arandr
 | 
			
		||||
      dex
 | 
			
		||||
    ];
 | 
			
		||||
    services.playerctld.enable = true;
 | 
			
		||||
    xsession.enable = true;
 | 
			
		||||
    xsession.windowManager.i3 = let
 | 
			
		||||
      mod = "Mod4";
 | 
			
		||||
 | 
			
		||||
      ws1 = "1";
 | 
			
		||||
      ws2 = "2";
 | 
			
		||||
      ws3 = "3";
 | 
			
		||||
      ws4 = "4";
 | 
			
		||||
      ws5 = "5";
 | 
			
		||||
      ws6 = "6";
 | 
			
		||||
      ws7 = "7";
 | 
			
		||||
      ws8 = "8";
 | 
			
		||||
      ws9 = "9";
 | 
			
		||||
      ws10 = "10";
 | 
			
		||||
    in {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      config = {
 | 
			
		||||
        modifier = mod;
 | 
			
		||||
        terminal = "kitty";
 | 
			
		||||
        menu = "rofi -show drun";
 | 
			
		||||
        defaultWorkspace = "workspace ${ws1}";
 | 
			
		||||
        keybindings = {
 | 
			
		||||
          "${mod}+Return" = "exec ${config.xsession.windowManager.i3.config.terminal}";
 | 
			
		||||
          "${mod}+d" = "exec ${config.xsession.windowManager.i3.config.menu}";
 | 
			
		||||
          "${mod}+Shift+q" = "kill";
 | 
			
		||||
 | 
			
		||||
          "${mod}+h" = "focus left";
 | 
			
		||||
          "${mod}+j" = "focus down";
 | 
			
		||||
          "${mod}+k" = "focus up";
 | 
			
		||||
          "${mod}+l" = "focus right";
 | 
			
		||||
 | 
			
		||||
          "${mod}+Shift+h" = "move left";
 | 
			
		||||
          "${mod}+Shift+j" = "move down";
 | 
			
		||||
          "${mod}+Shift+k" = "move up";
 | 
			
		||||
          "${mod}+Shift+l" = "move right";
 | 
			
		||||
 | 
			
		||||
          "${mod}+Left" = "focus left";
 | 
			
		||||
          "${mod}+Down" = "focus down";
 | 
			
		||||
          "${mod}+Up" = "focus up";
 | 
			
		||||
          "${mod}+Right" = "focus right";
 | 
			
		||||
 | 
			
		||||
          "${mod}+Shift+Left" = "move left";
 | 
			
		||||
          "${mod}+Shift+Down" = "move down";
 | 
			
		||||
          "${mod}+Shift+Up" = "move up";
 | 
			
		||||
          "${mod}+Shift+Right" = "move right";
 | 
			
		||||
 | 
			
		||||
          "${mod}+Shift+semicolon" = "split v";
 | 
			
		||||
          "${mod}+Shift+backslash" = "split h";
 | 
			
		||||
          "${mod}+f" = "fullscreen toggle";
 | 
			
		||||
 | 
			
		||||
          "${mod}+e" = "layout stacking";
 | 
			
		||||
          "${mod}+r" = "layout tabbed";
 | 
			
		||||
          "${mod}+t" = "layout toggle split";
 | 
			
		||||
 | 
			
		||||
          "${mod}+Shift+space" = "floating toggle";
 | 
			
		||||
          "${mod}+space" = "focus mode_toggle";
 | 
			
		||||
 | 
			
		||||
          "${mod}+a" = "focus parent";
 | 
			
		||||
 | 
			
		||||
          "${mod}+Shift+o" = "move scratchpad";
 | 
			
		||||
          "${mod}+o" = "scratchpad show";
 | 
			
		||||
 | 
			
		||||
          "${mod}+1" = "workspace ${ws1}";
 | 
			
		||||
          "${mod}+2" = "workspace ${ws2}";
 | 
			
		||||
          "${mod}+3" = "workspace ${ws3}";
 | 
			
		||||
          "${mod}+4" = "workspace ${ws4}";
 | 
			
		||||
          "${mod}+5" = "workspace ${ws5}";
 | 
			
		||||
          "${mod}+6" = "workspace ${ws6}";
 | 
			
		||||
          "${mod}+7" = "workspace ${ws7}";
 | 
			
		||||
          "${mod}+8" = "workspace ${ws8}";
 | 
			
		||||
          "${mod}+9" = "workspace ${ws9}";
 | 
			
		||||
          "${mod}+0" = "workspace ${ws10}";
 | 
			
		||||
 | 
			
		||||
          "${mod}+Shift+1" = "move container to workspace ${ws1}";
 | 
			
		||||
          "${mod}+Shift+2" = "move container to workspace ${ws2}";
 | 
			
		||||
          "${mod}+Shift+3" = "move container to workspace ${ws3}";
 | 
			
		||||
          "${mod}+Shift+4" = "move container to workspace ${ws4}";
 | 
			
		||||
          "${mod}+Shift+5" = "move container to workspace ${ws5}";
 | 
			
		||||
          "${mod}+Shift+6" = "move container to workspace ${ws6}";
 | 
			
		||||
          "${mod}+Shift+7" = "move container to workspace ${ws7}";
 | 
			
		||||
          "${mod}+Shift+8" = "move container to workspace ${ws8}";
 | 
			
		||||
          "${mod}+Shift+9" = "move container to workspace ${ws9}";
 | 
			
		||||
          "${mod}+Shift+0" = "move container to workspace ${ws10}";
 | 
			
		||||
 | 
			
		||||
          "${mod}+Shift+n" = "reload";
 | 
			
		||||
          "${mod}+Shift+r" = "restart";
 | 
			
		||||
          "${mod}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
 | 
			
		||||
 | 
			
		||||
          "${mod}+ctrl+r" = "mode resize";
 | 
			
		||||
 | 
			
		||||
          # disable screen going to sleep with mod+b, enable screen going to sleep with mod+shift+b
 | 
			
		||||
          "${mod}+b" = ''
 | 
			
		||||
            exec --no-startup-id "xset s off -dpms; dunstify --timeout=500 'screen blanking off'"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+shift+b" = ''
 | 
			
		||||
            exec --no-startup-id "xset +dpms; dunstify --timeout=500 'screen blanking on'"
 | 
			
		||||
          '';
 | 
			
		||||
          # change brightness
 | 
			
		||||
          "${mod}+control+plus" = ''
 | 
			
		||||
            exec --no-startup-id "brightnessctl s +1%; dunstify -h string:x-dunst-stack-tag:brightness --timeout=500 Brightness\ $(brightnessctl -m | cut --delimiter=, -f 4)"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+control+minus" = ''
 | 
			
		||||
            exec --no-startup-id "brightnessctl s 1%-; dunstify -h string:x-dunst-stack-tag:brightness --timeout=500 Brightness\ $(brightnessctl -m | cut --delimiter=, -f 4)"
 | 
			
		||||
          '';
 | 
			
		||||
 | 
			
		||||
          #screenshot everything with mod+s, current window with mod+shift+s, selection with mod+ctrl+s
 | 
			
		||||
          "${mod}+s" = ''
 | 
			
		||||
            exec --no-startup-id "maim ~/Pictures/$(date +%s).png; dunstify --timeout=1000 'Whole-desktop screenshot taken'"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+shift+s" = ''
 | 
			
		||||
            exec --no-startup-id "maim -i $(xdotool getactivewindow) ~/Pictures/$(date +%s).png; dunstify --timeout=1000 'Window screenshot taken'"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+ctrl+s" = ''
 | 
			
		||||
            exec --no-startup-id "maim -s ~/Pictures/$(date +%s).png; dunstify --timeout=1000 'Selection screenshot taken'"
 | 
			
		||||
          '';
 | 
			
		||||
 | 
			
		||||
          #screenshot everything with mod+c, current window with mod+shift+c, selection with mod+ctrl+c (to clipboard)
 | 
			
		||||
          "${mod}+c" = ''
 | 
			
		||||
            exec --no-startup-id "maim | xclip -selection clipboard -t image/png; dunstify --timeout=1000 'Whole-desktop screenshot taken to clipboard'"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+shift+c" = ''
 | 
			
		||||
            exec --no-startup-id "maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png; dunstify --timeout=1000 'Window screenshot taken to clipboard'"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+ctrl+c" = ''
 | 
			
		||||
            exec --no-startup-id "maim -s | xclip -selection clipboard -t image/png; dunstify --timeout=1000 'Selection screenshot taken to clipboard'"
 | 
			
		||||
          '';
 | 
			
		||||
 | 
			
		||||
          "${mod}+mod1+p" = ''
 | 
			
		||||
            exec --no-startup-id "playerctl play-pause; dunstify -h string:x-dunst-stack-tag:playerstatus --timeout=500 Player $(playerctl status)"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+mod1+plus" = ''
 | 
			
		||||
            exec --no-startup-id "playerctl volume 0.01+; dunstify -h string:x-dunst-stack-tag:volume --timeout=500 -h int:value:$(playerctl volume | cut -d' ' -f2 | awk '{print $1*100}' ) Player"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+mod1+minus" = ''
 | 
			
		||||
            exec --no-startup-id "playerctl volume 0.01-; dunstify -h string:x-dunst-stack-tag:volume --timeout=500 -h int:value:$(playerctl volume | cut -d' ' -f2 | awk '{print $1*100}' ) Player"
 | 
			
		||||
          '';
 | 
			
		||||
 | 
			
		||||
          #open volume control
 | 
			
		||||
          "${mod}+shift+p" = ''exec pwvucontrol'';
 | 
			
		||||
 | 
			
		||||
          #volume control
 | 
			
		||||
          "${mod}+plus" = ''
 | 
			
		||||
            exec --no-startup-id "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; dunstify --timeout=1000 -h string:x-dunst-stack-tag:volume -h int:value:$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -d' ' -f2 | awk '{print $1*100}' ) Volume"
 | 
			
		||||
          '';
 | 
			
		||||
          "${mod}+minus" = ''
 | 
			
		||||
            exec --no-startup-id "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-; dunstify --timeout=1000 -h string:x-dunst-stack-tag:volume -h int:value:$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -d' ' -f2 | awk '{print $1*100}' ) Volume"
 | 
			
		||||
          '';
 | 
			
		||||
 | 
			
		||||
          #open firefox
 | 
			
		||||
          "${mod}+w" = ''exec firefox'';
 | 
			
		||||
        };
 | 
			
		||||
        modes = {
 | 
			
		||||
          resize = {
 | 
			
		||||
            "Left" = "resize shrink width 10 px or 10 ppt";
 | 
			
		||||
            "Down" = "resize grow height 10 px or 10 ppt";
 | 
			
		||||
            "Up" = "resize shrink height 10 px or 10 ppt";
 | 
			
		||||
            "Right" = "resize grow width 10 px or 10 ppt";
 | 
			
		||||
            "Escape" = "mode default";
 | 
			
		||||
            "Return" = "mode default";
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
        gaps = {
 | 
			
		||||
          inner = 5;
 | 
			
		||||
          smartBorders = "on";
 | 
			
		||||
          smartGaps = true;
 | 
			
		||||
        };
 | 
			
		||||
        fonts = {
 | 
			
		||||
          names = ["Fira Code"];
 | 
			
		||||
          size = 8.0;
 | 
			
		||||
        };
 | 
			
		||||
        floating = {
 | 
			
		||||
          modifier = mod;
 | 
			
		||||
          # you can find window class names with xprop.
 | 
			
		||||
          criteria = [
 | 
			
		||||
            {class = "pwvucontrol";}
 | 
			
		||||
            {class = "helvum";}
 | 
			
		||||
          ];
 | 
			
		||||
        };
 | 
			
		||||
        startup = [
 | 
			
		||||
          {
 | 
			
		||||
            command = "betterlockscreen --lock blur";
 | 
			
		||||
            notification = false;
 | 
			
		||||
            always = false;
 | 
			
		||||
          }
 | 
			
		||||
          {
 | 
			
		||||
            command = "betterlockscreen --wall";
 | 
			
		||||
            notification = false;
 | 
			
		||||
            always = true;
 | 
			
		||||
          }
 | 
			
		||||
          {
 | 
			
		||||
            command = "dex --autostart";
 | 
			
		||||
            notification = false;
 | 
			
		||||
            always = false;
 | 
			
		||||
          }
 | 
			
		||||
          # {
 | 
			
		||||
          #   command = "~/.fehbg";
 | 
			
		||||
          #   notification = false;
 | 
			
		||||
          #   always = true;
 | 
			
		||||
          # }
 | 
			
		||||
        ];
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    imports = [
 | 
			
		||||
      ../../home-manager/kitty.nix
 | 
			
		||||
      ../../home-manager/rofi.nix
 | 
			
		||||
      ../../home-manager/dunst.nix
 | 
			
		||||
      ../../home-manager/feh.nix
 | 
			
		||||
      ../../home-manager/picom.nix
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../sound.nix
 | 
			
		||||
    ./i3status-rust.nix
 | 
			
		||||
    ./lockscreen.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										92
									
								
								configs/nixos/i3/i3status-rust.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								configs/nixos/i3/i3status-rust.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,92 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  home-manager.users.${config.host.user} = {
 | 
			
		||||
    config,
 | 
			
		||||
    osConfig,
 | 
			
		||||
    lib,
 | 
			
		||||
    ...
 | 
			
		||||
  }: {
 | 
			
		||||
    xsession.windowManager.i3.config.bars = [
 | 
			
		||||
      {
 | 
			
		||||
        fonts = {
 | 
			
		||||
          names = ["FiraCode Nerd Font"];
 | 
			
		||||
          style = "Mono";
 | 
			
		||||
          size = 10.0;
 | 
			
		||||
        };
 | 
			
		||||
        position = "bottom";
 | 
			
		||||
        statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml";
 | 
			
		||||
      }
 | 
			
		||||
    ];
 | 
			
		||||
    programs.i3status-rust = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      bars = {
 | 
			
		||||
        default = {
 | 
			
		||||
          blocks = [
 | 
			
		||||
            {
 | 
			
		||||
              block = "music";
 | 
			
		||||
              format = "{$icon $combo.str(max_w:25,rot_interval:0.5) $play $prev $next $player.str(max_w:5,rot_interval:0.5) [$cur/$avail]|}";
 | 
			
		||||
            }
 | 
			
		||||
            {
 | 
			
		||||
              block = "memory";
 | 
			
		||||
              format = "$icon $mem_used_percents";
 | 
			
		||||
              format_alt = "$icon $swap_used_percents (swap)";
 | 
			
		||||
            }
 | 
			
		||||
            {
 | 
			
		||||
              block = "cpu";
 | 
			
		||||
              interval = 1;
 | 
			
		||||
            }
 | 
			
		||||
            {
 | 
			
		||||
              block = "load";
 | 
			
		||||
              format = "$icon $1m";
 | 
			
		||||
              interval = 1;
 | 
			
		||||
            }
 | 
			
		||||
            (
 | 
			
		||||
              lib.mkIf
 | 
			
		||||
              (!osConfig.host.isVm)
 | 
			
		||||
              {
 | 
			
		||||
                block = "backlight";
 | 
			
		||||
                missing_format = "";
 | 
			
		||||
              }
 | 
			
		||||
            )
 | 
			
		||||
            (
 | 
			
		||||
              lib.mkIf (osConfig.host.isLaptop)
 | 
			
		||||
              {
 | 
			
		||||
                block = "battery";
 | 
			
		||||
                driver = "upower";
 | 
			
		||||
                device = "DisplayDevice";
 | 
			
		||||
                format = "$icon $percentage {$time|}";
 | 
			
		||||
              }
 | 
			
		||||
            )
 | 
			
		||||
            {
 | 
			
		||||
              block = "net";
 | 
			
		||||
              format = "$icon {$signal_strength $ssid.str(max_w:5,rot_interval:0.5)|}";
 | 
			
		||||
              format_alt = "$icon {$signal_strength $ssid.str(max_w:5,rot_interval:0.5) $frequency|} ipv4-$ip ipv6-$ipv6 via $device";
 | 
			
		||||
            }
 | 
			
		||||
            {
 | 
			
		||||
              block = "sound";
 | 
			
		||||
              format = "$icon {$volume.bar(v:true) $volume.eng(w:2)|}";
 | 
			
		||||
              headphones_indicator = true;
 | 
			
		||||
              click = [
 | 
			
		||||
                {
 | 
			
		||||
                  button = "left";
 | 
			
		||||
                  cmd = "pwvucontrol";
 | 
			
		||||
                }
 | 
			
		||||
              ];
 | 
			
		||||
            }
 | 
			
		||||
            {
 | 
			
		||||
              block = "time";
 | 
			
		||||
              format = "$timestamp.datetime(f:'%F %R')";
 | 
			
		||||
              interval = 60;
 | 
			
		||||
            }
 | 
			
		||||
          ];
 | 
			
		||||
          theme = "gruvbox-dark";
 | 
			
		||||
          icons = "material-nf";
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								configs/nixos/i3/lockscreen.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								configs/nixos/i3/lockscreen.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  environment.systemPackages = with pkgs; [
 | 
			
		||||
    betterlockscreen
 | 
			
		||||
  ];
 | 
			
		||||
  home-manager.users.${config.host.user} = {
 | 
			
		||||
    config,
 | 
			
		||||
    osConfig,
 | 
			
		||||
    lib,
 | 
			
		||||
    ...
 | 
			
		||||
  }: {
 | 
			
		||||
    xsession.windowManager.i3.config = {
 | 
			
		||||
      keybindings = let
 | 
			
		||||
        mod = config.xsession.windowManager.i3.config.modifier;
 | 
			
		||||
      in {
 | 
			
		||||
        "${mod}+x" = ''
 | 
			
		||||
          exec --no-startup-id betterlockscreen --lock blur
 | 
			
		||||
        '';
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    imports = [
 | 
			
		||||
      ../../home-manager/feh.nix
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue