mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
104 lines
3 KiB
Nix
104 lines
3 KiB
Nix
{ pkgs, lib, config, osConfig, ... }: {
|
|
options.mods.i3.enable = lib.mkEnableOption "enables i3";
|
|
|
|
config = lib.mkIf config.mods.i3.enable {
|
|
programs.rofi.enable = true;
|
|
|
|
programs.i3status-rust = {
|
|
enable = true;
|
|
bars.default = {
|
|
settings.theme.overrides = with config.lib.stylix.colors.withHashtag; {
|
|
idle_bg = base00;
|
|
idle_fg = base05;
|
|
separator = "";
|
|
};
|
|
icons = "awesome5";
|
|
blocks = [{
|
|
block = "sound";
|
|
format = " $icon $volume ";
|
|
click = [{
|
|
button = "left";
|
|
cmd = "pavucontrol";
|
|
}];
|
|
} {
|
|
block = "time";
|
|
format = "$icon $timestamp.datetime(f:'%Y-%m-%d %a %H:%M:%S') ";
|
|
interval = 1;
|
|
}];
|
|
};
|
|
};
|
|
|
|
xsession.windowManager.i3 = let
|
|
modifier = "Mod4";
|
|
wsAmount = 10;
|
|
genSpaces = f: map builtins.toString (
|
|
builtins.genList f wsAmount
|
|
);
|
|
workspaces = genSpaces (x: x+1);
|
|
|
|
in {
|
|
enable = true;
|
|
config = {
|
|
modifier = modifier;
|
|
terminal = "alacritty";
|
|
menu = "rofi -show drun";
|
|
|
|
window = {
|
|
titlebar = false;
|
|
hideEdgeBorders = "smart";
|
|
};
|
|
|
|
defaultWorkspace = "workspace number 1";
|
|
workspaceAutoBackAndForth = true;
|
|
focus.wrapping = "yes";
|
|
|
|
keybindings = let
|
|
# modKeyComb: string -> valueAction: string
|
|
# -> keys: [string] -> values: [string]
|
|
# -> keybindings: attrSet { string -> string }
|
|
zipBinds = comb: action: keys: values: (
|
|
builtins.listToAttrs (lib.zipListsWith (k: v: {
|
|
name = "${modifier}${comb}${k}";
|
|
value = "${action} ${v}";
|
|
}) keys values)
|
|
);
|
|
|
|
moveKeys = ["h" "j" "k" "l"];
|
|
moveDirs = ["left" "down" "up" "right"];
|
|
|
|
workspKeys = genSpaces (x: lib.mod (x+1) wsAmount);
|
|
|
|
in lib.mkOptionDefault (
|
|
(zipBinds "+" "focus" moveKeys moveDirs) //
|
|
(zipBinds "+Shift+" "move" moveKeys moveDirs) //
|
|
(zipBinds "+" "workspace number" workspKeys workspaces) //
|
|
(zipBinds "+Shift+" "move container to workspace number"
|
|
workspKeys workspaces) //
|
|
{
|
|
"XF86AudioRaiseVolume" =
|
|
"exec --no-startup-id pactl set-sink-volume 0 +2%";
|
|
"XF86AudioLowerVolume" =
|
|
"exec --no-startup-id pactl set-sink-volume 0 -2%";
|
|
}
|
|
);
|
|
|
|
bars = let
|
|
status_conf =
|
|
"${config.xdg.configHome}/i3status-rust/config-default.toml";
|
|
stylix_bar = {
|
|
mode = "dock";
|
|
hiddenState = "hide";
|
|
position = "bottom";
|
|
statusCommand = "${lib.getExe pkgs.i3status-rust} ${status_conf}";
|
|
command = "${pkgs.i3}/bin/i3bar";
|
|
workspaceButtons = true;
|
|
workspaceNumbers = true;
|
|
trayOutput = "primary";
|
|
} // config.lib.stylix.i3.bar;
|
|
in [
|
|
stylix_bar
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|