nixos-config/home/sway.nix

112 lines
3.2 KiB
Nix
Raw Normal View History

2022-03-29 23:03:38 +00:00
{ pkgs, lib, config, inputs, ... }:
2021-08-26 17:12:58 +00:00
let
2021-11-21 18:53:51 +00:00
rustybar = inputs.rustybar.defaultPackage."${pkgs.system}";
2021-08-26 17:12:58 +00:00
cfg = config.wayland.windowManager.sway;
mod = cfg.config.modifier;
extraWorkspaces = {
2022-01-06 01:25:40 +00:00
"0" = "10";
2021-08-26 17:12:58 +00:00
F1 = "11 Firefox";
F2 = "12 Music";
F3 = "13";
F4 = "14";
F5 = "15";
F6 = "16 Telegram";
F7 = "17 Chat";
F8 = "18 Signal";
F9 = "19";
F10 = "20 IRC";
F11 = "21";
F12 = "22";
};
2023-08-26 23:00:18 +00:00
extraGotoBindings = lib.mapAttrs' (name: value: {
name = "${mod}+${name}";
value = "workspace ${value}";
}) extraWorkspaces;
extraMoveBindings = lib.mapAttrs' (name: value: {
name = "${mod}+Shift+${name}";
value = "move container to workspace ${value}";
}) extraWorkspaces;
in {
2023-04-11 00:55:07 +00:00
home.sessionVariables = {
MOZ_USE_XINPUT2 = 1;
_JAVA_AWT_WM_NONREPARENTING = 1;
NIXOS_OZONE_WL = 1;
};
2021-08-26 17:12:58 +00:00
wayland.windowManager.sway = {
enable = true;
2022-03-29 23:03:38 +00:00
wrapperFeatures.gtk = true;
2021-08-26 17:12:58 +00:00
config = {
modifier = "Mod4";
2023-03-08 05:04:02 +00:00
terminal = "kitty";
2021-08-26 17:12:58 +00:00
menu = "wofi -i -S run";
fonts = {
2021-11-12 18:33:13 +00:00
names = [ "Inter" ];
2021-08-26 17:12:58 +00:00
size = 8.0;
};
gaps.inner = 4;
input."*" = {
natural_scroll = "yes";
xkb_options = "compose:caps";
};
output."*".bg = "${./files/sicily.jpg} fill";
startup = [
{ command = "mako"; }
2023-08-26 23:00:18 +00:00
{
command = "dbus-update-activation-environment --systemd --all";
always = true;
}
{
command =
"swayidle -w before-sleep 'swaylock -f' timeout 600 'swaylock -f' timeout 660 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\"'";
}
2021-08-26 17:12:58 +00:00
];
# I have to set these to something and can't set them to existing uses
left = "Mod1+Left";
down = "Mod1+Down";
up = "Mod1+Up";
right = "Mod1+Right";
2023-08-26 23:00:18 +00:00
keybindings = lib.mkOptionDefault ({
"${mod}+Shift+d" = "exec wofi -I -i -S drun";
"${mod}+j" = "move workspace to left";
"${mod}+k" = "move workspace to right";
"${mod}+l" = "exec swaylock";
"${mod}+Mod1+e" = "exec wofi-emoji";
# Sink 0 means the default AIUI
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume 0 +5%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume 0 -5%";
"XF86AudioMute" = "exec pactl set-sink-mute 0 toggle";
"XF86MonBrightnessUp" = "exec light -A 5";
"XF86MonBrightnessDown" = "exec light -U 5";
"Print" = ''
exec grim "$(xdg-user-dir PICTURES)/Screenshot/$(date +'%F %H-%M-%S-%N_screenshot.png')"'';
"Shift+Print" = ''
exec grim -g "$(slurp)" "$(xdg-user-dir PICTURES)/Screenshot/$(date +'%F %H-%M-%S-%N_screenshot.png')"'';
} // extraGotoBindings // extraMoveBindings);
2021-08-26 17:12:58 +00:00
floating.titlebar = true;
window.titlebar = true;
bars = [{
2021-11-21 18:53:51 +00:00
statusCommand = "${rustybar}/bin/rustybar";
2021-08-26 17:12:58 +00:00
position = "top";
fonts = cfg.config.fonts;
colors = {
background = "#000000d0";
statusline = "#ffffff";
separator = "#aaaaaa";
2023-08-26 23:00:18 +00:00
inactiveWorkspace = {
border = "#000000d0";
background = "#323232d0";
text = "#ffffffd0";
};
2021-08-26 17:12:58 +00:00
};
}];
};
};
}