208 lines
7.9 KiB
Nix
Raw Normal View History

2019-09-11 17:17:56 +04:00
{ pkgs, config, ... }:
let
thm = config.themes.colors;
apps = config.defaultApplications;
in {
environment.sessionVariables._JAVA_AWT_WM_NONREPARENTING = "1";
2019-09-22 16:40:16 +04:00
2019-09-11 17:17:56 +04:00
home-manager.users.alukard.xsession.windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
config = rec {
assigns = {
2020-01-26 00:20:58 +04:00
"" = [
{ class = "Spotify"; }
2020-02-12 02:35:54 +04:00
{ class = "PulseEffects"; }
{ class = "spt"; }
2020-01-26 00:20:58 +04:00
];
2019-09-11 17:17:56 +04:00
"" = [
{ class = "^Telegram"; }
{ class = "^VK"; }
{ class = "^trojita"; }
{ title = "weechat"; }
{ class = "nheko"; }
];
"" = [{ class = "cantata"; }];
};
fonts = [ "RobotoMono 9" ];
2019-09-29 20:16:29 +04:00
# colors = rec {
# background = thm.bg;
# unfocused = {
# border = thm.dark;
# background = thm.bg;
# text = thm.alt;
# indicator = thm.fg;
# childBorder = thm.dark;
# };
# focusedInactive = unfocused;
# urgent = unfocused // {
# border = thm.orange;
# text = thm.fg;
# childBorder = thm.orange;
# };
# focused = unfocused // {
# border = thm.blue;
# background = thm.dark;
# text = thm.fg;
# childBorder = thm.blue;
# };
# };
2019-09-11 17:17:56 +04:00
colors = rec {
2019-09-29 20:16:29 +04:00
background = "\$bg";
2019-09-11 17:17:56 +04:00
unfocused = {
2019-10-03 12:38:59 +04:00
border = "\$dark";
2019-09-29 20:16:29 +04:00
background = "\$bg";
2019-10-03 12:38:59 +04:00
text = "\$alt";
2019-09-29 20:16:29 +04:00
indicator = "\$fg";
2019-10-03 12:38:59 +04:00
childBorder = "\$dark";
2019-09-11 17:17:56 +04:00
};
focusedInactive = unfocused;
urgent = unfocused // {
2019-10-03 12:38:59 +04:00
border = "\$purple";
2019-09-29 20:16:29 +04:00
text = "\$fg";
2019-10-03 12:38:59 +04:00
childBorder = "\$purple";
2019-09-11 17:17:56 +04:00
};
focused = unfocused // {
2019-10-03 12:38:59 +04:00
border = "\$blue";
background = "\$dark";
2019-09-29 20:16:29 +04:00
text = "\$fg";
2019-10-03 12:38:59 +04:00
childBorder = "\$blue";
2019-09-11 17:17:56 +04:00
};
};
gaps = {
inner = 6;
smartGaps = true;
smartBorders = "on";
};
2019-09-22 16:40:16 +04:00
focus.mouseWarping = false;
2019-09-11 17:17:56 +04:00
focus.followMouse = false;
modifier = "Mod4";
window = {
border = 1;
titlebar = false;
hideEdgeBorders = "smart";
commands = [
{
command = "border pixel 2px";
criteria = { window_role = "popup"; };
}
];
};
2019-09-22 13:35:49 +04:00
startup = map (a: { notification = false; } // a) [
{ command = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources"; }
2019-10-03 12:38:59 +04:00
{ command = "${pkgs.pywal}/bin/wal -R"; }
2020-02-12 02:35:54 +04:00
{ command = "${pkgs.tdesktop}/bin/telegram-desktop"; }
{ command = "${apps.term.cmd} -e spt"; }
2020-01-26 00:20:58 +04:00
{
command =
"${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
}
{
command =
"${pkgs.keepassxc}/bin/keepassxc --keyfile=/home/alukard/.passwords.key /home/alukard/nixos-config/misc/Passwords.kdbx";
}
2019-09-22 13:35:49 +04:00
];
2019-09-11 17:17:56 +04:00
keybindings = let
2019-09-22 16:40:16 +04:00
script = name: content: "exec ${pkgs.writeScript name content}";
workspaces = (builtins.genList (x: [ (toString x) (toString x) ]) 10)
++ [ [ "c" "" ] [ "t" "" ] [ "m" "" ] ];
2019-09-23 23:53:19 +04:00
# moveMouse = ''
# "sh -c 'eval `${pkgs.xdotool}/bin/xdotool \
# getactivewindow \
# getwindowgeometry --shell`; ${pkgs.xdotool}/bin/xdotool \
# mousemove \
# $((X+WIDTH/2)) $((Y+HEIGHT/2))'"'';
2019-09-11 17:17:56 +04:00
in ({
"${modifier}+q" = "kill";
2019-09-15 00:19:40 +04:00
"${modifier}+w" = "exec ${apps.dmenu.cmd}";
2019-09-11 17:17:56 +04:00
"${modifier}+Return" = "exec ${apps.term.cmd}";
"${modifier}+e" = "exec ${apps.editor.cmd}";
2019-09-22 16:40:16 +04:00
"${modifier}+l" = "layout toggle all";
2019-09-23 23:53:19 +04:00
"${modifier}+Left" = "focus child; focus left";
"${modifier}+Right" = "focus child; focus right";
"${modifier}+Up" = "focus child; focus up";
"${modifier}+Down" = "focus child; focus down";
"${modifier}+Control+Left" = "focus parent; focus left";
"${modifier}+Control+Right" = "focus parent; focus right";
"${modifier}+Control+Up" = "focus parent; focus up";
# "${modifier}+Control+Down" = "focus parent; focus down; ${moveMouse}";
# "${modifier}+Left" = "focus child; focus left; ${moveMouse}";
# "${modifier}+Right" = "focus child; focus right; ${moveMouse}";
# "${modifier}+Up" = "focus child; focus up; ${moveMouse}";
# "${modifier}+Down" = "focus child; focus down; ${moveMouse}";
# "${modifier}+Control+Left" = "focus parent; focus left; ${moveMouse}";
# "${modifier}+Control+Right" = "focus parent; focus right; ${moveMouse}";
# "${modifier}+Control+Up" = "focus parent; focus up; ${moveMouse}";
# "${modifier}+Control+Down" = "focus parent; focus down; ${moveMouse}";
2019-09-11 17:17:56 +04:00
"${modifier}+Shift+Up" = "move up";
"${modifier}+Shift+Down" = "move down";
"${modifier}+Shift+Right" = "move right";
"${modifier}+Shift+Left" = "move left";
2019-09-22 16:40:16 +04:00
2019-09-11 17:17:56 +04:00
"${modifier}+f" = "fullscreen toggle";
"${modifier}+r" = "mode resize";
"${modifier}+Shift+f" = "floating toggle";
2019-09-22 16:40:16 +04:00
"${modifier}+j" = "focus mode_toggle";
2019-09-11 17:17:56 +04:00
"${modifier}+d" = "exec ${apps.fm.cmd}";
"${modifier}+Escape" = "exec ${apps.monitor.cmd}";
2019-09-22 16:40:16 +04:00
"${modifier}+y" = "exec ${pkgs.youtube-to-mpv}/bin/yt-mpv";
"${modifier}+Shift+y" = "exec ${pkgs.youtube-to-mpv}/bin/yt-mpv --no-video";
"${modifier}+Shift+l" = "exec ${pkgs.i3lock-fancy-rapid}/bin/i3lock-fancy-rapid 8 3";
2019-09-23 14:04:13 +04:00
2019-09-22 16:40:16 +04:00
"${modifier}+Print" = script "screenshot"
2019-11-23 22:30:04 +04:00
"${pkgs.maim}/bin/maim ~/Pictures/$(date +%s).png";
2019-09-22 16:40:16 +04:00
"${modifier}+Control+Print" = script "screenshot-copy"
"${pkgs.maim}/bin/maim | xclip -selection clipboard -t image/png";
"--release ${modifier}+Shift+Print" = script "screenshot-area"
2019-11-23 22:30:04 +04:00
"${pkgs.maim}/bin/maim -s ~/Pictures/$(date +%s).png";
2019-09-22 16:40:16 +04:00
"--release ${modifier}+Control+Shift+Print" = script "screenshot-area-copy"
"${pkgs.maim}/bin/maim -s | xclip -selection clipboard -t image/png";
2019-09-11 17:17:56 +04:00
"${modifier}+x" = "move workspace to output right";
"${modifier}+k" = "exec '${pkgs.xorg.xkill}/bin/xkill'";
2019-09-22 16:40:16 +04:00
"${modifier}+F5" = "reload";
2019-09-11 17:17:56 +04:00
"${modifier}+Shift+F5" = "exit";
"${modifier}+Shift+h" = "layout splith";
"${modifier}+Shift+v" = "layout splitv";
"${modifier}+h" = "split h";
"${modifier}+v" = "split v";
"${modifier}+F1" = "move to scratchpad";
"${modifier}+F2" = "scratchpad show";
2019-09-22 16:40:16 +04:00
"${modifier}+F11" = "output * dpms off";
"${modifier}+F12" = "output * dpms on";
2019-09-11 17:17:56 +04:00
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"--release button2" = "kill";
"--whole-window ${modifier}+button2" = "kill";
2019-09-22 16:40:16 +04:00
} // builtins.listToAttrs (builtins.map (x: {
name = "${modifier}+${builtins.elemAt x 0}";
value = "workspace ${builtins.elemAt x 1}";
}) workspaces) // builtins.listToAttrs (builtins.map (x: {
name = "${modifier}+Shift+${builtins.elemAt x 0}";
value = "move container to workspace ${builtins.elemAt x 1}";
}) workspaces));
2019-09-11 17:17:56 +04:00
keycodebindings = {
2019-09-15 00:19:40 +04:00
"122" = "exec ${pkgs.pamixer}/bin/pamixer -d 5";
"123" = "exec ${pkgs.pamixer}/bin/pamixer -i 5";
2019-09-11 17:17:56 +04:00
"121" = "exec ${pkgs.pamixer}/bin/pamixer -t";
};
workspaceLayout = "tabbed";
};
2019-10-03 12:38:59 +04:00
extraConfig = ''
set_from_resource $bg i3wm.background "{background}"
set_from_resource $fg i3wm.foreground "{foreground}"
set_from_resource $dark i3wm.color0 "{color0}"
set_from_resource $alt i3wm.color 8"{color8}"
set_from_resource $purple i3wm.color5 "{color5}"
set_from_resource $blue i3wm.color4 "{color4}"
'';
2019-09-11 17:17:56 +04:00
};
}