{"id":13496598,"url":"https://github.com/ErikReider/SwayNotificationCenter","last_synced_at":"2025-03-28T19:30:38.772Z","repository":{"id":37269259,"uuid":"390109160","full_name":"ErikReider/SwayNotificationCenter","owner":"ErikReider","description":"A simple GTK based notification daemon for any Wayland compositor","archived":false,"fork":false,"pushed_at":"2025-03-23T10:25:07.000Z","size":15027,"stargazers_count":1571,"open_issues_count":83,"forks_count":69,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T08:01:37.703Z","etag":null,"topics":["gtk3","linux","notification","notification-center","notification-server","sway","swaywm","vala","wayland","wlroots"],"latest_commit_sha":null,"homepage":"","language":"Vala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ErikReider.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["erikreider"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2021-07-27T19:51:45.000Z","updated_at":"2025-03-27T07:28:57.000Z","dependencies_parsed_at":"2024-02-10T15:26:04.411Z","dependency_job_id":"dafdc70c-6389-471f-8e6c-deb262f2021b","html_url":"https://github.com/ErikReider/SwayNotificationCenter","commit_stats":{"total_commits":532,"total_committers":55,"mean_commits":9.672727272727272,"dds":0.3627819548872181,"last_synced_commit":"2938af2a8fb47866aa19ef08cfea0cde82a59201"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikReider%2FSwayNotificationCenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikReider%2FSwayNotificationCenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikReider%2FSwayNotificationCenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikReider%2FSwayNotificationCenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErikReider","download_url":"https://codeload.github.com/ErikReider/SwayNotificationCenter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246088334,"owners_count":20721663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gtk3","linux","notification","notification-center","notification-server","sway","swaywm","vala","wayland","wlroots"],"created_at":"2024-07-31T19:01:52.587Z","updated_at":"2025-03-28T19:30:38.757Z","avatar_url":"https://github.com/ErikReider.png","language":"Vala","readme":"SwayNotificationCenter\n======================\n\n[![Check PKGBUILD builds for Arch.](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/PKGBUILD-buildd.yml/badge.svg)](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/PKGBUILD-buildd.yml)\n[![Check build for Fedora.](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/fedora-build.yml/badge.svg)](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/fedora-build.yml)\n[![Check build for latest Ubuntu LTS.](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/ubuntu-build.yml/badge.svg)](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/ubuntu-build.yml)\n[![Linting](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/linting.yml/badge.svg)](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/linting.yml)\n\nA simple notification daemon with a GTK gui for notifications and the control center\n\n*Note: SwayNotificationCenter only supports Desktops / Window Managers that\nsupport `wlr_layer_shell_unstable_v1` like Sway or anything wlroots based*\n\n*Note 2: SwayNotificationCenter does not support third-party GTK3 themes and is\nonly tested with the default GTK **Adwaita** theme. Usage of any third-party\ntheme might require extra tweaks to the default CSS style file*\n\n## Demo\n\nhttps://github.com/ErikReider/SwayNotificationCenter/assets/35975961/93ff072f-e653-4064-8200-1c90590b83ef\n\n![Screenshot of panel](./assets/panel.png)\n\nTable of Contents\n=================\n\n  * [Want to show off your sick config?](#want-to-show-off-your-sick-config)\n  * [Features](#features)\n  * [Available Widgets](#available-widgets)\n  * [Planned Features](#planned-features)\n  * [Install](#install)\n     * [Arch](#arch)\n     * [Fedora](#fedora)\n     * [Fedora Silverblue (and other rpm-ostree variants)](#fedora-silverblue-and-other-rpm-ostree-variants)\n     * [Gentoo](#gentoo)\n     * [OpenSUSE Tumbleweed](#opensuse-tumbleweed)\n     * [Ubuntu](#ubuntu)\n     * [Debian](#debian)\n     * [Guix](#guix)\n     * [rde](#rde)\n     * [Other](#other)\n  * [Sway Usage](#sway-usage)\n  * [Run](#run)\n  * [Control Center Shortcuts](#control-center-shortcuts)\n  * [Configuring](#configuring)\n    * [Toggle Buttons](#toggle-buttons)\n  * [Notification Inhibition](#notification-inhibition)\n  * [Scripting](#scripting)\n     * [Disable scripting](#disable-scripting)\n  * [i3status-rs Example](#i3status-rs-example)\n  * [Waybar Example](#waybar-example)\n\n## Want to show off your sick config?\n\nPost your setup here: [Config flex 💪](https://github.com/ErikReider/SwayNotificationCenter/discussions/183)\n\n## Features\n\n- Grouped notifications\n- Keyboard shortcuts\n- Notification body markup with image support\n- Inline replies\n- A panel to view previous notifications\n- Show album art for notifications like Spotify\n- Do not disturb\n- Inhibiting notifications through DBUS or client\n- Restores previous Do not disturb value after restart\n- Click notification to execute default action\n- Show alternative notification actions\n- Copy detected 2FA codes to clipboard\n- Customization through a CSS file\n- Trackpad/mouse gesture to close notification\n- The same features as any other basic notification daemon\n- Basic configuration through a JSON config file\n- Hot-reload config through `swaync-client`\n- Customizable widgets\n\n## Available Widgets\n\nThese widgets can be customized, added, removed and even reordered\n\n- Title\n- Do Not Disturb\n- Notifications (Will always be visible)\n- Label\n- Mpris (Media player controls for Spotify, Firefox, Chrome, etc...)\n- Menubar with dropdown and buttons\n- Button grid\n- Volume slider using PulseAudio\n- Backlight slider\n\n## Planned Features\n\n- Slick animations 😎\n- Other build scripts than a PKGBUILD (debian and/or RHEL systems)\n\n## Install\n\n### Alpine Linux\n\n```zsh\napk add swaync\n````\n\n### Arch\n\n```zsh\nsudo pacman -S swaync\n```\n\nAlternatively, [swaync-git](https://aur.archlinux.org/packages/swaync-git/) is available on the AUR.\n\n### Fedora\n\nThe package is available on COPR:\n\n```zsh\ndnf copr enable erikreider/SwayNotificationCenter\n# Or latest stable release or -git package\ndnf install SwayNotificationCenter\ndnf install SwayNotificationCenter-git\n```\n\n### Fedora Silverblue (and other rpm-ostree variants)\n\nThe package can be layered over the base image after adding the Copr repo as an ostree repo:\n\n```zsh\nsudo curl -sL -o /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:erikreider:SwayNotificationCenter.repo https://copr.fedorainfracloud.org/coprs/erikreider/SwayNotificationCenter/repo/fedora-$(rpm -E %fedora)/erikreider-SwayNotificationCenter-fedora-$(rpm -E %fedora).repo \nrpm-ostree install SwayNotificationCenter\n```\n\n### Gentoo\n\nAn **unofficial** ebuild is available in [GURU](https://github.com/gentoo/guru)\n\n```zsh\neselect repository enable guru\nemaint sync --repo guru\nemerge --ask gui-apps/swaync\n```\n\n### OpenSUSE Tumbleweed\n\n```zsh\nsudo zypper install SwayNotificationCenter\n```\n\n### Ubuntu\n\nLunar and later:\n\n```zsh\nsudo apt install sway-notification-center\n```\n\n\n### Debian\n\nBookworm and later:\n\n```zsh\nsudo apt install sway-notification-center\n```\n\n### Guix\n\nThe simplest way is to install it to user's profile:\n```zsh\nguix install swaynotificationcenter\n```\n\nBut we recommend to use [Guix Home](https://guix.gnu.org/manual/devel/en/html_node/Home-Configuration.html) to manage packages and their configurations declaratively.\n\n### rde\n```\n(use-modules (rde features wm))\n\n;; Include the following code into the list of your rde features:\n(feature-swaynotificationcenter)\n```\n\n### Other\n\n#### Dependencies\n\n- `vala \u003e= 0.56`\n- `meson`\n- `git`\n- `scdoc`\n- `sassc`\n- `gtk3`\n- `gtk-layer-shell`\n- `dbus`\n- `glib2`\n- `gobject-introspection`\n- `libgee`\n- `json-glib`\n- `libhandy`\n- `gvfs`\n- `granite`\n\n##### Optional Dependencies\n\n- `libpulse` (requires meson build options change)\n- `libnotify`\n\n```zsh\nmeson setup build --prefix=/usr\nninja -C build\nmeson install -C build\n```\n\n## Sway Usage\n\n```ini\n# Notification Daemon\nexec swaync\n\n# Toggle control center\nbindsym $mod+Shift+n exec swaync-client -t -sw\n```\n\n## Run\n\nTo start the daemon (remember to kill any other notification daemon before running)\n\n```zsh\n./build/src/swaync\n```\n\nTo toggle the panel\n\n```zsh\n./build/src/swaync-client -t\n```\n\nTo reload the config\n\n```zsh\n./build/src/swaync-client -R\n```\n\nTo reload css after changes\n\n```zsh\n./build/src/swaync-client -rs\n```\n\n## Control Center Shortcuts\n\n- Up/Down: Navigate notifications\n- Home: Navigate to the latest notification\n- End: Navigate to the oldest notification\n- Escape/Caps_Lock: Close notification panel\n- Return: Execute default action or close notification if none\n- Delete/BackSpace: Close notification\n- Shift+C: Close all notifications\n- Shift+D: Toggle Do Not Disturb\n- Buttons 1-9: Execute alternative actions\n- Left click button / actions: Activate notification action\n- Middle/Right click notification: Close notification\n\n## Configuring\n\nThe main config file is located in `/etc/xdg/swaync/config.json`. Copy it over\nto your `.config/swaync/` folder to customize without needing root access.\nSee `swaync(5)` man page for more information\n\nTo reload the config, you'll need to run `swaync-client --reload-config`\n\nThe main CSS style file is located in `/etc/xdg/swaync/style.css`. Copy it over\nto your `~/.config/swaync/` folder to customize without needing root access. For\nmore advanced/larger themes, I recommend that you use the SCSS files from source\nand customize them instead. To use the SCSS files, compile with `sassc`.\n\n**Tip**: running swaync with `GTK_DEBUG=interactive swaync` will open a inspector\nwindow that'll allow you to see all of the CSS classes + other information.\n\n## Toggle Buttons\n\nTo add toggle buttons to your control center you can set the \"type\" in any acton to \"toggle\".\nThe toggle button supports different commands depending on the state of the button and\nan \"update-command\" to update the state in case of changes from outside swaync. The update-command\nis called every time the control center is opened.\nThe active toggle button also gains the css-class \".toggle:checked\"\n\n`config.json` example:\n\n```jsonc\n{\n  \"buttons-grid\": { // also works with actions in menubar widget\n    \"actions\": [\n      {\n        \"label\": \"WiFi\",\n        \"type\": \"toggle\",\n        \"active\": true,\n        \"command\": \"sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] \u0026\u0026 nmcli radio wifi on || nmcli radio wifi off'\",\n        \"update-command\": \"sh -c '[[ $(nmcli radio wifi) == \\\"enabled\\\" ]] \u0026\u0026 echo true || echo false'\"\n      }\n    ]\n  }\n}\n```\n\n## Notification Inhibition\n\nNotifications can be inhibited through the provided `swaync-client` executable\nor through the DBus interface `org.erikreider.swaync.cc`.\n\nHere's an example of notification inhibition while screen sharing through\n`xdg-desktop-portal-wlr`\n\n```conf\n# xdg-desktop-portal-wlr config\n[screencast]\nexec_before=swaync-client --inhibitor-add \"xdg-desktop-portal-wlr\"\nexec_after=swaync-client --inhibitor-remove \"xdg-desktop-portal-wlr\"\n```\n\n## Scripting\n\nScripting rules and logic:\n\n. \u003cb\u003eOnly one\u003c/b\u003e script can be fired per notification\n. Each script requires `exec` and at least one of the other properties\n. All listed properties must match the notification for the script to be ran\n. If any of the properties doesn't match, the script will be skipped\n. If a notification doesn't include one of the properties, that property will\nbe skipped\n· If a script has `run-on` set to `action`, the script will only run when an\naction is taken on the notification\n\nMore information can be found in the `swaync(5)` man page\n\nNotification information can be printed into a terminal by running\n`G_MESSAGES_DEBUG=all swaync` (when a notification appears).\n\nConfig properties:\n\n```jsonc\n{\n  \"scripts\": {\n    \"example-script\": {\n      \"exec\": \"Your shell command or script here...\",\n      \"app-name\": \"Notification app-name Regex\",\n      \"summary\": \"Notification summary Regex\",\n      \"body\": \"Notification body Regex\",\n      \"urgency\": \"Low or Normal or Critical\",\n      \"category\": \"Notification category Regex\"\n    }\n  }\n  // other non scripting properties...\n}\n```\n\n`config.json` example:\n\n```jsonc\n{\n  \"scripts\": {\n    // This script will only run when Spotify sends a notification containing\n    // that exact summary and body\n    \"example-script\": {\n      \"exec\": \"/path/to/myRickRollScript.sh\",\n      \"app-name\": \"Spotify\"\n      \"summary\": \"Never Gonna Give You Up\",\n      \"body\": \"Rick Astley - Whenever You Need Somebody\"\n    }\n  }\n  // other non scripting properties...\n}\n```\n\n### Disable scripting\n\nTo completely disable scripting, the project needs to be built like so:\n\n```zsh\nmeson build -Dscripting=false\nninja -C build\nmeson install -C build\n```\n\n## i3status-rs Example\n\n\u003e **Note** Ths requires i3status-rs version 0.31.0+\n\ni3status-rs config\n\n```toml\n[[block]]\nblock = \"notify\"\nformat = \" $icon {($notification_count.eng(w:1)) |}\"\ndriver = \"swaync\"\n[[block.click]]\nbutton = \"left\"\naction = \"show\"\n[[block.click]]\nbutton = \"right\"\naction = \"toggle_paused\"\n```\n\n## Waybar Example\n\nThis example requires `NotoSansMono Nerd Font` to get the icons looking right\n\nWaybar config\n\n```json\n  \"custom/notification\": {\n    \"tooltip\": false,\n    \"format\": \"{icon}\",\n    \"format-icons\": {\n      \"notification\": \"\u003cspan foreground='red'\u003e\u003csup\u003e\u003c/sup\u003e\u003c/span\u003e\",\n      \"none\": \"\",\n      \"dnd-notification\": \"\u003cspan foreground='red'\u003e\u003csup\u003e\u003c/sup\u003e\u003c/span\u003e\",\n      \"dnd-none\": \"\",\n      \"inhibited-notification\": \"\u003cspan foreground='red'\u003e\u003csup\u003e\u003c/sup\u003e\u003c/span\u003e\",\n      \"inhibited-none\": \"\",\n      \"dnd-inhibited-notification\": \"\u003cspan foreground='red'\u003e\u003csup\u003e\u003c/sup\u003e\u003c/span\u003e\",\n      \"dnd-inhibited-none\": \"\"\n    },\n    \"return-type\": \"json\",\n    \"exec-if\": \"which swaync-client\",\n    \"exec\": \"swaync-client -swb\",\n    \"on-click\": \"swaync-client -t -sw\",\n    \"on-click-right\": \"swaync-client -d -sw\",\n    \"escape\": true\n  },\n```\n\nWaybar css file\n\n```css\n#custom-notification {\n  font-family: \"NotoSansMono Nerd Font\";\n}\n```\n\nAlternatively, the number of notifications can be shown by adding `{}` anywhere in the `format` field in the Waybar config\n\n```jsonc\n  \"custom/notification\": {\n    \"format\": \"{} {icon}\",\n    // ...\n  },\n```\n","funding_links":["https://github.com/sponsors/erikreider"],"categories":["Vala","Tools","Notifications Daemon","Notifications","🗂️ System \u0026 Widgets","Apps","linux"],"sub_categories":["Notifications","Utilities","System Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FErikReider%2FSwayNotificationCenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FErikReider%2FSwayNotificationCenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FErikReider%2FSwayNotificationCenter/lists"}