dotfiles/nix/configs/i3.nix
2024-08-29 18:25:03 +02:00

126 lines
4 KiB
Nix
Executable file

{ pkgs, lib, ... }:
let
scripts = "~/.config/scripts";
in
{
home-manager.users.grape.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 default";
}
{
command = "polybar bottom";
}
];
# 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";
"mod4+g" = "exec alacritty --command btop";
# power off
"mod4+Shift+Delete" = "exec shutdown 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";
# Volume adjustment for current player
"shift+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl volume 0.1+";
"shift+XF86AudioLowerVolume" = "exec --no-startup-id playerctl volume 0.1-";
# seeking for current player
"Control+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl position 10+";
"Control+XF86AudioLowerVolume" = "exec --no-startup-id playerctl position 10-";
# track skipping n stuff
"XF86AudioNext" = "exec --no-startup-id playerctl next";
"XF86AudioPlay" = "exec --no-startup-id playerctl play-pause";
"XF86AudioPrev" = "exec --no-startup-id playerctl previous";
# 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
'';
};
}