nix/programm_configs/sway.nix
2024-04-26 10:39:18 +02:00

123 lines
3.8 KiB
Nix

{ config, pkgs, ... }:
{
wayland.windowManager.sway = let mod = "Mod4"; in {
enable = true;
systemd = {
enable = true;
};
config = rec {
fonts = { names = [ "DejaVu Sans Mono" "FontAwesome 6" ]; };
terminal = "alacritty";
bars = [ ];
input = {
"*" = {
xkb_layout = "de";
};
};
output."*".bg = "${../media/wallpaper.png} fill";
menu = "${pkgs.rofi}/bin/rofi -show combi -config ~/.config/rofi/config.rasi";
modifier = mod; # Super key
gaps = {
inner = 10;
outer = 0;
};
keybindings = {
# screenlock
"${mod}+shift+l" = "exec --no-startup-id ~/.config/i3/lock.sh";
# audio control fluff
"XF86AudioRaiseVolume" = "exec --no-startup-id wpctl set-volume @DEFAULT_SINK@ 5%+";
"XF86AudioLowerVolume" = "exec --no-startup-id wpctl set-volume @DEFAULT_SINK@ 5%-";
"XF86AudioMute" = "exec --no-startup-id wpctl set-mute @DEFAULT_SINK@ toggle";
# Terminal
"${mod}+Return" = "exec alacritty";
"${mod}+Shift+q" = "kill";
"${mod}+d" = "exec ${pkgs.rofi}/bin/rofi -show combi -config ~/.config/rofi/config.rasi";
"${mod}+Left" = "focus left";
"${mod}+Down" = "focus down";
"${mod}+Up" = "focus up";
"${mod}+Right" = "focus right";
"${mod}+Shift+Left" = "move left";
"${mod}+Shift+Down" = "move down";
"${mod}+Shift+Up" = "move up";
"${mod}+Shift+Right" = "move right";
"${mod}+h" = "splith";
"${mod}+v" = "splitv";
"${mod}+f" = "fullscreen toggle";
"${mod}+s" = "layout stacking";
"${mod}+w" = "layout tabbed";
"${mod}+e" = "layout toggle split";
"${mod}+Shift+space" = "floating toggle";
"${mod}+space" = "focus mode_toggle";
"${mod}+1" = "workspace number 1";
"${mod}+2" = "workspace number 2";
"${mod}+3" = "workspace number 3";
"${mod}+4" = "workspace number 4";
"${mod}+5" = "workspace number 5";
"${mod}+6" = "workspace number 6";
"${mod}+7" = "workspace number 7";
"${mod}+8" = "workspace number 8";
"${mod}+9" = "workspace number 9";
"${mod}+0" = "workspace number 10";
"${mod}+Shift+1" =
"move container to workspace number 1";
"${mod}+Shift+2" =
"move container to workspace number 2";
"${mod}+Shift+3" =
"move container to workspace number 3";
"${mod}+Shift+4" =
"move container to workspace number 4";
"${mod}+Shift+5" =
"move container to workspace number 5";
"${mod}+Shift+6" =
"move container to workspace number 6";
"${mod}+Shift+7" =
"move container to workspace number 7";
"${mod}+Shift+8" =
"move container to workspace number 8";
"${mod}+Shift+9" =
"move container to workspace number 9";
"${mod}+Shift+0" =
"move container to workspace number 10";
"${mod}+Shift+r" = "reload";
"${mod}+Shift+e" =
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"${mod}+r" = "mode resize";
};
startup = [
{
command = "systemctl --user restart waybar";
always = true;
}
{
command = "nextcloud";
always = true;
}
{
command = "systemctl --user restart redshift";
always = true;
}
{
command = "systemctl --user restart xfce4-notifyd.service";
always = true;
}
{
command = "blueman-applet";
always = true;
}
];
};
};
}