Update keybindings

This commit is contained in:
Alexander Bantyev 2020-08-06 11:31:36 +03:00
parent c429e84e53
commit 96bd1de3e3
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
2 changed files with 50 additions and 35 deletions

View File

@ -3,41 +3,42 @@ with import ../../../support.nix { inherit pkgs config lib; };
with lib; with lib;
let scripts = import ./scripts pkgs config; let scripts = import ./scripts pkgs config;
in { in {
home-manager.users.balsoft.wayland.windowManager.sway.config.bars = [{ home-manager.users.balsoft = {
id = "top"; wayland.windowManager.sway.config.bars = [{
colors = let id = "default";
thm = config.themes.colors; command = "true";
default = { colors = let
thm = config.themes.colors;
default = {
background = thm.bg;
border = thm.bg;
};
in {
background = thm.bg; background = thm.bg;
border = thm.bg; statusline = thm.fg;
separator = thm.alt;
focusedWorkspace = default // { text = thm.red; };
activeWorkspace = default // { text = thm.green; };
inactiveWorkspace = default // { text = thm.fg; };
urgentWorkspace = default // { text = thm.orange; };
bindingMode = default // { text = thm.yellow; };
}; };
in { statusCommand = "${pkgs.i3blocks}/bin/i3blocks";
background = thm.bg; fonts = [ "IBM Plex Mono 11" "Material Icons 11" "Roboto Mono 11" ];
statusline = thm.fg; mode = "hide";
separator = thm.alt; position = "bottom";
focusedWorkspace = default // { text = thm.red; };
activeWorkspace = default // { text = thm.green; };
inactiveWorkspace = default // { text = thm.fg; };
urgentWorkspace = default // { text = thm.orange; };
bindingMode = default // { text = thm.yellow; };
};
statusCommand = "${pkgs.i3blocks}/bin/i3blocks";
fonts = [ "IBM Plex Mono 11" "Material Icons 11" "Roboto Mono 11" ];
mode = "hide";
position = "bottom";
workspaceNumbers = false; workspaceNumbers = false;
}]; }];
xdg.configFile."i3blocks/config".text = let
home-manager.users.balsoft.xdg.configFile."i3blocks/config".text = let scr = x: {
scr = x: { name = x;
name = x; command = scripts.${x};
command = scripts.${x}; };
}; scrint = x: interval: (scr x) // { inherit interval; };
scrint = x: interval: (scr x) // { inherit interval; }; in ''
in '' interval=60
interval=60 markup=pango
markup=pango '' + genIniOrdered (optional (!isNull config.secrets.mail) (scr "email")
'' + genIniOrdered (optional (!isNull config.secrets.mail) (scr "email")
++ [ (scrint "weather" 600) (scr "calendar") (scr "emacs") (scr "nixos") ] ++ [ (scrint "weather" 600) (scr "calendar") (scr "emacs") (scr "nixos") ]
++ optional (!isNull config.secrets.wage) (scrint "youtrack-wage" 3600) ++ optional (!isNull config.secrets.wage) (scrint "youtrack-wage" 3600)
++ [ (scrint "music" 3) (scrint "sound" 1) ] ++ [ ++ [ (scrint "music" 3) (scrint "sound" 1) ] ++ [
@ -51,4 +52,16 @@ in {
] ]
++ optional (config.deviceSpecific.devInfo ? bigScreen) (scrint "network" 1) ++ optional (config.deviceSpecific.devInfo ? bigScreen) (scrint "network" 1)
++ [ (scrint "bluetooth" 3) (scrint "connections" 3) (scr "df") (scr "date") (scrint "time" 1) ]); ++ [ (scrint "bluetooth" 3) (scrint "connections" 3) (scr "df") (scr "date") (scrint "time" 1) ]);
systemd.user.services.swaybar = {
Unit = {
Description = "Start default bar";
};
Install.WantedBy = [ "sway-session.target" ];
Service = {
ExecStart = "${pkgs.sway}/bin/swaybar -b default";
};
};
};
} }

View File

@ -186,6 +186,11 @@ in {
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 2";
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 2";
"XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer -t";
"${modifier}+XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 1";
"${modifier}+XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 1";
"button2" = "kill"; "button2" = "kill";
"--whole-window ${modifier}+button2" = "kill"; "--whole-window ${modifier}+button2" = "kill";
} // builtins.listToAttrs (builtins.map (x: { } // builtins.listToAttrs (builtins.map (x: {
@ -196,9 +201,6 @@ in {
value = "move container to workspace ${builtins.elemAt x 1}"; value = "move container to workspace ${builtins.elemAt x 1}";
}) workspaces)); }) workspaces));
keycodebindings = { keycodebindings = {
"122" = "exec ${pkgs.pamixer}/bin/pamixer -d 2";
"123" = "exec ${pkgs.pamixer}/bin/pamixer -i 2";
"121" = "exec ${pkgs.pamixer}/bin/pamixer -t";
}; };
workspaceLayout = "tabbed"; workspaceLayout = "tabbed";
workspaceAutoBackAndForth = true; workspaceAutoBackAndForth = true;