2024-05-11 13:55:23 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
fonts,
|
|
|
|
accentColour ? "base07",
|
|
|
|
...
|
|
|
|
}: {
|
2024-05-11 17:05:42 +01:00
|
|
|
imports = [
|
|
|
|
./alacritty/default.nix
|
|
|
|
./avizo/default.nix
|
|
|
|
./rofi/default.nix
|
|
|
|
./swaylock/default.nix
|
|
|
|
./swaync/default.nix
|
|
|
|
./waybar/default.nix
|
|
|
|
./wlogout/default.nix
|
|
|
|
];
|
2024-05-11 13:55:23 +01:00
|
|
|
home.packages = with pkgs; [
|
2024-05-17 16:14:50 +01:00
|
|
|
swaybg
|
|
|
|
(writeShellScriptBin "restart-swaybg" ''
|
|
|
|
pkill -9 -f swaybg
|
|
|
|
${pkgs.swaybg}/bin/swaybg -m fill -i ${../../wallpapers/default.jpg}
|
|
|
|
'')
|
2024-05-11 13:55:23 +01:00
|
|
|
(writeShellScriptBin "protonmail-setup-bridge" ''
|
|
|
|
pkill -9 -f protonmail-bridge
|
|
|
|
${protonmail-bridge}/bin/protonmail-bridge -c
|
|
|
|
swaymsg exec "${protonmail-bridge}/bin/protonmail-bridge -n"
|
|
|
|
'')
|
|
|
|
(writeShellScriptBin "davmail-setup" ''
|
|
|
|
systemctl --user restart davmail # Ensure config file is present
|
|
|
|
systemctl --user stop davmail
|
|
|
|
${davmail}/bin/davmail -n ~/.davmail.properties
|
|
|
|
systemctl --user restart davmail
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
wayland.windowManager.sway = {
|
|
|
|
enable = true;
|
2024-05-17 16:14:50 +01:00
|
|
|
package =
|
|
|
|
pkgs.swayfx.overrideAttrs
|
|
|
|
(old: {passthru.providedSessions = ["sway"];});
|
2024-05-11 13:55:23 +01:00
|
|
|
swaynag.enable = true;
|
|
|
|
systemd.enable = true;
|
|
|
|
xwayland = true;
|
|
|
|
config = {
|
|
|
|
input = {
|
|
|
|
"*" = {
|
|
|
|
xkb_layout = "gb";
|
|
|
|
xkb_options = "ctrl:nocaps";
|
|
|
|
};
|
|
|
|
"type:touchpad" = {
|
|
|
|
tap = "enabled";
|
|
|
|
natural_scroll = "enabled";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
seat = {
|
|
|
|
"seat0" = {
|
|
|
|
xcursor_theme = with config.gtk.cursorTheme; "${name} ${toString size}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
modifier = "Mod4";
|
|
|
|
terminal = "${config.programs.alacritty.package}/bin/alacritty";
|
|
|
|
menu = "${config.programs.rofi.finalPackage}/bin/rofi -show drun";
|
|
|
|
workspaceAutoBackAndForth = true;
|
|
|
|
bars = [];
|
|
|
|
gaps = {
|
|
|
|
inner = 5;
|
|
|
|
outer = 0;
|
|
|
|
};
|
|
|
|
fonts = {
|
|
|
|
names = [fonts.monospace.name];
|
|
|
|
style = "regular";
|
|
|
|
size = fonts.sizes.desktop * 1.0;
|
|
|
|
};
|
|
|
|
colors = with config.scheme.withHashtag; let
|
|
|
|
text = toString base05;
|
|
|
|
indicator = toString cyan;
|
|
|
|
in rec {
|
|
|
|
background = toString base00;
|
|
|
|
focused = rec {
|
|
|
|
inherit background text indicator;
|
|
|
|
border = toString config.scheme.withHashtag.${accentColour};
|
|
|
|
childBorder = border;
|
|
|
|
};
|
|
|
|
focusedInactive = rec {
|
|
|
|
inherit background text indicator;
|
|
|
|
border = toString base04;
|
|
|
|
childBorder = border;
|
|
|
|
};
|
|
|
|
unfocused = rec {
|
|
|
|
inherit background text indicator;
|
|
|
|
border = toString base03;
|
|
|
|
childBorder = border;
|
|
|
|
};
|
|
|
|
urgent = rec {
|
|
|
|
inherit background text indicator;
|
|
|
|
border = toString red;
|
|
|
|
childBorder = border;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
startup = [
|
|
|
|
{command = "${pkgs.swaynotificationcenter}/bin/swaync";}
|
|
|
|
{command = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";}
|
|
|
|
{command = "${pkgs.protonmail-bridge}/bin/protonmail-bridge -n";}
|
2024-05-17 16:14:50 +01:00
|
|
|
{command = "restart-swaybg";}
|
2024-05-11 13:55:23 +01:00
|
|
|
];
|
|
|
|
window = {
|
|
|
|
border = 1;
|
2024-05-13 16:46:39 +01:00
|
|
|
commands =
|
2024-05-14 13:58:32 +01:00
|
|
|
(map (criteria: {
|
|
|
|
inherit criteria;
|
|
|
|
command = "floating enable";
|
|
|
|
}) [
|
|
|
|
{app_id = "org.kde.polkit-kde-authentication-agent-1";}
|
|
|
|
{app_id = "Pinentry";}
|
|
|
|
{app_id = "pavucontrol";}
|
|
|
|
{app_id = "\.blueman-manager-wrapped";}
|
|
|
|
{app_id = "nm-connection-editor";}
|
2024-05-16 11:01:37 +01:00
|
|
|
{app_id = "thunar";}
|
2024-05-14 13:58:32 +01:00
|
|
|
{class = "steam";}
|
|
|
|
{class = "[Mm]atplotlib";}
|
|
|
|
{class = ".*\.py";}
|
|
|
|
{class = "Idl";}
|
|
|
|
])
|
|
|
|
++ (map (criteria: {
|
2024-05-16 07:28:48 +01:00
|
|
|
inherit criteria;
|
|
|
|
command = "layout tabbed";
|
|
|
|
}) [
|
|
|
|
{app_id = "Nxplayer\.bin";}
|
|
|
|
{class = "Nxplayer\.bin";}
|
|
|
|
])
|
2024-05-17 16:19:19 +01:00
|
|
|
++ (map (criteria: {
|
|
|
|
inherit criteria;
|
|
|
|
command = "layout stacking";
|
|
|
|
}) [
|
|
|
|
{app_id = "WebCord";}
|
|
|
|
{app_id = "signal";}
|
|
|
|
{app_id = "whatsapp-for-linux";}
|
|
|
|
{app_id = "teams-for-linux";}
|
|
|
|
])
|
2024-05-14 13:58:32 +01:00
|
|
|
++ [];
|
2024-05-11 13:55:23 +01:00
|
|
|
};
|
|
|
|
floating.border = 1;
|
|
|
|
keybindings = with config; let
|
|
|
|
modifier = wayland.windowManager.sway.config.modifier;
|
|
|
|
in
|
|
|
|
lib.mkOptionDefault {
|
|
|
|
# Movement
|
|
|
|
"${modifier}+comma" = "workspace prev";
|
|
|
|
"${modifier}+period" = "workspace next";
|
|
|
|
"${modifier}+shift+comma" = "move workspace prev";
|
|
|
|
"${modifier}+shift+period" = "move workspace next";
|
|
|
|
"${modifier}+bracketleft" = "move workspace to output left";
|
|
|
|
"${modifier}+bracketright" = "move workspace to output right";
|
|
|
|
|
|
|
|
# Function keys
|
|
|
|
## Sound
|
|
|
|
"XF86AudioMute" = "exec ${services.avizo.package}/bin/volumectl %";
|
|
|
|
"XF86AudioMicMute" = "exec ${services.avizo.package}/bin/volumectl -m %";
|
|
|
|
"XF86AudioRaiseVolume" = "exec ${services.avizo.package}/bin/volumectl -u + 5";
|
|
|
|
"XF86AudioLowerVolume" = "exec ${services.avizo.package}/bin/volumectl -u - 5";
|
|
|
|
|
|
|
|
## Playback
|
|
|
|
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
|
|
|
"XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
|
|
|
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
|
|
|
|
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
|
|
|
|
|
|
|
|
## Brightness
|
|
|
|
"XF86MonBrightnessUp" = "exec ${services.avizo.package}/bin/lightctl + 5";
|
|
|
|
"XF86MonBrightnessDown" = "exec ${services.avizo.package}/bin/lightctl - 5";
|
|
|
|
|
|
|
|
# System utilities
|
|
|
|
"${modifier}+F1" = "exec ${programs.swaylock.package}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse";
|
|
|
|
"${modifier}+p" = "exec ${programs.wlogout.package}/bin/wlogout";
|
|
|
|
"${modifier}+z" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
|
|
|
|
"${modifier}+Shift+z" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw";
|
|
|
|
"${modifier}+Shift+Return" = "exec ${programs.emacs.finalPackage}/bin/emacsclient -c";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
extraConfig = ''
|
|
|
|
bindgesture swipe:right workspace prev
|
|
|
|
bindgesture swipe:left workspace next
|
|
|
|
corner_radius 10
|
|
|
|
blur enable
|
|
|
|
blur_xray disable
|
|
|
|
blur_passes 3
|
|
|
|
blur_radius 5
|
|
|
|
corner_radius 10
|
|
|
|
shadows enable
|
|
|
|
shadow_blur_radius 4
|
|
|
|
layer_effects "system-menu" blur enable; blur_ignore_transparent enable; shadows disable
|
|
|
|
layer_effects "gtk-layer-shell" blur enable; blur_ignore_transparent enable; shadows disable
|
|
|
|
layer_effects "waybar" blur enable; blur_ignore_transparent enable; shadows disable
|
|
|
|
layer_effects "rofi" blur enable; blur_ignore_transparent enable; shadows disable
|
|
|
|
layer_effects "avizo" blur enable; blur_ignore_transparent enable; shadows disable
|
|
|
|
layer_effects "swaync-notification-window" blur enable; blur_ignore_transparent enable; shadows disable
|
|
|
|
layer_effects "swaync-control-center" blur enable; blur_ignore_transparent enable; shadows disable
|
|
|
|
titlebar_separator enable
|
|
|
|
scratchpad_minimize enable
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|