dotfiles/hosts/strix/configs/i3.nix

140 lines
4.6 KiB
Nix
Executable file

{
pkgs,
lib,
user,
dotfilepath,
...
}:
let
scripts = "${dotfilepath}/scripts";
in
{
home-manager.users.${user}.xsession.windowManager.i3 = {
enable = true;
config = {
# disable i3 bar
bars = [ ];
# Starting compositor and adding background to xroot via nitrogen
startup = [
{
command = "nitrogen --set-zoom-fill /home/grape/dotfiles/bg.jpg";
}
{
command = "picom -b";
}
{
command = "polybar -c ~/.config/polybar/test.ini default";
}
{
command = "polybar -c ~/.config/polybar/test.ini bottom";
}
{
command = "aw-server";
}
{
command = "aw-watcher-afk";
}
{
command = "aw-watcher-window";
}
];
# defining alt as modifier
modifier = "Mod1";
gaps.inner = 12;
# TODO add colors from variables
# colors for focused windows
colors.focused = {
background = "#FAD000";
border = "#FAD000";
childBorder = "#FFF";
indicator = "#FAD000";
text = "#FAD000";
};
colors.focusedInactive = {
background = "#FAD000";
border = "#FAD000";
childBorder = "#FFF";
indicator = "#FAD000";
text = "#FAD000";
};
keybindings = lib.mkOptionDefault {
# application keybinds
"mod4+d" = "exec rofi -show drun";
"mod4+e" = "exec rofi -show calc";
"mod4+f" = "exec rofi -show emoji";
"mod4+t" = "exec alacritty";
"mod4+r" = "exec firefox";
"mod4+m" = "exec feishin";
"mod4+p" = "exec keepassxc";
# power off
"mod4+Shift+Delete" = "exec shutdown -h now";
# language settings
"mod4+1" = "exec setxkbmap us";
"mod4+2" = "exec setxkbmap hu";
# replay
"mod4+s" = "exec ${scripts}/replay_application_name.sh";
"mod4+w" = "exec ${scripts}/save_replay.sh";
"mod4+a" = "exec ${scripts}/start_replay.sh";
"mod4+x" = "exec ${scripts}/stop_replay.sh";
# picom
"mod4+o" = "exec ${scripts}/picom_opacity_toggle.sh";
# screenshot
"Print" =
"exec scrot '%Y-%m-%d_%H-%M-%S.png' -e 'mv $f ~/Pictures/screenshots && xclip -selection clipboard -t image/png -i ~/Pictures/screenshots/$f'";
"Shift+Print" =
''exec "NUM=$(echo $RANDOM) maim -s $HOME/Pictures/screenshots/$(date +%Y%m%d_%H%M)$NUM.png ; cat $HOME/Pictures/screenshots/$(date +%Y%m%d_%H%M)$NUM.png | xclip -selection clipboard -t image/png"'';
# sticky window
"Mod1+Shift+s" = "sticky toggle";
# reset for ultrawide incase any game decides to fuck it up
"mod4+u" = "exec xrandr --output DP-0 --mode 3440x1440 --rate 165";
# PLAYERCTL for mouse
"shift+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl volume 0.1+";
"shift+XF86AudioLowerVolume" = "exec --no-startup-id playerctl volume 0.1-";
"Control+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl position 10+";
"Control+XF86AudioLowerVolume" = "exec --no-startup-id playerctl position 10-";
"XF86AudioNext" = "exec --no-startup-id playerctl next";
"XF86AudioPlay" = "exec --no-startup-id playerctl play-pause";
"XF86AudioPrev" = "exec --no-startup-id playerctl previous";
# PLAYERCTL for keyboard
"Mod1+minus" = "exec --no-startup-id playerctl volume 0.1-";
"Mod1+plus" = "exec --no-startup-id playerctl volume 0.1+";
"Mod1+bracketleft" = "exec --no-startup-id playerctl position 10-";
"Mod1+bracketright" = "exec --no-startup-id playerctl position 10+";
"Mod1+l" = "exec --no-startup-id playerctl previous";
"Mod1+semicolon" = "exec --no-startup-id playerctl play-pause";
"Mod1+apostrophe" = "exec --no-startup-id playerctl next";
# adjusting system mvolume
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%";
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% ";
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle";
};
};
# disable stupid and ugly title bars
# and for some reason client.active doesnt change the colors...
extraConfig = ''
default_border pixel 4
default_floating_border pixel 1
client.focused #FAD000 #285577 #ffffff #FAD000 #FAD000
client.focused_inactive #063340 #141414 #000000 #121212 #063340
'';
};
}