sway: config reorganizing and improvements

This commit is contained in:
Aly Raffauf 2024-04-20 13:58:45 -04:00
parent 6adabc1bf9
commit e63502bdf4

View file

@ -56,6 +56,7 @@
wayland.windowManager.sway.enable = true; wayland.windowManager.sway.enable = true;
wayland.windowManager.sway.package = pkgs.swayfx; wayland.windowManager.sway.package = pkgs.swayfx;
wayland.windowManager.sway.wrapperFeatures.gtk = true;
wayland.windowManager.sway.config = let wayland.windowManager.sway.config = let
modifier = "Mod4"; modifier = "Mod4";
@ -93,17 +94,16 @@
# screenshot_region = "${screenshot} -m region -o ${screenshot_folder}"; # screenshot_region = "${screenshot} -m region -o ${screenshot_folder}";
# Color, themes, scaling # Color, themes, scaling
colorPrimary = "ca9ee6ee"; colorText = "#FAFAFA";
colorSecondary = "99d1dbee"; colorPrimary = "#CA9EE6EE";
border_inactive = "303446aa"; colorSecondary = "#99D1DBEE";
drop_shadow = "1a1a1aee"; border_inactive = "#303446AA";
drop_shadow = "#1A1A1AEE";
cursor_size = "24"; cursor_size = "24";
qt_platform_theme = "gtk2"; qt_platform_theme = "gtk2";
gdk_scale = "1.5"; gdk_scale = "1.5";
in { in {
bars = [{command = "${bar}";}]; bars = [{command = "${bar}";}];
terminal = "${terminal}";
menu = "${launcher}";
modifier = "${modifier}"; modifier = "${modifier}";
colors.background = "${colorPrimary}"; colors.background = "${colorPrimary}";
colors.focused = { colors.focused = {
@ -111,58 +111,35 @@
border = "${colorPrimary}"; border = "${colorPrimary}";
childBorder = "${colorPrimary}"; childBorder = "${colorPrimary}";
indicator = "${colorPrimary}"; indicator = "${colorPrimary}";
text = "#ffffff"; text = "${colorText}";
}; };
colors.focusedInactive = { colors.focusedInactive = {
background = "${colorSecondary}"; background = "${colorSecondary}";
border = "${colorSecondary}"; border = "${colorSecondary}";
childBorder = "${colorSecondary}"; childBorder = "${colorSecondary}";
indicator = "${colorSecondary}"; indicator = "${colorSecondary}";
text = "#ffffff"; text = "${colorText}";
}; };
colors.unfocused = { colors.unfocused = {
background = "${colorSecondary}"; background = "${colorSecondary}";
border = "${colorSecondary}"; border = "${colorSecondary}";
childBorder = "${colorSecondary}"; childBorder = "${colorSecondary}";
indicator = "${colorSecondary}"; indicator = "${colorSecondary}";
text = "#ffffff"; text = "${colorText}";
};
defaultWorkspace = "workspace number 1";
focus = {
followMouse = "always";
newWindow = "smart";
mouseWarping = "container";
}; };
gaps.inner = 5;
gaps.outer = 10;
window.titlebar = false;
fonts = { fonts = {
names = ["Noto SansM Nerd Font"]; names = ["Noto SansM Nerd Font"];
style = "Bold"; style = "Bold";
size = 12.0; size = 12.0;
}; };
startup = [ gaps.inner = 5;
{command = "${pkgs.autotiling}/bin/autotiling";} gaps.outer = 10;
{command = "${notifyd}";}
{command = "${pkgs.wl-clipboard}/bin/wl-paste --type text --watch cliphist store";}
{command = "${pkgs.wl-clipboard}/bin/wl-paste --type image --watch cliphist store";}
{command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";}
{command = "${fileManager} --daemon";}
{command = "${pkgs.swayosd}/bin/swayosd-server";}
{command = "${pkgs.networkmanagerapplet}/bin/nm-applet";}
{command = "${pkgs.trayscale}/bin/trayscale --hide-window";}
{
command = ''
${pkgs.swayidle}/bin/swayidle -w \
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \
timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' \
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \
timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \
before-sleep '${pkgs.swaylock}/bin/swaylock -f -c 000000'
'';
}
];
output = {
"BOE 0x095F Unknown" = {
scale = "1.5";
};
};
input = { input = {
"type:touchpad" = { "type:touchpad" = {
click_method = "clickfinger"; click_method = "clickfinger";
@ -262,17 +239,10 @@
# Show/hide waybar # Show/hide waybar
"${modifier}+F11" = "exec pkill -SIGUSR1 waybar"; "${modifier}+F11" = "exec pkill -SIGUSR1 waybar";
"Mod1+R" = "mode resize";
"Mod1+M" = "mode move"; "Mod1+M" = "mode move";
"Mod1+R" = "mode resize";
}; };
modes = { modes = {
resize = {
Escape = "mode default";
Left = "resize shrink width 10 px";
Down = "resize grow height 10 px";
Up = "resize shrink height 10 px";
Right = "resize grow width 10 px";
};
move = { move = {
Escape = "mode default"; Escape = "mode default";
Left = "move left"; Left = "move left";
@ -293,8 +263,53 @@
"0" = "move container to workspace number 10"; "0" = "move container to workspace number 10";
S = "move scratchpad"; S = "move scratchpad";
}; };
resize = {
Escape = "mode default";
Left = "resize shrink width 10 px";
Down = "resize grow height 10 px";
Up = "resize shrink height 10 px";
Right = "resize grow width 10 px";
}; };
}; };
startup = [
{command = "${pkgs.autotiling}/bin/autotiling";}
{command = "${notifyd}";}
{command = "${pkgs.wl-clipboard}/bin/wl-paste --type text --watch cliphist store";}
{command = "${pkgs.wl-clipboard}/bin/wl-paste --type image --watch cliphist store";}
{command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";}
{command = "${fileManager} --daemon";}
{command = "${pkgs.swayosd}/bin/swayosd-server";}
{command = "${pkgs.networkmanagerapplet}/bin/nm-applet";}
{command = "${pkgs.trayscale}/bin/trayscale --hide-window";}
{
command = ''
${pkgs.swayidle}/bin/swayidle -w \
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \
timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' \
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \
timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \
before-sleep '${pkgs.swaylock}/bin/swaylock -f -c 000000'
'';
}
];
output = {
"BOE 0x095F Unknown" = {
scale = "1.5";
};
"LG Display 0x0569 Unknown" = {
scale = "1.25";
};
"LG Electronics LG ULTRAWIDE 311NTAB5M720" = {
scale = "1.25";
};
"Samsung Display Corp. 0x4152 Unknown" = {
scale = "2.0";
};
};
window.titlebar = false;
};
wayland.windowManager.sway.extraConfig = '' wayland.windowManager.sway.extraConfig = ''
bindgesture swipe:right workspace prev bindgesture swipe:right workspace prev