Skip to main content

Overview

SwayNC (Sway Notification Center) is a simple notification daemon with a GTK notification center for Wayland. It provides elegant notification popups and a centralized control center for managing notifications.

Key Features

Control Center

Centralized notification panel with media controls and quick settings

Custom Styling

Fully customizable with CSS, integrated with theme system

Widget Support

MPRIS media controls, volume, buttons, and custom widgets

Do Not Disturb

Toggle DND mode to silence notifications

Configuration

SwayNC configuration is located at ~/.config/swaync/config.json:
{
  "$schema": "/etc/xdg/swaync/configSchema.json",
  "positionX": "right",
  "positionY": "top",
  "control-center-width": 380,
  "control-center-height": 750,
  "notification-window-width": 400,
  "notification-icon-size": 48,
  "timeout": 4,
  "timeout-low": 2,
  "timeout-critical": 6,
  "transition-time": 200,
  "keyboard-shortcuts": true,
  "image-visibility": "when-available"
}

Position and Size

{
  "positionX": "right",
  "positionY": "top",
  "notification-window-width": 400,
  "notification-icon-size": 48
}
Notifications appear in the top-right corner with 400px width.
{
  "control-center-width": 380,
  "control-center-height": 750,
  "control-center-margin-top": 2,
  "control-center-margin-bottom": 2,
  "control-center-margin-right": 1
}
The control center panel is 380x750px with minimal margins.

Timeout Settings

Different timeout durations based on urgency:
{
  "timeout": 4,          // Normal notifications (4 seconds)
  "timeout-low": 2,      // Low priority (2 seconds)
  "timeout-critical": 6  // Critical notifications (6 seconds)
}
Critical notifications stay visible longer to ensure important messages aren’t missed.

Widgets

SwayNC includes several built-in widgets in the control center:
{
  "widgets": [
    "label",
    "buttons-grid",
    "mpris",
    "title",
    "dnd",
    "notifications"
  ]
}

Widget Configuration

"title": {
  "text": "Notifications",
  "clear-all-button": true,
  "button-text": " 󰎟 "
}
Header with clear all button using Nerd Font icon.

Styling

SwayNC uses CSS for styling, located at ~/.config/swaync/style.css:
@import 'colors/colors.css';

* {
  all: unset;
  color: @text;
  font-size: 14px;
  font-family: "CaskaydiaCove NFM";
  transition: 200ms;
}

.notification-row {
  outline: none;
  margin: 0;
  padding: 0px;
}

.floating-notifications.background .notification-row .notification-background {
  background: alpha(@background, .8);
  box-shadow: 0 0 8px 0 rgba(0,0,0,.6);
  border: 1px solid @selected;
  border-radius: 24px;
  margin: 16px;
  padding: 0;
}

Theme Colors

Colors are automatically loaded from the theme system:
  • @background - Notification background (80% opacity)
  • @text - Text color
  • @selected - Border and accent color
  • @urgent - Critical notification border
The colors/colors.css file is auto-generated by the theme selector and updates when you switch themes.

Critical Notifications

Critical notifications have a distinctive red border:
.notification.critical {
  border: 2px solid @urgent;
}

Usage

Toggle Notification Center

Press SUPER + N to toggle the notification center:
# keybindings.conf
bind = $mainMod, N, exec, swaync-client -t

Command Line Controls

# Toggle notification center
swaync-client -t

# Close notification center
swaync-client -C

# Toggle DND (Do Not Disturb)
swaync-client -d

# Get DND status
swaync-client -D

# Reload config
swaync-client -R

# Send test notification
notify-send "Test" "This is a test notification"

Notification Scripts

SwayNC supports custom scripts for notification actions:
{
  "scripts": {
    "example-script": {
      "exec": "echo 'Do something...'",
      "urgency": "Normal"
    }
  }
}

Custom Notification Example

#!/bin/bash
# Send notification with custom urgency
notify-send -u critical "Battery Low" "Please plug in your charger"

# Notification with action
notify-send "Update Available" "Click to update" --action="update=Update Now"

Notification Visibility

Control which notifications are shown:
{
  "notification-visibility": {
    "example-name": {
      "state": "muted",
      "urgency": "Low",
      "app-name": "Spotify"
    }
  }
}
Mute low-priority notifications from noisy applications like Spotify or Discord.

MPRIS Media Controls

SwayNC includes built-in media player controls:
  • Display currently playing track
  • Album artwork (96x96px)
  • Play/pause button
  • Next/previous track
  • Progress bar
  • Volume control
Supports any MPRIS-compatible media player:
  • Spotify
  • VLC
  • Firefox
  • Chrome
  • mpv

Custom Icons

SwayNC includes custom notification icons in ~/.config/swaync/icons/:
  • Volume icons (mute, low, mid, high)
  • Brightness levels
  • Microphone states
  • Media controls
  • Theme palette
  • And more
~/.config/swaync/icons/
├── volume-high.png
├── volume-mid.png
├── volume-low.png
├── volume-mute.png
├── brightness-100.png
├── brightness-80.png
├── microphone.png
├── microphone-mute.png
└── ...

Theme Integration

SwayNC automatically switches themes with the system:
~/.config/swaync/colors/
├── colors.css              # Current theme (auto-generated)
└── custom/
    ├── kanagawa.css
    ├── catppuccin.css
    ├── gruvbox.css
    └── everforest.css
When you change themes, SwayNC automatically:
  1. Updates colors/colors.css
  2. Reloads the configuration
  3. Applies the new color scheme
No need to restart SwayNC when switching themes - it reloads automatically.

Keyboard Shortcuts

SwayNC supports keyboard navigation:
{
  "keyboard-shortcuts": true
}
  • Arrow keys - Navigate notifications
  • Enter - Activate notification action
  • Delete - Dismiss notification
  • Escape - Close control center
  • D - Toggle Do Not Disturb

Configuration Files

~/.config/swaync/
├── config.json         # Main configuration
├── style.css          # Custom styling
├── icons/             # Custom notification icons
└── colors/
    ├── colors.css     # Current theme (auto-generated)
    └── custom/
        ├── kanagawa.css
        ├── catppuccin.css
        ├── gruvbox.css
        └── everforest.css

Troubleshooting

Ensure SwayNC is running:
ps aux | grep swaync
If not running, start it:
swaync &
Reload SwayNC configuration:
swaync-client -R
Or restart the daemon:
killall swaync && swaync &
Verify media player supports MPRIS:
playerctl -l
Check media is playing:
playerctl status
Verify icon paths in config.json and ensure PNG files exist:
ls ~/.config/swaync/icons/

Learn More

SwayNC Documentation

Official SwayNC documentation and configuration reference

Theme System

Learn how notifications integrate with themes

Build docs developers (and LLMs) love