Replace dunst with swaync for fractional scaling support

Dunst lacks wp_fractional_scale_v1, causing jagged font rendering
on external monitors in mixed-DPI setups (laptop 2.5x + externals 1x).
swaync (GTK4) handles fractional scaling natively.

Style based on catppuccin/swaync with Lavender accent.
This commit is contained in:
nevaforget 2026-04-01 14:41:42 +02:00
parent 7cd34f2ace
commit 8c7e9407c6
8 changed files with 422 additions and 472 deletions

View File

@ -1,5 +1,11 @@
# Decisions
## 2026-04-01 Replace dunst with swaync as notification daemon
- **Who**: Dominik, Ragnar
- **Why**: Dunst lacks wp_fractional_scale_v1 support, causing aliased/jagged font rendering on external monitors in mixed-DPI setups (laptop eDP-1 at 2.5x, externals at 1x). Confirmed by testing: removing fractional scaling fixed the issue. swaync uses GTK4 which handles fractional scaling natively.
- **Tradeoffs**: swaync is heavier than dunst (GTK4 + libadwaita dependency). Loses dunstctl CLI (replaced by swaync-client). Gains notification center panel with DnD toggle, grouping, MPRIS widget support. Waybar already had swaync-client integration with exec-if guard.
- **How**: Replaced dunst with swaync in packages/official.txt and archinstall config. Niri spawn-at-startup updated. Waybar dunstctl widget removed (swaync-client widget already present). New swaync config.json and style.css based on catppuccin/swaync upstream theme with Lavender accent instead of Blue.
## 2026-03-31 Audit: shell script quoting fixes, PKGBUILD permissions
- **Who**: Ragnar, Dom

View File

@ -46,7 +46,7 @@
"niri",
"waybar",
"foot",
"dunst",
"swaync",
"polkit-gnome",
"stow"
],

View File

@ -1,460 +0,0 @@
# ABOUTME: Moonarch default dunst notification daemon config with Catppuccin Mocha colors.
# ABOUTME: User overrides go in ~/.config/dunst/dunstrc
# See dunst(5) for all configuration options
[global]
### Display ###
enable_posix_regex = true
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
### Geometry ###
# dynamic width from 0 to 300
# width = (0, 300)
# constant width of 300
width = 300
# The maximum height of a single notification, excluding the frame.
#height = 300
# Position the notification in the top right corner
origin = top-right
# Offset from the origin
offset = (15, 15)
# Scale factor. It is auto-detected if value is 0.
scale = 0
# Maximum number of notification (0 means no limit)
notification_limit = 10
### Progress bar ###
# Turn on the progess bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
# it's at least twice as big as the frame width.
progress_bar_height = 8
# Set the frame width of the progress bar
progress_bar_frame_width = 1
# Set the minimum width for the progress bar
progress_bar_min_width = 150
# Set the maximum width for the progress bar
progress_bar_max_width = 300
highlight = "#b4befe"
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
transparency = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
# If gap_size is greater than 0, this setting will be ignored.
separator_height = 2
# Padding between text and separator.
padding = 16
# Horizontal padding.
horizontal_padding = 16
# Padding between text and icon.
text_icon_padding = 0
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 2
# Defines color of the frame around the notification window.
frame_color = "#b4befe"
# Size of gap to display between notifications - requires a compositor.
# If value is greater than 0, separator_height will be ignored and a border
# of size frame_width will be drawn around each notification instead.
# Click events on gaps do not currently propagate to applications below.
gap_size = 5
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
# idle_threshold = 120
### Text ###
font = UbuntuSans Nerd Font 10
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Vertical alignment of message text and icon.
# Possible values are "top", "center" and "bottom".
vertical_alignment = center
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Recursive icon lookup. You can set a single theme, instead of having to
# define all lookup paths.
enable_recursive_icon_lookup = true
# Set icon theme (only used for recursive icon lookup)
icon_theme = "Colloid-Grey-Catppuccin-Dark"
# You can also set multiple icon themes, with the leftmost one being used first.
# icon_theme = "Adwaita, breeze"
# Align icons left/right/top/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,
# max_icon_size takes precedence over this.
min_icon_size = 16
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 64
# Paths to default icons (only neccesary when not using recursive icon lookup)
#icon_path = /usr/share/icons/Tela-purple-dark/16x16/status/:/usr/share/icons/Tela-purple-dark/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 10
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notications appear under fullscreen
# applications (default: overlay)
layer = overlay
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines list of actions for each mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: Invoke the action determined by the action_name rule. If there is no
# such action, open the context menu.
# * open_url: If the notification has exactly one url, open it. If there are multiple
# ones, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
# * context: Open context menu for the notification.
# * context_all: Open context menu for all notifications.
# These values can be strung together for each mouse event, and
# will be executed in sequence.
mouse_left_click = close_current
mouse_middle_click = do_action, close_current
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = true
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#1e1e2e"
foreground = "#eff1f5"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_normal]
background = "#1e1e2e"
foreground = "#eff1f5"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_critical]
background = "#313244"
foreground = "#CDD6F4"
frame_color = "#eba0ac"
timeout = 60
# Icon for notifications with critical urgency, uncomment to enable
#default_icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# set_category
# timeout
# urgency
# icon_position
# skip_display
# history_ignore
# action_name
# word_wrap
# ellipsize
# alignment
# hide_text
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
[fullscreen_show_critical]
msg_urgency = critical
fullscreen = pushback
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# skip_display = true
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg

View File

@ -79,7 +79,7 @@ layout {
// xwayland-satellite is managed automatically since niri 25.08
// kanshi is managed via systemd user service (kanshi.service)
spawn-at-startup "waybar"
spawn-at-startup "dunst" "-conf" "/etc/xdg/dunst/dunstrc"
spawn-at-startup "swaync"
spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
spawn-at-startup "nm-applet" "--indicator"
spawn-sh-at-startup "waypaper --restore"
@ -134,7 +134,7 @@ binds {
Mod+Return hotkey-overlay-title="Open a Terminal: foot" { spawn "foot"; }
Mod+Space hotkey-overlay-title="Run an Application: walker" { spawn "walker"; }
Super+Alt+L hotkey-overlay-title="Session Menu: moonset" { spawn "moonset"; }
Mod+Escape hotkey-overlay-title="Session Menu: moonset" { spawn "moonset"; }
Mod+A { spawn "walker" "-s" "audio"; }
@ -272,7 +272,7 @@ binds {
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
Super+Alt+L allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
Mod+Shift+E { quit; }
Ctrl+Alt+Delete { quit; }

View File

@ -0,0 +1,46 @@
{
"$schema": "/etc/xdg/swaync/configSchema.json",
"positionX": "right",
"positionY": "top",
"layer": "overlay",
"control-center-layer": "top",
"cssPriority": "application",
"notification-window-width": 300,
"notification-icon-size": 64,
"notification-body-image-height": 100,
"notification-body-image-width": 200,
"timeout": 10,
"timeout-low": 5,
"timeout-critical": 0,
"fit-to-screen": true,
"control-center-margin-top": 15,
"control-center-margin-bottom": 15,
"control-center-margin-right": 15,
"control-center-width": 400,
"control-center-height": 600,
"notification-2fa-action": true,
"notification-inline-replies": false,
"notification-visibility": {},
"widgets": [
"title",
"dnd",
"notifications"
],
"widget-config": {
"title": {
"text": "Notifications",
"clear-all-button": true,
"button-text": "Clear All"
},
"dnd": {
"text": "Do Not Disturb"
}
}
}

View File

@ -0,0 +1,364 @@
/* ABOUTME: Moonarch swaync notification styling with Catppuccin Mocha colors. */
/* ABOUTME: Based on catppuccin/swaync, accent changed from Blue to Lavender. */
/* Catppuccin Mocha palette */
@define-color base #1e1e2e;
@define-color mantle #181825;
@define-color crust #11111b;
@define-color surface0 #313244;
@define-color surface1 #45475a;
@define-color surface2 #585b70;
@define-color text #cdd6f4;
@define-color subtext0 #a6adc8;
@define-color subtext1 #bac2de;
@define-color overlay0 #6c7086;
@define-color lavender #b4befe;
@define-color sapphire #74c7ec;
@define-color red #f38ba8;
@define-color maroon #eba0ac;
@define-color pink #f5c2e7;
@define-color yellow #f9e2af;
* {
all: unset;
font-size: 14px;
font-family: "UbuntuSans Nerd Font";
transition: 200ms;
}
trough highlight {
background: @text;
}
scale {
margin: 0 7px;
}
scale trough {
margin: 0rem 1rem;
min-height: 8px;
min-width: 70px;
border-radius: 12.6px;
}
trough slider {
margin: -10px;
border-radius: 12.6px;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
transition: all 0.2s ease;
background-color: @lavender;
}
trough slider:hover {
box-shadow: 0 0 2px rgba(0, 0, 0, 0.8), 0 0 8px @lavender;
}
trough {
background-color: @surface0;
}
/* ── Notifications ── */
.notification-background {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px @surface1;
border-radius: 12.6px;
margin: 18px;
background: @mantle;
color: @text;
padding: 0;
}
.notification-background .notification {
padding: 7px;
border-radius: 12.6px;
}
.notification-background .notification.critical {
box-shadow: inset 0 0 0 2px @red;
}
.notification .notification-content {
margin: 7px;
}
.notification .notification-content overlay {
margin: 4px;
}
.notification-content .summary {
color: @text;
}
.notification-content .time {
color: @subtext0;
}
.notification-content .body {
color: @subtext1;
}
.notification > *:last-child > * {
min-height: 3.4em;
}
/* Close button */
.notification-background .close-button {
margin: 7px;
padding: 2px;
border-radius: 50%;
color: @base;
background-color: @red;
}
.notification-background .close-button:hover {
background-color: @maroon;
}
.notification-background .close-button:active {
background-color: @pink;
}
/* Action buttons */
.notification .notification-action {
border-radius: 7px;
color: @text;
box-shadow: inset 0 0 0 1px @surface1;
margin: 4px;
padding: 8px;
font-size: 0.2rem;
}
.notification .notification-action {
background-color: @surface0;
}
.notification .notification-action:hover {
background-color: @surface1;
}
.notification .notification-action:active {
background-color: @surface2;
}
/* ── Progress bar ── */
.notification.critical progress {
background-color: @red;
}
.notification.low progress,
.notification.normal progress {
background-color: @lavender;
}
.notification progress,
.notification trough,
.notification progressbar {
border-radius: 12.6px;
padding: 3px 0;
}
/* ── Control center ── */
.control-center {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px @surface0;
border-radius: 12.6px;
background-color: @base;
color: @text;
padding: 14px;
}
.control-center .notification-background {
border-radius: 7px;
box-shadow: inset 0 0 0 1px @surface1;
margin: 4px 10px;
}
.control-center .notification-background .notification {
border-radius: 7px;
}
.control-center .notification-background .notification.low {
opacity: 0.8;
}
.control-center .widget-title > label {
color: @text;
font-size: 1.3em;
}
.control-center .widget-title button {
border-radius: 7px;
color: @text;
background-color: @surface0;
box-shadow: inset 0 0 0 1px @surface1;
padding: 8px;
}
.control-center .widget-title button:hover {
background-color: @surface1;
}
.control-center .widget-title button:active {
background-color: @surface2;
}
.control-center .notification-group {
margin-top: 10px;
}
.control-center .notification-group:focus .notification-background {
background-color: @surface0;
}
scrollbar slider {
margin: -3px;
opacity: 0.8;
}
scrollbar trough {
margin: 2px 0;
}
/* ── DnD toggle ── */
.widget-dnd {
margin-top: 5px;
border-radius: 8px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 8px;
background: @surface0;
box-shadow: none;
}
.widget-dnd > switch:checked {
background: @lavender;
}
.widget-dnd > switch slider {
background: @surface1;
border-radius: 8px;
}
/* ── MPRIS ── */
.widget-mpris-player {
background: @surface0;
border-radius: 12.6px;
color: @text;
}
.mpris-overlay {
background-color: @surface0;
opacity: 0.9;
padding: 15px 10px;
}
.widget-mpris-album-art {
-gtk-icon-size: 100px;
border-radius: 12.6px;
margin: 0 10px;
}
.widget-mpris-title {
font-size: 1.2rem;
color: @text;
}
.widget-mpris-subtitle {
font-size: 1rem;
color: @subtext1;
}
.widget-mpris button {
border-radius: 12.6px;
color: @text;
margin: 0 5px;
padding: 2px;
}
.widget-mpris button image {
-gtk-icon-size: 1.8rem;
}
.widget-mpris button:hover {
background-color: @surface0;
}
.widget-mpris button:active {
background-color: @surface1;
}
.widget-mpris button:disabled {
opacity: 0.5;
}
/* ── Menubar / Power ── */
.widget-menubar > box > .menu-button-bar > button > label {
font-size: 3rem;
padding: 0.5rem 2rem;
}
.widget-menubar > box > .menu-button-bar > :last-child {
color: @red;
}
.power-buttons button:hover,
.powermode-buttons button:hover,
.screenshot-buttons button:hover {
background: @surface0;
}
/* ── Labels / Buttons Grid ── */
.control-center .widget-label > label {
color: @text;
font-size: 2rem;
}
.widget-buttons-grid {
padding-top: 1rem;
}
.widget-buttons-grid > flowbox > flowboxchild > button label {
font-size: 2.5rem;
}
/* ── Volume / Backlight ── */
.widget-volume {
padding: 1rem 0;
}
.widget-volume label {
color: @sapphire;
padding: 0 1rem;
}
.widget-volume trough highlight {
background: @sapphire;
}
.widget-backlight trough highlight {
background: @yellow;
}
.widget-backlight label {
font-size: 1.5rem;
color: @yellow;
}
.widget-backlight .KB {
padding-bottom: 1rem;
}
.image {
padding-right: 0.5rem;
}

View File

@ -30,7 +30,7 @@
"gamemode",
//"custom/updates",
"idle_inhibitor",
"custom/dnd",
"privacy"
]
},
@ -202,12 +202,6 @@
"exec": "waybar-module-pacman-updates",
"on-click": "alacritty paru"
},
"custom/dnd": {
"format": "{}",
"exec": "dunstctl is-paused | sed 's/false/󰂚/;s/true/󰂛/'",
"interval": 2,
"on-click": "dunstctl set-paused toggle"
},
"custom/notification": {
"tooltip": false,
"format": "{icon} {}",

View File

@ -60,7 +60,7 @@ xwayland-satellite
# Desktop Utilities
waybar
dunst
swaync
cliphist
wl-clipboard
libnotify