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 @@
{
config,
lib,
pkgs,
...
}: {
{pkgs, ...}: {
imports = [
./sway/default.nix
./niri/default.nix
@ -13,7 +8,7 @@
./fuzzel/default.nix
./swaylock/default.nix
./swayidle/default.nix
./swaync/default.nix
./mako/default.nix
./waybar/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+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"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "volumectl" "-u" "-" "5"; }
XF86AudioMute allow-when-locked=true { spawn "volumectl" "%"; }

View file

@ -77,6 +77,7 @@
];
window = {
border = 1;
titlebar = false;
commands =
(map (criteria: {
inherit criteria;
@ -134,8 +135,6 @@
# System utilities
"${modifier}+F1" = "exec swaylockfx";
"${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";
};
};
@ -150,13 +149,12 @@
corner_radius 10
shadows disable
shadow_blur_radius 0
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 "launcher" blur enable; blur_ignore_transparent enable; shadows disable
layer_effects "waybar" 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
layer_effects "system-menu" blur enable; shadows disable
layer_effects "gtk-layer-shell" blur enable; shadows disable
layer_effects "notifications" blur enable; shadows disable
layer_effects "launcher" blur enable; shadows disable
layer_effects "waybar" blur enable; shadows disable
layer_effects "avizo" blur enable; shadows disable
titlebar_separator enable
scratchpad_minimize enable
'';

View file

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