[sway] Switches to sway over hyprland
This commit is contained in:
168
home-manager/features/sway.nix
Normal file
168
home-manager/features/sway.nix
Normal file
@@ -0,0 +1,168 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./swaync.nix
|
||||
];
|
||||
home.packages = with pkgs; [
|
||||
hyprlock # lock screen
|
||||
# swayidle # lock on idle
|
||||
# swayosd # volume pop-up
|
||||
# swaynotificationcenter # notifications
|
||||
# hyprpolkitagent # Privilege managent
|
||||
# hyprshot # Screenshot utility
|
||||
];
|
||||
|
||||
services.swayosd = {
|
||||
enable = true;
|
||||
topMargin = 0.7;
|
||||
};
|
||||
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
events = [
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "hyprlock";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Enable sway config generation for home.pointerCursor
|
||||
home.pointerCursor.sway.enable = true;
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
checkConfig = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
xdgAutostart = true;
|
||||
};
|
||||
config = {
|
||||
# Workspace assignments
|
||||
# Example:
|
||||
# {
|
||||
# "1: web" = [{ class = "^Firefox$"; }];
|
||||
# "0: extra" = [{ class = "^Firefox$"; window_role = "About"; }];
|
||||
# }
|
||||
assigns = { };
|
||||
colors = {
|
||||
background = "#333333";
|
||||
focused = {
|
||||
background = "#285577";
|
||||
border = "#4c7899";
|
||||
childBorder = "#285577";
|
||||
indicator = "#2e9ef4";
|
||||
text = "#ffffff";
|
||||
};
|
||||
focusedInactive = {
|
||||
background = "#5f676a";
|
||||
border = "#333333";
|
||||
childBorder = "#5f676a";
|
||||
indicator = "#484e50";
|
||||
text = "#ffffff";
|
||||
};
|
||||
placeholder = {
|
||||
background = "#0c0c0c";
|
||||
border = "#000000";
|
||||
childBorder = "#0c0c0c";
|
||||
indicator = "#000000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
unfocused = {
|
||||
background = "#222222";
|
||||
border = "#333333";
|
||||
childBorder = "#222222";
|
||||
indicator = "#292d2e";
|
||||
text = "#888888";
|
||||
};
|
||||
urgent = {
|
||||
background = "#900000";
|
||||
border = "#2f343a";
|
||||
childBorder = "#900000";
|
||||
indicator = "#900000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
};
|
||||
modifier = "Mod4"; # Super key
|
||||
keybindings =
|
||||
let
|
||||
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||
terminal = "wezterm";
|
||||
browser = "firefox";
|
||||
menu = "rofi -show drun";
|
||||
in
|
||||
lib.mkOptionDefault {
|
||||
"${modifier}+t" = "exec ${terminal}";
|
||||
"${modifier}+b" = "exec ${browser}";
|
||||
"${modifier}+d" = "exec ${menu}";
|
||||
"${modifier}+Shift+s" = "exec hyprshot -m region --clipboard-only";
|
||||
"${modifier}+c" = "exec swaync-client -t";
|
||||
"${modifier}+Control+q" = "exec /home/drew/.config/rofi/powermenu/powermenu.sh";
|
||||
"${modifier}+x" = "exec /home/drew/.config/rofi/powermenu/powermenu.sh";
|
||||
|
||||
"${modifier}+f" = "floating toggle";
|
||||
"${modifier}+Shift+f" = "fullscreen toggle";
|
||||
|
||||
"${modifier}+r" = "focus output right"; # sway does not have `focusmonitor next`
|
||||
"${modifier}+Control+r" = "move workspace to output left";
|
||||
"${modifier}+Control+s" = "move workspace to output right";
|
||||
|
||||
"${modifier}+q" = "kill";
|
||||
|
||||
"${modifier}+Left" = "focus left";
|
||||
"${modifier}+Right" = "focus right";
|
||||
"${modifier}+Up" = "focus up";
|
||||
"${modifier}+Down" = "focus down";
|
||||
|
||||
"${modifier}+Shift+Left" = "move left";
|
||||
"${modifier}+Shift+Right" = "move right";
|
||||
"${modifier}+Shift+Up" = "move up";
|
||||
"${modifier}+Shift+Down" = "move down";
|
||||
|
||||
# Workspace switching
|
||||
"${modifier}+1" = "workspace number 1";
|
||||
"${modifier}+2" = "workspace number 2";
|
||||
"${modifier}+3" = "workspace number 3";
|
||||
"${modifier}+4" = "workspace number 4";
|
||||
"${modifier}+5" = "workspace number 5";
|
||||
"${modifier}+6" = "workspace number 6";
|
||||
"${modifier}+7" = "workspace number 7";
|
||||
"${modifier}+8" = "workspace number 8";
|
||||
"${modifier}+9" = "workspace number 9";
|
||||
"${modifier}+0" = "workspace number 10";
|
||||
|
||||
"${modifier}+Shift+1" = "move container to workspace number 1; workspace number 1";
|
||||
"${modifier}+Shift+2" = "move container to workspace number 2; workspace number 2";
|
||||
"${modifier}+Shift+3" = "move container to workspace number 3; workspace number 3";
|
||||
"${modifier}+Shift+4" = "move container to workspace number 4; workspace number 4";
|
||||
"${modifier}+Shift+5" = "move container to workspace number 5; workspace number 5";
|
||||
"${modifier}+Shift+6" = "move container to workspace number 6; workspace number 6";
|
||||
"${modifier}+Shift+7" = "move container to workspace number 7; workspace number 7";
|
||||
"${modifier}+Shift+8" = "move container to workspace number 8; workspace number 8";
|
||||
"${modifier}+Shift+9" = "move container to workspace number 9; workspace number 9";
|
||||
"${modifier}+Shift+0" = "move container to workspace number 10; workspace number 10";
|
||||
|
||||
"${modifier}+Shift+r" = "move container to output left"; # approximating hyprland\u2019s split-changemonitor
|
||||
|
||||
"${modifier}+button1" = "move";
|
||||
"${modifier}+button2" = "resize";
|
||||
|
||||
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
|
||||
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
|
||||
"XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
|
||||
"XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
|
||||
|
||||
"XF86AudioNext" = "exec playerctl next";
|
||||
"XF86AudioPause" = "exec playerctl play-pause";
|
||||
"XF86AudioPlay" = "exec playerctl play-pause";
|
||||
"XF86AudioPrev" = "exec playerctl previous";
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user