Switch swaync for mako

Move waybar to bottom of screen, move workspaces module to the left
and mpris to the centre
This commit is contained in:
Evie Litherland-Smith 2024-05-28 07:47:00 +01:00
parent 8519ba9fe5
commit 98b04a645a
5 changed files with 55 additions and 49 deletions

View file

@ -1,9 +1,4 @@
{ {pkgs, ...}: {
config,
lib,
pkgs,
...
}: {
imports = [ imports = [
./sway/default.nix ./sway/default.nix
./niri/default.nix ./niri/default.nix
@ -13,7 +8,7 @@
./fuzzel/default.nix ./fuzzel/default.nix
./swaylock/default.nix ./swaylock/default.nix
./swayidle/default.nix ./swayidle/default.nix
./swaync/default.nix ./mako/default.nix
./waybar/default.nix ./waybar/default.nix
./wlogout/default.nix ./wlogout/default.nix
]; ];

View file

@ -0,0 +1,24 @@
{
config,
fonts,
accentColour ? "base07",
...
}: {
services.mako = with config.scheme.withHashtag; {
enable = true;
anchor = "top-right";
font = "${fonts.monospace.name} ${toString fonts.sizes.popups}";
layer = "top";
markup = true;
maxVisible = 10;
icons = true;
iconPath = with config.gtk.iconTheme; "${package}/share/icons/${name}";
textColor = "${base05}FF";
progressColor = "over ${red}FF";
backgroundColor = "${base00}50";
borderColor = "${config.scheme.withHashtag.${accentColour}}FF";
borderRadius = 10;
borderSize = 1;
defaultTimeout = 0;
};
}

View file

@ -59,9 +59,6 @@ binds {
Mod+Return { spawn "foot"; } Mod+Return { spawn "foot"; }
Mod+Shift+Return { spawn "emacsclient" "-c"; } Mod+Shift+Return { spawn "emacsclient" "-c"; }
Mod+Z { spawn "swaync-client" "-t" "-sw"; }
Mod+Shift+Z { spawn "swaync-client" "-d" "-sw"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "volumectl" "-u" "+" "5"; } XF86AudioRaiseVolume allow-when-locked=true { spawn "volumectl" "-u" "+" "5"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "volumectl" "-u" "-" "5"; } XF86AudioLowerVolume allow-when-locked=true { spawn "volumectl" "-u" "-" "5"; }
XF86AudioMute allow-when-locked=true { spawn "volumectl" "%"; } XF86AudioMute allow-when-locked=true { spawn "volumectl" "%"; }

View file

@ -77,6 +77,7 @@
]; ];
window = { window = {
border = 1; border = 1;
titlebar = false;
commands = commands =
(map (criteria: { (map (criteria: {
inherit criteria; inherit criteria;
@ -134,8 +135,6 @@
# System utilities # System utilities
"${modifier}+F1" = "exec swaylockfx"; "${modifier}+F1" = "exec swaylockfx";
"${modifier}+p" = "exec ${programs.wlogout.package}/bin/wlogout"; "${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"; "${modifier}+Shift+Return" = "exec ${programs.emacs.finalPackage}/bin/emacsclient -c";
}; };
}; };
@ -150,13 +149,12 @@
corner_radius 10 corner_radius 10
shadows disable shadows disable
shadow_blur_radius 0 shadow_blur_radius 0
layer_effects "system-menu" blur enable; blur_ignore_transparent enable; shadows disable layer_effects "system-menu" blur enable; shadows disable
layer_effects "gtk-layer-shell" blur enable; blur_ignore_transparent enable; shadows disable layer_effects "gtk-layer-shell" blur enable; shadows disable
layer_effects "launcher" blur enable; blur_ignore_transparent enable; shadows disable layer_effects "notifications" blur enable; shadows disable
layer_effects "waybar" blur enable; blur_ignore_transparent enable; shadows disable layer_effects "launcher" blur enable; shadows disable
layer_effects "avizo" blur enable; blur_ignore_transparent enable; shadows disable layer_effects "waybar" blur enable; shadows disable
layer_effects "swaync-notification-window" blur enable; blur_ignore_transparent enable; shadows disable layer_effects "avizo" blur enable; shadows disable
layer_effects "swaync-control-center" blur enable; blur_ignore_transparent enable; shadows disable
titlebar_separator enable titlebar_separator enable
scratchpad_minimize enable scratchpad_minimize enable
''; '';

View file

@ -21,10 +21,14 @@
main = { main = {
name = "main"; name = "main";
layer = "top"; layer = "top";
position = "top"; position = "bottom";
# Layout # Layout
"modules-left" = ["mpris"]; "modules-left" = [
"modules-center" = ["sway/workspaces"]; "sway/workspaces"
];
"modules-center" = [
"mpris"
];
"modules-right" = [ "modules-right" = [
"custom/notification" "custom/notification"
"pulseaudio" "pulseaudio"
@ -207,36 +211,23 @@
format-icons = ["󱃍 " "󰁺 " "󰁻 " "󰁼 " "󰁽 " "󰁾 " "󰁿 " "󰂀 " "󰂁 " "󰂂 " "󰁹 "]; format-icons = ["󱃍 " "󰁺 " "󰁻 " "󰁼 " "󰁽 " "󰁾 " "󰁿 " "󰂀 " "󰂁 " "󰂂 " "󰁹 "];
}; };
"custom/notification" = let "custom/notification" = let
swaync = pkgs.swaynotificationcenter; makoctl = "${pkgs.mako}/bin/makoctl";
jq = "${pkgs.jq}/bin/jq";
in { in {
"tooltip" = false; exec = "( ${makoctl} list | ${jq} -e '.data[] | length > 0' >/dev/null && echo '󱅫 ' ) || echo '󰂚 ' ";
"format" = "{icon}{}"; format = "{}";
"format-icons" = { on-click = "${makoctl} dismiss -a";
"notification" = "󱅫 "; interval = 3;
"none" = "󰂚 ";
"dnd-notification" = "󰅸 ";
"dnd-none" = "󰂜 ";
"inhibited-notification" = "󰅸 ";
"inhibited-none" = "󰂜 ";
"dnd-inhibited-notification" = "󰅸 ";
"dnd-inhibited-none" = "󰂜 ";
};
"return-type" = "json";
"exec-if" = "which ${swaync}/bin/swaync-client";
"exec" = "${swaync}/bin/swaync-client -swb";
"on-click" = "${swaync}/bin/swaync-client -t -sw";
"on-click-right" = "${swaync}/bin/swaync-client -d -sw";
"escape" = true;
}; };
"custom/weather" = let "custom/weather" = let
date-format = "%Y-%m-%d"; date-format = "%Y-%m-%d";
custom-indicator = "{ICON}{temp_C}({FeelsLikeC})"; custom-indicator = "{ICON}{temp_C}({FeelsLikeC})";
in { in {
"format" = "{}°"; format = "{}°";
"tooltip" = true; tooltip = true;
"interval" = 900; # Every 15 minutes interval = 900; # Every 15 minutes
"exec" = ''${pkgs.wttrbar}/bin/wttrbar --location Didcot --date-format "${date-format}" --custom-indicator "${custom-indicator}"''; exec = ''${pkgs.wttrbar}/bin/wttrbar --location Didcot --date-format "${date-format}" --custom-indicator "${custom-indicator}"'';
"return-type" = "json"; return-type = "json";
}; };
tray = { tray = {
icon-size = builtins.floor fonts.sizes.popups; icon-size = builtins.floor fonts.sizes.popups;
@ -272,12 +263,13 @@
color: ${base05}; color: ${base05};
background: alpha(${base00}, ${alpha}); background: alpha(${base00}, ${alpha});
padding: 0px; padding: 0px;
border: none; border-top: 1px solid ${base04};
} }
tooltip { tooltip {
background: alpha(${base00}, ${alpha}); background: ${base00};
border: none; border: 1px solid ${config.scheme.withHashtag.${accentColour}};
border-radius: 10px;
box-shadow: none; box-shadow: none;
} }