182 lines
7.1 KiB
Nix
Raw Normal View History

2021-09-15 18:39:02 +03:00
{ pkgs, config, lib, ... }:
2019-09-11 17:17:56 +04:00
let
2020-08-10 01:17:22 +04:00
thm = config.lib.base16.theme;
2019-09-11 17:17:56 +04:00
apps = config.defaultApplications;
2020-08-07 23:27:49 +04:00
# lock = pkgs.writeShellScript "lock" "sudo /run/current-system/sw/bin/lock";
2019-09-11 17:17:56 +04:00
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 = {
2021-08-17 23:39:07 +03:00
# "" = [
# { class = "Spotify"; }
# { class = "PulseEffects"; }
# { title = "spt"; }
# ];
2020-08-15 19:36:16 +04:00
"" = [
2019-09-11 17:17:56 +04:00
{ class = "^Telegram"; }
];
};
2021-06-14 23:31:09 +03:00
fonts = {
2021-09-16 01:03:52 +03:00
names = [ "${thm.fonts.main.family}" ];
2021-06-14 23:31:09 +03:00
style = "Regular";
2021-09-16 01:03:52 +03:00
size = thm.fontSizes.micro.float;
2021-06-14 23:31:09 +03:00
};
2019-09-11 17:17:56 +04:00
2020-02-15 03:15:10 +04:00
bars = [ ];
2021-09-15 18:39:02 +03:00
colors = rec {
background = "#${thm.base00-hex}";
2019-09-11 17:17:56 +04:00
unfocused = {
2021-09-15 18:39:02 +03:00
text = "#${thm.base02-hex}";
2020-08-10 01:17:22 +04:00
border = "#${thm.base01-hex}";
background = "#${thm.base00-hex}";
childBorder = "#${thm.base01-hex}";
2021-09-15 18:39:02 +03:00
indicator = "#${thm.base07-hex}";
2019-09-11 17:17:56 +04:00
};
2021-09-15 18:39:02 +03:00
focusedInactive = unfocused;
urgent = unfocused // {
text = "#${thm.base05-hex}";
border = "#${thm.base09-hex}";
childBorder = "#${thm.base09-hex}";
2019-09-11 17:17:56 +04:00
};
2021-09-15 18:39:02 +03:00
focused = unfocused // {
childBorder = "#${thm.base03-hex}";
border = "#${thm.base03-hex}";
background = "#${thm.base01-hex}";
2020-08-10 01:17:22 +04:00
text = "#${thm.base05-hex}";
2019-09-11 17:17:56 +04:00
};
};
2020-08-10 01:17:22 +04:00
2019-09-11 17:17:56 +04:00
gaps = {
inner = 6;
smartGaps = true;
smartBorders = "on";
};
2020-08-10 01:17:22 +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"; };
}
];
};
2021-09-15 18:38:45 +03:00
startup = lib.mkIf (!config.deviceSpecific.isISO) (map (command: { inherit command; }) config.startupApplications);
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)
2020-08-11 02:38:02 +04:00
++ [ [ "c" "" ] [ "t" "" ] ];
2020-08-07 23:27:49 +04:00
in ({
2019-09-11 17:17:56 +04:00
"${modifier}+q" = "kill";
2021-06-16 05:30:04 +03:00
"${modifier}+Shift+q" = "move container to workspace temp; [workspace=__focused__] kill; workspace temp; move container to workspace temp; workspace temp";
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}";
2020-08-07 23:27:49 +04:00
# "${modifier}+l" = "layout toggle all";
2019-09-22 16:40:16 +04:00
2020-08-11 02:38:02 +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";
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";
2020-08-07 23:27:49 +04:00
"${modifier}+Escape" = "exec ${apps.monitor.cmd}";
"${modifier}+j" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"${modifier}+k" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"${modifier}+l" = "exec ${pkgs.playerctl}/bin/playerctl next";
2020-08-15 19:36:16 +04:00
"${modifier}+m" = "exec ${pkgs.pamixer}/bin/pamixer -t";
2019-09-22 16:40:16 +04:00
2019-09-11 17:17:56 +04:00
"${modifier}+d" = "exec ${apps.fm.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";
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";
2020-08-07 23:27:49 +04:00
# "${modifier}+End" = "exec ${lock}";
2019-09-22 16:40:16 +04:00
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";
2020-08-15 19:36:16 +04:00
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5";
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5";
"XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer -t";
"${modifier}+XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 2";
"${modifier}+XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 2";
2019-09-11 17:17:56 +04:00
"--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}";
2020-08-15 19:36:16 +04:00
}) workspaces)
);
2019-09-11 17:17:56 +04:00
workspaceLayout = "tabbed";
};
2019-10-03 12:38:59 +04:00
extraConfig = ''
2020-08-07 23:27:49 +04:00
default_border pixel 1
2020-08-08 17:38:58 +04:00
hide_edge_borders smart
2020-08-07 23:27:49 +04:00
2020-08-10 01:17:22 +04:00
# Set colors
set $base00 #${thm.base00-hex}
set $base01 #${thm.base01-hex}
set $base02 #${thm.base02-hex}
set $base03 #${thm.base03-hex}
set $base04 #${thm.base04-hex}
set $base05 #${thm.base05-hex}
set $base06 #${thm.base06-hex}
set $base07 #${thm.base07-hex}
set $base08 #${thm.base08-hex}
set $base09 #${thm.base09-hex}
set $base0A #${thm.base0A-hex}
set $base0B #${thm.base0B-hex}
set $base0C #${thm.base0C-hex}
set $base0D #${thm.base0D-hex}
set $base0E #${thm.base0E-hex}
set $base0F #${thm.base0F-hex}
2019-10-03 12:38:59 +04:00
'';
2019-09-11 17:17:56 +04:00
};
}