nixos-old/i3/config.nix

201 lines
5.4 KiB
Nix

{ pkgs, lib, config, ... }:
let
mod = "Mod4";
term = "kitty";
color_bg = "#${config.color.background}";
color_fg = "#${config.color.foreground}";
color_active = "#${config.color.green}";
color_inactive = "#${config.color.cyan}";
color_indicator = "#${config.color.magenta}";
color_evil = "#${config.color.red}";
in
{
home-manager.users.zoe.xsession.windowManager.i3.config = {
modifier = mod;
terminal = term;
menu =
"exec rofi -combi-modi window#drun#ssh -show-icons -show combi -modi combi";
fonts = {
names = [ "CaskaydiaCove Nerd Font" ];
size = 11.0;
};
colors = {
background = color_bg;
focused = {
background = color_bg;
border = color_active;
childBorder = color_active;
indicator = color_indicator;
text = color_fg;
};
focusedInactive = {
background = color_bg;
border = color_inactive;
childBorder = color_inactive;
indicator = color_indicator;
text = color_fg;
};
unfocused = {
background = color_bg;
border = color_inactive;
childBorder = color_inactive;
indicator = color_indicator;
text = color_fg;
};
urgent = {
background = color_bg;
border = color_evil;
childBorder = color_evil;
indicator = color_indicator;
text = color_fg;
};
};
keybindings = lib.mkOptionDefault {
# launch things
## calculator
"${mod}+c" = "exec rofi -show calc";
## emoji
"${mod}+period" = "exec kaokao | xclip -selection clipboard";
## THE PICTURES
"${mod}+s" = "exec flameshot gui --clipboard";
## find mouse cursor
"${mod}+x" =
"exec find-cursor --color '#282828' -o 2 --outline-color '#EBDBB2'";
## modes
"${mod}+r" = "mode resize";
"${mod}+b" = "mode brightness";
"${mod}+m" = "mode media";
"${mod}+w" = "mode move";
"${mod}+v" = "mode focus";
## workspaces
"${mod}+Tab" = "workspace next";
"${mod}+q" = "exec i3layouts-rofi";
## tablet to next screen
"${mod}+p" = "exec xsetwacom set 'Wacom Intuos S 2 Pen stylus' MapToOutput next";
};
modes = {
resize = {
Escape = "mode default";
v = "mode focus";
w = "mode move";
j = "resize grow height 10 px or 10 ppt";
l = "resize shrink width 10 px or 10 ppt";
h = "resize grow width 10 px or 10 ppt";
k = "resize shrink height 10 px or 10 ppt";
};
brightness = {
Escape = "mode default";
k = "exec /etc/nixos/i3/brightness.py 100+";
j = "exec /etc/nixos/i3/brightness.py 100-";
};
media = {
Escape = "mode default";
j = "exec --no-startup-id python3 /etc/nixos/i3/volume.py 5%-";
k = "exec --no-startup-id python3 /etc/nixos/i3/volume.py 5%+";
m = "exec --no-startup-id amixer set Master toggle";
n = "exec --no-startup-id amixer set Capture toggle";
p = "exec --no-startup-id playerctld shift";
space = "exec python3 /etc/nixos/i3/play_pause.py";
l = "exec playerctl next";
h = "exec playerctl previous";
};
move = {
Escape = "mode default";
v = "mode focus";
r = "mode resize";
j = "exec i3l move down";
k = "exec i3l move up";
h = "exec i3l move left";
l = "exec i3l move right";
s = "exec i3l swap container with previous";
};
focus = {
Escape = "mode default";
w = "mode move";
r = "mode resize";
h = "focus left";
j = "focus down";
k = "focus up";
l = "focus right";
};
};
window = {
titlebar = false;
border = 4;
};
gaps = {
inner = 0;
outer = 0;
};
bars = [{
position = "top";
command = "i3bar";
statusCommand =
"i3status-rs $HOME/.config/i3status-rust/config-main.toml";
fonts = {
names = [ "CaskaydiaCove Nerd Font" ];
size = 11.0;
};
colors = {
background = color_bg;
activeWorkspace = {
border = color_active;
background = color_bg;
text = color_active;
};
inactiveWorkspace = {
border = color_bg;
background = color_bg;
text = color_inactive;
};
focusedWorkspace = {
border = color_active;
background = color_active;
text = color_bg;
};
bindingMode = {
background = color_bg;
border = color_bg;
text = color_fg;
};
};
}];
startup = [
{
command = "--no-startup-id feh --bg-scale /etc/nixos/wallpaper.png";
always = true;
}
{
command = "picom --experimental-backends";
always = true;
}
{
command = "--no-startup-id i3-layouts";
always = true;
}
];
};
home-manager.users.zoe.xsession.windowManager.i3.extraConfig = ''
set $i3l companion to workspace 1
set $i3l companion to workspace 2
set $i3l companion to workspace 3
set $i3l companion to workspace 4
set $i3l companion to workspace 5
set $i3l companion to workspace 6
set $i3l companion to workspace 7
set $i3l companion to workspace 8
set $i3l companion to workspace 9
set $i3l companion to workspace 10
'';
}