nix/programs/i3.nix
2024-06-15 21:59:32 +02:00

157 lines
5.2 KiB
Nix

{ pkgs, ... }:
{
enable = true;
config = rec {
assigns = {
"2" = [
{ class = "discord"; }
{ class = "SchildiChat"; }
{ class = "element"; }
];
};
window = {
titlebar = false;
border = 1;
};
gaps = {
inner = 0;
outer = 0;
};
floating.criteria = [
{ class = "zenity"; }
{ class = "fceux"; }
{ title = "Friends List"; } # steam
];
fonts = {
names = ["JetBrains Mono NL"];
size = 10.0;
};
bars = [{
inherit fonts;
trayOutput = "primary";
statusCommand = "${pkgs.i3status}/bin/i3status";
}];
defaultWorkspace = "workspace number 1";
workspaceOutputAssign = [
{ workspace = "1"; output = "DP-3"; }
{ workspace = "2"; output = "HDMI-3"; }
];
focus = {
followMouse = true;
mouseWarping = true;
};
modes = {
resize = {
"Left" = "resize shrink width 10 px or 10 ppt";
"Right" = "resize grow width 10 px or 10 ppt";
"Up" = "resize shrink height 10 px or 10 ppt";
"Down" = "resize grow height 10 px or 10 ppt";
"Escape" = "mode default";
};
};
startup = [
{ command = "picom &"; notification = false; }
{ command = "mpd &"; notification = false; }
{ command = "dunst &"; notification = false; }
{ command = "flameshot &"; notification = false; }
# { command = "lcd-bar startdaemon 192.168.1.12 &"; notification = false; }
# { command = "lcd-bar-status &"; notification = false; }
{ command = "i3bar-mouse &"; notification = false; }
# { command = "hydration.sh &"; notification = false; }
{ command = "i3-msg \"workspace 2; append_layout ~/.config/i3/workspace2.json\""; notification = false; }
{ command = "discord &"; notification = false; }
{ command = "element-desktop &"; notification = false; }
{ command = "xrandr --output DP-3 --mode 1920x1080 --rate 239.76 --primary --output HDMI-3 --mode 1920x1080 --rate 74.97 --right-of DP-3 &"; notification = false; }
{ command = "sleep 1 && i3-msg \"workspace 1\""; notification = false; }
];
modifier = "Mod4";
floating.modifier = "Mod4";
keybindings =
let
mod = modifier;
in {
# Program keybinds
"${mod}+Return" = "exec --no-startup-id alacritty";
"${mod}+Shift+s" = "exec --no-startup-id flameshot gui";
"${mod}+b" = "exec --no-startup-id firefox";
"${mod}+d" = "exec --no-startup-id rofi -show drun";
# Volume control
"Ctrl+F9" = "exec --no-startup-id pamixer --toggle-mute";
"Ctrl+F10" = "exec --no-startup-id pamixer --decrease 5";
"Ctrl+F11" = "exec --no-startup-id pamixer --increase 5";
# MPD controls
# "Ctrl+F5" = "exec ~/music/select_music.sh";
# "Ctrl+F6" = "exec mpc prev";
# "Ctrl+F7" = "exec mpc toggle";
# "Ctrl+F8" = "exec mpc next";
# "Ctrl+Shift+F6" = "exec mpc seek -3";
# "Ctrl+Shift+F7" = "exec mpc clear";
# "Ctrl+Shift+F8" = "exec mpc seek +3";
# "Ctrl+Shift+F10" = ''exec mpc volume -5 && dunstify "mpc $(mpc volume)" -r 420'';
# "Ctrl+Shift+F11" = ''exec mpc volume +5 && dunstify "mpc $(mpc volume)" -r 420'';
# General i3 keybindings
"${mod}+f" = "fullscreen toggle";
"${mod}+r" = "mode resize";
"${mod}+Shift+q" = "kill";
"${mod}+k" = "exec xkill";
"${mod}+Shift+r" = "restart";
"${mod}+Shift+e" = "exec --no-startup-id i3-nagbar -t warning -m 'exit?' -b 'yes' 'i3-msg exit'";
"${mod}+Left" = "focus left";
"${mod}+Right" = "focus right";
"${mod}+Up" = "focus up";
"${mod}+Down" = "focus down";
"${mod}+Shift+Left" = "move left";
"${mod}+Shift+Right" = "move right";
"${mod}+Shift+Up" = "move up";
"${mod}+Shift+Down" = "move down";
"${mod}+q" = "layout stacking";
"${mod}+w" = "layout tabbed";
"${mod}+e" = "layout toggle split";
"${mod}+Shift+space" = "floating toggle";
"${mod}+space" = "focus mode_toggle";
"${mod}+1" = "workspace number 1";
"${mod}+2" = "workspace number 2";
"${mod}+3" = "workspace number 3";
"${mod}+4" = "workspace number 4";
"${mod}+5" = "workspace number 5";
"${mod}+6" = "workspace number 6";
"${mod}+7" = "workspace number 7";
"${mod}+8" = "workspace number 8";
"${mod}+9" = "workspace number 9";
"${mod}+0" = "workspace number 10";
"${mod}+Shift+1" = "move container to workspace number 1";
"${mod}+Shift+2" = "move container to workspace number 2";
"${mod}+Shift+3" = "move container to workspace number 3";
"${mod}+Shift+4" = "move container to workspace number 4";
"${mod}+Shift+5" = "move container to workspace number 5";
"${mod}+Shift+6" = "move container to workspace number 6";
"${mod}+Shift+7" = "move container to workspace number 7";
"${mod}+Shift+8" = "move container to workspace number 8";
"${mod}+Shift+9" = "move container to workspace number 9";
"${mod}+Shift+0" = "move container to workspace number 10";
};
};
}