ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.17k stars 60 forks source link

Width of NC is halved after update to `v1.6.1` #125

Closed tukusejssirs closed 2 years ago

tukusejssirs commented 2 years ago

After yesterday’s update, I noticed that the NC width (when open) is halved. The notification itself (when it appears) has the expected size though.

As I understand it, notification-window-width configuration changes the size of NC. I have set it to 500, but even when I change it to 1000, the size of NC does not change.

Note that I haven’t changed the config before or after the upgrade.

I use swaync on Arch Linux with sway@1.8 built from master branch (installed using sway-git; commit 440d0bc2).

Notification Notification centre

config.json ```json { "$schema": "/etc/xdg/swaync/configSchema.json", "positionX": "right", "positionY": "top", "control-center-margin-top": 5, "control-center-margin-bottom": 5, "control-center-margin-right": 5, "control-center-margin-left": 0, "timeout": 7, "timeout-low": 3, "timeout-critical": 0, "notification-window-width": 500, "keyboard-shortcuts": true, "image-visibility": "always", "transition-time": 200, "hide-on-clear": false, "hide-on-action": true, "script-fail-notify": true, "scripts": { "example-script": { "exec": "echo 'Do something...'", "urgency": "Normal" } }, "notification-visibility": { "example-name": { "state": "muted", "urgency": "Low", "app-name": "Spotify" } } } ```
style.css ```css @define-color border-color rgb(7, 7, 7); @define-color bg rgb(58, 58, 58); @define-color bg-hover rgb(68, 68, 68); @define-color bg-focus rgba(68, 68, 68, 0.6); @define-color bg-selected rgb(0, 128, 255); .notification-row { outline: none; } .notification-row:focus, .notification-row:hover { background: @bg-focus; } .notification { border-radius: 10px; margin: 6px 12px; box-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.3); padding: 0; } .notification-content { /*background: sol;*/ padding: 6px; border-radius: 10px; } .close-button { background: black; color: white; text-shadow: none; padding: 0 2px; box-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.3); border-radius: 100%; } .close-button:hover { background: rgb(30, 30, 30); transition: all 0.15s ease-in-out; } .notification-default-action, .notification-action { padding: 4px; margin: 0; box-shadow: none; background: @bg; border: 1px solid @border-color; } .notification-default-action:hover, .notification-action:hover { background: @bg-hover; } .notification-default-action { border-radius: 10px; } /* When alternative actions are visible */ .notification-default-action:not(:only-child) { border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; } .notification-action { border-radius: 0px; border-top: none; border-right: none; } /* add bottom border radius to eliminate clipping */ .notification-action:first-child { border-bottom-left-radius: 10px; } .notification-action:last-child { border-bottom-right-radius: 10px; border-right: 1px solid @border-color; } .image { } .body-image { margin-top: 6px; background-color: white; border-radius: 10px; } .summary { color: white; text-shadow: none; } .time { color: white; text-shadow: none; } .body { background: transparent; color: white; text-shadow: none; } .top-action-title { color: white; text-shadow: none; } .control-center-clear-all { color: white; text-shadow: none; background: @bg; border: 1px solid @border-color; box-shadow: none; border-radius: 10px; } .control-center-clear-all:hover { background: @bg-hover; } .control-center-dnd { border-radius: 10px; background: @bg; border: 1px solid @border-color; box-shadow: none; } .control-center-dnd:checked { background: @bg-selected; } .control-center-dnd slider { background: @bg-hover; } .control-center { background: rgba(0, 0, 0, 0.7); } .control-center-list { background: transparent; } .floating-notifications { background: transparent; } ```
ErikReider commented 2 years ago

This release includes setting the width of the control center. Check the man page for width configuration :)

tukusejssirs commented 2 years ago

Thanks for fast reply! :pray:

However, I can’t find the width configuration in man swaync.

man swaync ```bash swaync(1) General Commands Manual swaync(1) NAME swaync - A simple notification daemon with a GTK gui for notifications and the control center USAGE swaync [option] OPTIONS -h, --help Show help options -v, --version Prints version -s, --style Use a custom Stylesheet file -c, --config Use a custom config file Control Center Keyboard Shortcuts Up/Down: Navigate notifications Home: Navigate to the latest notification End: Navigate to the oldest notification Escape/Caps_Lock: Close notification panel Return: Execute default action or close notification if none Delete/BackSpace: Close notification Shift+C: Close all notifications Shift+D: Toggle Do Not Disturb Buttons 1-9: Execute alternative actions Left click button / actions: Activate notification action Right click notification: Close notification CONFIGURATION The main config file is located in /etc/xdg/swaync/config.json. Copy it over to your ~/.config/swaync/ folder to customize without needing root access. To reload the config, you'll need to run swaync-client --reload-config For information on the config file format, see swaync(5) Scripting Scripting rules and logic: 1. Only one script can be fired per notification 2. Each script requires `exec` and at least one of the other properties 3. All listed properties must match the notification for the script to be ran 4. If any of the propeties doesn't match, the script will be skipped 5. If a notification doesn't include one of the properties, that property will be skipped Notification information can be printed into a terminal by running G_MESSAGES_DEBUG=all swaync (when a notification appears). Config properties: { "scripts": { "example-script": { "exec": "Your shell command or script here...", "app-name": "Notification app-name Regex", "summary": "Notification summary Regex", "body": "Notification body Regex", "urgency": "Low or Normal or Critical", "category": "Notification category Regex" } } other non scripting properties... } config.json example: { "scripts": { // This script will only run when Spotify sends a notification containing // that exact summary and body "example-script": { "exec": "~/.config/swaync/myRickRollScript.sh", "app-name": "Spotify" "summary": "Never Gonna Give You Up", "body": "Rick Astley - Whenever You Need Somebody" } } other non scripting properties... } Disable scripting To completely disable scripting, the project needs to be built like so: meson build -Dscripting=false ninja -C build meson install -C build Waybar Example This example requires NotoSansMono Nerd Font to get the icons looking right Waybar config "custom/notification": { "tooltip": false, "format": "{icon}", "format-icons": { "notification": "", "none": "", "dnd-notification": "", "dnd-none": "" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", "on-click": "swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true }, Waybar css file #custom-notification { font-family: "NotoSansMono Nerd Font"; } 2022-05-14 swaync(1) ```

Update: Aaah, you meant man 5 swaync. :man_facepalming:

Update 2

Just a note:

ErikReider commented 2 years ago
* `notification-window-width` is the width of the notification bubble (default: `500`);

It's the width of the popup notifications

* `control-center-width` is the width of the notification centre (default: `500`).

Yeah. The default width was 300 but I just increased it. Won't be included in this release though but you can always use swaync-git :)

tukusejssirs commented 2 years ago

It's the width of the popup notifications

Pop-up notification and notification bubble, for my point of view, it means the same. :man_shrugging:

Yeah. The default width was 300 but I just increased it. Won't be included in this release though but you can always use swaync-git :)

Well, I always set both variables to 800. :wink:

And I use sway*-git, therefore I didn’t it is not actually released yet. :wink: