nixos-old/sway/config.nix

232 lines
6.1 KiB
Nix

{ lib, config, ... }:
let
mod = "Mod4";
term = "kitty";
color_bg = "#${config.color.background}";
color_fg = "#${config.color.foreground}";
color_active = "#${config.color.green}";
color_inactive = "#${config.color.cyan}";
color_indicator = "#${config.color.magenta}";
color_evil = "#${config.color.red}";
ws1 = "1";
ws2 = "2";
ws3 = "3";
ws4 = "4";
ws5 = "5";
ws6 = "6";
ws7 = "7";
ws8 = "8";
ws9 = "9";
ws10 = "10";
in
{
home-manager.users.zoe.wayland.windowManager.sway.config = {
modifier = mod;
terminal = term;
menu =
"exec rofi -combi-modi window#drun#ssh -show-icons -show combi -modi combi";
fonts = {
names = [ "CaskaydiaCove Nerd Font" ];
size = 11.0;
};
input = {
"type:touchpad" = {
tap = "enabled";
};
};
colors = {
background = color_bg;
focused = {
background = color_bg;
border = color_active;
childBorder = color_active;
indicator = color_indicator;
text = color_fg;
};
focusedInactive = {
background = color_bg;
border = color_inactive;
childBorder = color_inactive;
indicator = color_indicator;
text = color_fg;
};
unfocused = {
background = color_bg;
border = color_inactive;
childBorder = color_inactive;
indicator = color_indicator;
text = color_fg;
};
urgent = {
background = color_bg;
border = color_evil;
childBorder = color_evil;
indicator = color_indicator;
text = color_fg;
};
};
keybindings = lib.mkOptionDefault {
# launch things
## calculator
"${mod}+c" = "exec rofi -show calc";
## emoji
"${mod}+period" = "exec kaokao | wl-copy";
## THE PICTURES
"${mod}+s" = "grim -g \"$(slurp)\" - | swappy -f -";
## find mouse cursor
"${mod}+x" =
"exec find-cursor --color '#282828' -o 2 --outline-color '#EBDBB2'";
## modes
"${mod}+r" = "mode resize";
"${mod}+b" = "mode brightness";
"${mod}+m" = "mode media";
"${mod}+w" = "mode move";
"${mod}+v" = "mode focus";
## workspaces
"${mod}+Tab" = "workspace next";
## split
"${mod}+q" = "split toggle";
};
modes = {
resize = {
Escape = "mode default";
v = "mode focus";
w = "mode move";
j = "resize grow height 10 px or 10 ppt";
l = "resize shrink width 10 px or 10 ppt";
h = "resize grow width 10 px or 10 ppt";
k = "resize shrink height 10 px or 10 ppt";
};
brightness = {
Escape = "mode default";
k = "exec /etc/nixos/i3/brightness.py 10+";
j = "exec /etc/nixos/i3/brightness.py 10-";
};
media = {
Escape = "mode default";
j = "exec --no-startup-id python3 /etc/nixos/i3/volume.py 1%-";
k = "exec --no-startup-id python3 /etc/nixos/i3/volume.py 1%+";
m = "exec --no-startup-id amixer set Master toggle";
n = "exec --no-startup-id amixer set Capture toggle";
p = "exec --no-startup-id playerctld shift";
"Shift+j" = "exec --no-startup-id playerctl volume 0.05-";
"Shift+k" = "exec --no-startup-id playerctl volume 0.05+";
space = "exec --no-startup-id playerctl play-pause";
l = "exec playerctl next";
h = "exec playerctl previous";
};
move = {
Escape = "mode default";
v = "mode focus";
r = "mode resize";
j = "move down";
k = "move up";
h = "move left";
l = "move right";
s = "swap container with previous";
Tab = "exec swaymsg move workspace next && swaymsg workspace next";
"1" = "move workspace ${ws1}";
"2" = "move workspace ${ws2}";
"3" = "move workspace ${ws3}";
"4" = "move workspace ${ws4}";
"5" = "move workspace ${ws5}";
"6" = "move workspace ${ws6}";
"7" = "move workspace ${ws7}";
"8" = "move workspace ${ws8}";
"9" = "move workspace ${ws9}";
"0" = "move workspace ${ws10}";
};
focus = {
Escape = "mode default";
w = "mode move";
r = "mode resize";
h = "focus left";
j = "focus down";
k = "focus up";
l = "focus right";
Tab = "workspace next";
"1" = "workspace ${ws1}";
"2" = "workspace ${ws2}";
"3" = "workspace ${ws3}";
"4" = "workspace ${ws4}";
"5" = "workspace ${ws5}";
"6" = "workspace ${ws6}";
"7" = "workspace ${ws7}";
"8" = "workspace ${ws8}";
"9" = "workspace ${ws9}";
"0" = "workspace ${ws10}";
};
};
window = {
titlebar = false;
border = 4;
};
gaps = {
inner = 0;
outer = 0;
};
bars = [{
position = "top";
command = "swaybar";
statusCommand =
"i3status-rs $HOME/.config/i3status-rust/config-main.toml";
fonts = {
names = [ "CaskaydiaCove Nerd Font" ];
size = 11.0;
};
colors = {
background = color_bg;
activeWorkspace = {
border = color_active;
background = color_bg;
text = color_active;
};
inactiveWorkspace = {
border = color_bg;
background = color_bg;
text = color_inactive;
};
focusedWorkspace = {
border = color_active;
background = color_active;
text = color_bg;
};
bindingMode = {
background = color_bg;
border = color_bg;
text = color_fg;
};
};
}];
startup = [
{
command = "swaybg -i /etc/nixos/wallpaper.png";
always = true;
}
{
command = "picom --experimental-backends";
always = true;
}
{
command = "swaymsg -t SUBSCRIBE -m \"['workspace']\" | jq --unbuffered -r 'select(.change == \"focus\") | .current.output' | xargs -L1 swaymsg input type:tablet\_tool map\_to\_output";
always = true;
}
{
command = "autotiling";
always = true;
}
];
};
}