2024-07-21 23:25:10 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.ar.home;
|
|
|
|
helpers = import ../wayland/helpers.nix {inherit config lib pkgs;};
|
|
|
|
modifier = "Mod4";
|
2024-08-12 10:04:52 -04:00
|
|
|
scripts = import ./scripts.nix {inherit config lib pkgs;};
|
2024-07-21 23:25:10 -04:00
|
|
|
in {
|
|
|
|
enable = true;
|
|
|
|
checkConfig = false;
|
2024-07-23 17:04:23 -04:00
|
|
|
package = lib.mkDefault pkgs.swayfx;
|
|
|
|
wrapperFeatures.gtk = true;
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-08-07 19:39:43 -04:00
|
|
|
systemd = {
|
|
|
|
enable = true;
|
2024-08-11 23:43:48 -04:00
|
|
|
|
|
|
|
extraCommands = lib.mkDefault [
|
|
|
|
"systemctl --user stop sway-session.target"
|
|
|
|
"systemctl --user start sway-session.target"
|
|
|
|
];
|
|
|
|
|
2024-08-07 19:39:43 -04:00
|
|
|
variables = ["--all"];
|
|
|
|
};
|
|
|
|
|
2024-07-21 23:25:10 -04:00
|
|
|
config = {
|
2024-08-02 17:58:08 -04:00
|
|
|
bars = [];
|
2024-07-21 23:25:10 -04:00
|
|
|
modifier = modifier;
|
|
|
|
|
2024-07-23 18:25:18 -04:00
|
|
|
colors = {
|
2024-08-08 20:47:25 -04:00
|
|
|
background = "${cfg.theme.colors.primary}CC";
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-07-23 18:25:18 -04:00
|
|
|
focused = {
|
2024-08-08 20:47:25 -04:00
|
|
|
background = "${cfg.theme.colors.primary}CC";
|
|
|
|
border = "${cfg.theme.colors.primary}CC";
|
|
|
|
childBorder = "${cfg.theme.colors.primary}CC";
|
|
|
|
indicator = "${cfg.theme.colors.primary}CC";
|
2024-07-23 18:25:18 -04:00
|
|
|
text = "${cfg.theme.colors.text}";
|
|
|
|
};
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-07-23 18:25:18 -04:00
|
|
|
focusedInactive = {
|
2024-08-08 20:47:25 -04:00
|
|
|
background = "${cfg.theme.colors.inactive}99";
|
|
|
|
border = "${cfg.theme.colors.inactive}99";
|
|
|
|
childBorder = "${cfg.theme.colors.inactive}99";
|
|
|
|
indicator = "${cfg.theme.colors.inactive}99";
|
2024-07-23 18:25:18 -04:00
|
|
|
text = "${cfg.theme.colors.text}";
|
|
|
|
};
|
|
|
|
|
|
|
|
unfocused = {
|
2024-08-08 20:47:25 -04:00
|
|
|
background = "${cfg.theme.colors.inactive}99";
|
|
|
|
border = "${cfg.theme.colors.inactive}99";
|
|
|
|
childBorder = "${cfg.theme.colors.inactive}99";
|
|
|
|
indicator = "${cfg.theme.colors.inactive}99";
|
2024-07-23 18:25:18 -04:00
|
|
|
text = "${cfg.theme.colors.text}";
|
|
|
|
};
|
2024-07-21 23:25:10 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
defaultWorkspace = "workspace number 1";
|
|
|
|
|
|
|
|
focus = {
|
|
|
|
followMouse = "always";
|
|
|
|
newWindow = "focus";
|
|
|
|
};
|
|
|
|
|
|
|
|
fonts = {
|
2024-08-07 23:09:31 -04:00
|
|
|
names = [cfg.theme.sansFont.name];
|
2024-07-21 23:25:10 -04:00
|
|
|
style = "Bold";
|
2024-08-07 23:09:31 -04:00
|
|
|
size = cfg.theme.sansFont.size + 0.0;
|
2024-07-21 23:25:10 -04:00
|
|
|
};
|
|
|
|
|
2024-07-23 18:25:18 -04:00
|
|
|
gaps = {
|
|
|
|
inner = 5;
|
2024-08-11 12:40:09 -04:00
|
|
|
outer = 6;
|
2024-07-23 18:25:18 -04:00
|
|
|
};
|
2024-07-21 23:25:10 -04:00
|
|
|
|
|
|
|
input = {
|
|
|
|
"type:touchpad" = {
|
|
|
|
click_method = "clickfinger";
|
|
|
|
dwt = "enabled";
|
|
|
|
natural_scroll = "enabled";
|
|
|
|
scroll_method = "two_finger";
|
|
|
|
tap = "enabled";
|
|
|
|
tap_button_map = "lrm";
|
|
|
|
};
|
|
|
|
|
|
|
|
"type:keyboard" = {
|
|
|
|
xkb_layout = "us";
|
|
|
|
xkb_variant = "altgr-intl";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-23 21:02:33 -04:00
|
|
|
keybindings =
|
|
|
|
{
|
|
|
|
"${modifier}+B" = "exec ${lib.getExe cfg.defaultApps.webBrowser}";
|
|
|
|
"${modifier}+C" = "kill";
|
|
|
|
"${modifier}+Comma" = "workspace prev";
|
2024-08-12 09:04:16 -04:00
|
|
|
"${modifier}+Control+L" = "exec ${lib.getExe pkgs.swaylock}";
|
2024-07-23 21:02:33 -04:00
|
|
|
"${modifier}+E" = "exec ${lib.getExe cfg.defaultApps.editor}";
|
|
|
|
"${modifier}+F" = "exec ${lib.getExe cfg.defaultApps.fileManager}";
|
|
|
|
"${modifier}+F11" = "exec pkill -SIGUSR1 waybar"; # Show/hide waybar
|
2024-07-25 15:26:12 -04:00
|
|
|
"${modifier}+M" = ''exec ${lib.getExe config.programs.rofi.package} -show power-menu -modi "power-menu:${lib.getExe pkgs.rofi-power-menu} --choices=logout/lockscreen/suspend/shutdown/reboot"'';
|
2024-07-23 21:02:33 -04:00
|
|
|
"${modifier}+Period" = "workspace next";
|
2024-07-25 15:26:12 -04:00
|
|
|
"${modifier}+R" = "exec ${lib.getExe config.programs.rofi.package} -show combi";
|
2024-07-23 21:02:33 -04:00
|
|
|
"${modifier}+S" = "scratchpad show";
|
2024-08-11 12:40:09 -04:00
|
|
|
"${modifier}+Shift+Backslash" = "layout toggle split";
|
2024-07-23 21:02:33 -04:00
|
|
|
"${modifier}+Shift+Comma" = "move container to workspace prev; workspace prev";
|
2024-08-11 12:40:09 -04:00
|
|
|
"${modifier}+Shift+G" = "layout toggle splitv tabbed";
|
2024-07-23 21:02:33 -04:00
|
|
|
"${modifier}+Shift+Period" = "move container to workspace next; workspace next";
|
2024-07-25 20:25:22 -04:00
|
|
|
"${modifier}+Shift+R" = "exec ${lib.getExe config.programs.rofi.package} -show run";
|
2024-07-23 21:02:33 -04:00
|
|
|
"${modifier}+Shift+S" = "move scratchpad";
|
|
|
|
"${modifier}+Shift+V" = "floating toggle";
|
|
|
|
"${modifier}+Shift+W" = "fullscreen toggle";
|
|
|
|
"${modifier}+T" = "exec ${lib.getExe cfg.defaultApps.terminal}";
|
2024-07-25 20:32:11 -04:00
|
|
|
"${modifier}+Tab" = "exec ${lib.getExe config.programs.rofi.package} -show window";
|
2024-07-23 21:02:33 -04:00
|
|
|
"Control+F12" = "exec ${helpers.screenshot}";
|
|
|
|
"Ctrl+Mod1+M" = "mode move";
|
|
|
|
"Ctrl+Mod1+R" = "mode resize";
|
|
|
|
"PRINT" = "exec ${helpers.screenshot}";
|
|
|
|
}
|
|
|
|
// builtins.listToAttrs (
|
|
|
|
builtins.concatMap (workspace: [
|
|
|
|
{
|
|
|
|
name = "${modifier}+${toString workspace}";
|
|
|
|
value = "workspace number ${toString workspace}";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "${modifier}+Shift+${toString workspace}";
|
|
|
|
value = "move container to workspace number ${toString workspace}; workspace ${toString workspace}";
|
|
|
|
}
|
|
|
|
]) [1 2 3 4 5 6 7 8 9]
|
|
|
|
)
|
|
|
|
// lib.attrsets.concatMapAttrs
|
|
|
|
(key: direction: {
|
|
|
|
"${modifier}+${key}" = "focus ${direction}";
|
|
|
|
"${modifier}+Shift+${key}" = "move ${direction}";
|
|
|
|
"${modifier}+Control+Shift+${key}" = "move workspace to output ${direction}";
|
|
|
|
})
|
2024-08-03 23:13:09 -04:00
|
|
|
cfg.desktop.windowManagerBinds;
|
2024-07-21 23:25:10 -04:00
|
|
|
|
|
|
|
modes = {
|
2024-07-23 21:02:33 -04:00
|
|
|
move =
|
|
|
|
{
|
|
|
|
Comma = "move container to workspace prev; workspace prev";
|
|
|
|
Escape = "mode default";
|
|
|
|
Period = "move container to workspace next; workspace next";
|
|
|
|
S = "move scratchpad";
|
|
|
|
}
|
|
|
|
// builtins.listToAttrs (
|
|
|
|
builtins.concatMap (workspace: [
|
|
|
|
{
|
|
|
|
name = toString workspace;
|
|
|
|
value = "move container to workspace number ${toString workspace}; workspace ${toString workspace}";
|
|
|
|
}
|
|
|
|
]) [1 2 3 4 5 6 7 8 9]
|
|
|
|
)
|
|
|
|
// lib.attrsets.concatMapAttrs
|
|
|
|
(key: direction: {"${key}" = "move ${direction}";})
|
2024-08-03 23:13:09 -04:00
|
|
|
cfg.desktop.windowManagerBinds;
|
2024-07-21 23:25:10 -04:00
|
|
|
|
|
|
|
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.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";}
|
|
|
|
{command = lib.getExe pkgs.autotiling;}
|
|
|
|
]
|
2024-08-02 17:58:08 -04:00
|
|
|
++ lib.optional (!cfg.services.randomWallpaper.enable) {command = "${lib.getExe pkgs.swaybg} -i ${cfg.theme.wallpaper}";};
|
2024-07-21 23:25:10 -04:00
|
|
|
|
|
|
|
floating.criteria = [
|
|
|
|
{app_id = ".blueman-manager-wrapped";}
|
|
|
|
{app_id = "blueberry.py";}
|
|
|
|
{app_id = "com.github.wwmm.easyeffects";}
|
2024-07-25 20:57:56 -04:00
|
|
|
{app_id = "nm-connection-editor";}
|
2024-07-21 23:25:10 -04:00
|
|
|
{app_id = "pavucontrol";}
|
|
|
|
{app_id = "solaar";}
|
|
|
|
{title = "Open File";}
|
|
|
|
{title = "Open Folder";}
|
|
|
|
{window_role = "bubble";}
|
|
|
|
{window_role = "dialog";}
|
|
|
|
{window_role = "pop-up";}
|
|
|
|
{window_type = "dialog";}
|
|
|
|
];
|
|
|
|
|
|
|
|
window = {
|
|
|
|
titlebar = false;
|
|
|
|
commands = [
|
|
|
|
{
|
|
|
|
command = "floating enable; sticky toggle; resize 35ppt 10ppt";
|
|
|
|
criteria = {
|
|
|
|
title = "^Picture-in-Picture$";
|
|
|
|
app_id = "firefox";
|
|
|
|
};
|
|
|
|
}
|
2024-08-03 21:14:49 -04:00
|
|
|
{
|
|
|
|
command = "focus; sticky toggle";
|
|
|
|
criteria = {app_id = "gcr-prompter";};
|
|
|
|
}
|
2024-08-09 21:20:32 -04:00
|
|
|
{
|
|
|
|
command = "focus; sticky toggle";
|
|
|
|
criteria = {app_id = "polkit-mate-authentication-agent-1";};
|
|
|
|
}
|
2024-08-09 22:07:38 -04:00
|
|
|
{
|
|
|
|
command = "floating enable; resize set 40ppt 20ppt; move position center";
|
|
|
|
criteria = {title = "File Operation Progress";};
|
|
|
|
}
|
2024-07-21 23:25:10 -04:00
|
|
|
{
|
|
|
|
command = "resize set 40ppt 60ppt; move position center";
|
|
|
|
criteria = {title = "Open Folder";};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
command = "resize set 40ppt 60ppt; move position center";
|
|
|
|
criteria = {title = "Open File";};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
command = "resize set 40ppt 60ppt; move position center";
|
|
|
|
criteria = {app_id = "blueberry.py";};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
command = "resize set 60ppt 80ppt; move position center";
|
|
|
|
criteria = {app_id = "solaar";};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
command = "resize set 40ppt 60ppt; move position center";
|
|
|
|
criteria = {app_id = ".blueman-manager-wrapped";};
|
|
|
|
}
|
2024-07-25 20:57:56 -04:00
|
|
|
{
|
|
|
|
command = "resize set 40ppt 60ppt; move position center";
|
|
|
|
criteria = {app_id = "nm-connection-editor";};
|
|
|
|
}
|
2024-07-21 23:25:10 -04:00
|
|
|
{
|
|
|
|
command = "resize set 40ppt 60ppt; move position center";
|
|
|
|
criteria = {app_id = "pavucontrol";};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
workspaceAutoBackAndForth = true;
|
|
|
|
};
|
|
|
|
|
2024-07-27 23:15:00 -04:00
|
|
|
extraConfig =
|
|
|
|
''
|
|
|
|
bindsym --locked XF86MonBrightnessUp exec ${helpers.brightness.up}
|
|
|
|
bindsym --locked XF86MonBrightnessDown exec ${helpers.brightness.down}
|
|
|
|
bindsym --locked XF86AudioRaiseVolume exec ${helpers.volume.up}
|
|
|
|
bindsym --locked XF86AudioLowerVolume exec ${helpers.volume.down}
|
|
|
|
bindsym --locked XF86AudioMute exec ${helpers.volume.mute}
|
|
|
|
bindsym --locked XF86AudioMicMute exec ${helpers.volume.micMute}
|
|
|
|
bindsym --locked XF86AudioPlay exec ${helpers.media.play}
|
|
|
|
bindsym --locked XF86AudioPrev exec ${helpers.media.prev}
|
|
|
|
bindsym --locked XF86AudioNext exec ${helpers.media.next}
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-07-27 23:15:00 -04:00
|
|
|
mode "move" {
|
|
|
|
bindgesture swipe:right move container to workspace prev; workspace prev
|
|
|
|
bindgesture swipe:left move container to workspace next; workspace next
|
|
|
|
bindgesture pinch:inward+up move up
|
|
|
|
bindgesture pinch:inward+down move down
|
|
|
|
bindgesture pinch:inward+left move left
|
|
|
|
bindgesture pinch:inward+right move right
|
|
|
|
}
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-07-27 23:15:00 -04:00
|
|
|
bindgesture swipe:right workspace prev
|
|
|
|
bindgesture swipe:left workspace next
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-08-12 10:04:52 -04:00
|
|
|
bindswitch --reload --locked lid:on exec ${scripts.clamshell} on
|
|
|
|
bindswitch --reload --locked lid:off exec ${scripts.clamshell} off
|
2024-08-08 20:47:25 -04:00
|
|
|
|
2024-08-09 18:16:46 -04:00
|
|
|
default_border pixel 4
|
|
|
|
default_floating_border pixel 4
|
2024-07-27 23:15:00 -04:00
|
|
|
''
|
|
|
|
+ lib.strings.optionalString (config.wayland.windowManager.sway.package
|
|
|
|
== pkgs.swayfx) ''
|
|
|
|
blur enable
|
2024-08-08 20:47:25 -04:00
|
|
|
blur_passes 2
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-08-09 18:16:46 -04:00
|
|
|
# corner_radius ${toString cfg.theme.borderRadius}
|
2024-07-27 23:15:00 -04:00
|
|
|
shadows enable
|
|
|
|
shadows_on_csd enable
|
|
|
|
shadow_color ${cfg.theme.colors.shadow}
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-07-27 23:15:00 -04:00
|
|
|
default_dim_inactive 0.05
|
2024-07-21 23:25:10 -04:00
|
|
|
|
2024-07-29 18:55:03 -04:00
|
|
|
layer_effects gtk-layer-shell blur enable
|
|
|
|
layer_effects gtk-layer-shell blur_ignore_transparent enable
|
2024-07-27 23:15:00 -04:00
|
|
|
layer_effects launcher blur enable
|
|
|
|
layer_effects launcher blur_ignore_transparent enable
|
|
|
|
layer_effects logout_dialog blur enable
|
|
|
|
layer_effects notifications blur enable
|
|
|
|
layer_effects notifications blur_ignore_transparent enable
|
|
|
|
layer_effects rofi blur enable
|
|
|
|
layer_effects rofi blur_ignore_transparent enable
|
|
|
|
layer_effects swaybar blur enable
|
|
|
|
layer_effects swaybar blur_ignore_transparent enable
|
|
|
|
layer_effects swayosd blur enable
|
|
|
|
layer_effects swayosd blur_ignore_transparent enable
|
|
|
|
layer_effects waybar blur enable
|
|
|
|
layer_effects waybar blur_ignore_transparent enable
|
|
|
|
'';
|
2024-07-21 23:25:10 -04:00
|
|
|
}
|