2022-04-25 02:26:57 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.this.application.i3;
|
|
|
|
graphical = config.this.graphical;
|
|
|
|
modifier = "Mod4";
|
|
|
|
wallpaper = pkgs.fetchurl {
|
|
|
|
url =
|
|
|
|
"https://raw.githubusercontent.com/catppuccin/wallpapers/main/landscapes/evening-sky.png";
|
|
|
|
sha256 = "sha256-fYMzoY3un4qGOSR4DMqVUAFmGGil+wUze31rLLrjcAc=";
|
|
|
|
};
|
|
|
|
|
|
|
|
in with lib; {
|
|
|
|
options = {
|
|
|
|
this.application.i3.enable = mkOption {
|
|
|
|
default = graphical.enable;
|
|
|
|
type = with types; bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-04-27 03:48:18 +00:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.dconf.enable = true;
|
2022-04-29 02:10:00 +00:00
|
|
|
programs.light.enable = true;
|
2022-04-27 03:48:18 +00:00
|
|
|
|
|
|
|
services.xserver = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
xkbOptions = "ctrl:nocaps";
|
|
|
|
libinput = {
|
|
|
|
enable = true;
|
|
|
|
touchpad = {
|
|
|
|
naturalScrolling = true;
|
|
|
|
clickMethod = "clickfinger";
|
|
|
|
tapping = false;
|
|
|
|
tappingDragLock = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
windowManager.i3 = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.i3-gaps;
|
|
|
|
extraPackages = with pkgs; [
|
2022-05-03 04:10:06 +00:00
|
|
|
feh
|
2022-04-27 03:48:18 +00:00
|
|
|
i3blocks # if you are planning on using i3blocks over i3status
|
2022-05-03 04:10:06 +00:00
|
|
|
i3lock # default i3 screen locker
|
|
|
|
i3status # gives you the default i3 status bar
|
|
|
|
playerctl
|
2022-07-10 04:36:59 +00:00
|
|
|
rofi
|
2022-05-03 04:10:06 +00:00
|
|
|
xclip
|
|
|
|
xdotool
|
2022-04-27 03:48:18 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-04-25 02:26:57 +00:00
|
|
|
home-manager.users.james = {
|
|
|
|
xsession.windowManager.i3 = {
|
|
|
|
enable = true;
|
2022-04-27 03:48:18 +00:00
|
|
|
package = pkgs.i3-gaps;
|
|
|
|
config = {
|
|
|
|
colors = {
|
|
|
|
focusedInactive = {
|
|
|
|
background = "#1E1E2E";
|
|
|
|
border = "#1E1E2E";
|
|
|
|
childBorder = "#1E1E2E";
|
|
|
|
indicator = "#1E1E2E";
|
|
|
|
text = "#C9CBFF";
|
|
|
|
};
|
|
|
|
unfocused = {
|
|
|
|
background = "#1E1E2E";
|
|
|
|
border = "#1E1E2E";
|
|
|
|
childBorder = "#1E1E2E";
|
|
|
|
indicator = "#1E1E2E";
|
|
|
|
text = "#C9CBFF";
|
|
|
|
};
|
|
|
|
focused = {
|
|
|
|
background = "#131020";
|
|
|
|
border = "#131020";
|
|
|
|
childBorder = "#131020";
|
|
|
|
indicator = "#131020";
|
|
|
|
text = "#ABE9B3";
|
|
|
|
};
|
|
|
|
urgent = {
|
|
|
|
background = "#F28FAD";
|
|
|
|
border = "#F28FAD";
|
|
|
|
childBorder = "#F28FAD";
|
|
|
|
indicator = "#F28FAD";
|
|
|
|
text = "#ABE9B3";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
fonts = {
|
|
|
|
names = [ "Alegreya" "FontAwesome" ];
|
|
|
|
size = 9.0;
|
|
|
|
};
|
|
|
|
gaps = {
|
|
|
|
smartBorders = "off";
|
|
|
|
smartGaps = true;
|
|
|
|
inner = 5;
|
|
|
|
outer = 2;
|
|
|
|
};
|
|
|
|
terminal = "${pkgs.kitty}/bin/kitty";
|
|
|
|
keybindings = mkOptionDefault {
|
2022-05-28 00:32:26 +00:00
|
|
|
"${modifier}+h" = "focus left";
|
2022-04-29 02:10:00 +00:00
|
|
|
"${modifier}+k" = "focus up";
|
|
|
|
"${modifier}+j" = "focus down";
|
2022-05-28 00:32:26 +00:00
|
|
|
"${modifier}+l" = "focus right";
|
|
|
|
"${modifier}+shift+h" = "move left";
|
2022-04-29 02:10:00 +00:00
|
|
|
"${modifier}+shift+k" = "move up";
|
|
|
|
"${modifier}+shift+j" = "move down";
|
2022-05-28 00:32:26 +00:00
|
|
|
"${modifier}+shift+l" = "move right";
|
2022-04-29 02:10:00 +00:00
|
|
|
|
|
|
|
"${modifier}+s" = "split h";
|
2022-04-27 03:48:18 +00:00
|
|
|
"${modifier}+q" = "kill";
|
2022-04-29 02:10:00 +00:00
|
|
|
"${modifier}+alt+s" = "layout stacking";
|
2022-04-27 03:48:18 +00:00
|
|
|
"${modifier}+d" = "focus mode_toggle";
|
|
|
|
"${modifier}+a" = "focus parent";
|
|
|
|
"${modifier}+shift+s" = "sticky toggle";
|
|
|
|
"${modifier}+shift+f" = "floating toggle";
|
2022-07-10 04:36:59 +00:00
|
|
|
"${modifier}+space" = "exec rofi -show drun";
|
2022-04-27 03:48:18 +00:00
|
|
|
Pause = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
|
|
|
XF86AudioLowerVolume = "exec ${pkgs.volume-sh}/bin/volume.sh down";
|
|
|
|
XF86AudioMute = "exec ${pkgs.volume-sh}/bin/volume.sh mute";
|
|
|
|
XF86AudioRaiseVolume = "exec ${pkgs.volume-sh}/bin/volume.sh up";
|
|
|
|
XF86MonBrightnessDown =
|
|
|
|
"exec ${pkgs.brightness-sh}/bin/brightness.sh down";
|
|
|
|
XF86MonBrightnessUp =
|
|
|
|
"exec ${pkgs.brightness-sh}/bin/brightness.sh up";
|
|
|
|
};
|
|
|
|
modifier = "Mod4";
|
|
|
|
startup = [
|
|
|
|
{ command = "${pkgs.autotiling}/bin/autotiling"; }
|
|
|
|
{ command = "${pkgs.feh}/bin/feh --bg-scale ${wallpaper}"; }
|
|
|
|
];
|
|
|
|
};
|
2022-04-25 02:26:57 +00:00
|
|
|
};
|
|
|
|
};
|
2022-04-27 03:48:18 +00:00
|
|
|
|
|
|
|
systemd.user = {
|
|
|
|
targets.i3-session = {
|
|
|
|
description = "i3 compositor session";
|
|
|
|
documentation = [ "man:systemd.special(7)" ];
|
|
|
|
bindsTo = [ "graphical-session.target" ];
|
|
|
|
wants = [ "graphical-session-pre.target" ];
|
|
|
|
after = [ "graphical-session-pre.target" ];
|
|
|
|
};
|
|
|
|
services.i3 = {
|
|
|
|
enable = true;
|
|
|
|
description = "i3 - i3 window manager";
|
|
|
|
documentation = [ "man:i3(5)" ];
|
|
|
|
bindsTo = [ "default.target" ];
|
|
|
|
wants = [ "graphical-session-pre.target" ];
|
|
|
|
after = [ "graphical-session-pre.target" ];
|
|
|
|
environment.PATH = lib.mkForce null;
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
ExecStart =
|
|
|
|
"${pkgs.dbus}/bin/dbus-run-session ${pkgs.i3}/bin/i3 --debug";
|
|
|
|
ExecStopPost =
|
|
|
|
"/usr/bin/env systemctl --user unset-environment DISPLAY I3SOCK ";
|
|
|
|
NotifyAccess = "all";
|
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = 1;
|
|
|
|
TimeoutStopSec = 10;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.james.extraGroups = [ "video" "audio" ];
|
2022-04-25 02:26:57 +00:00
|
|
|
};
|
|
|
|
}
|