diff --git a/README.md b/README.md index 40bcc5e..45f42d0 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ To reload the config, you'll need to run `swaync-client --reload-config` - `image-visibility`: `always`, `when-available` or `never`. Notification image visiblilty - `transition-time`: uint (Any positive number, 0 to disable). The notification animation duration - `notification-window-width`: uint (Any positive number). Width of the notification in pixels +- `hide-on-clear`: bool. Hides the control center after pressing "Clear All" The main CSS style file is located in `/etc/xdg/swaync/style.css`. Copy it over to your `.config/swaync/` folder to customize without needing root access. diff --git a/src/config.json b/src/config.json index 4018ea0..06f7d02 100644 --- a/src/config.json +++ b/src/config.json @@ -7,5 +7,6 @@ "notification-window-width": 500, "keyboard-shortcuts": true, "image-visibility": "always", - "transition-time": 200 + "transition-time": 200, + "hide-on-clear": false } diff --git a/src/configModel/configModel.vala b/src/configModel/configModel.vala index 8edafbd..49b91e1 100644 --- a/src/configModel/configModel.vala +++ b/src/configModel/configModel.vala @@ -149,6 +149,11 @@ namespace SwayNotificatonCenter { */ public int notification_window_width { get; set; default = 500; } + /* + * Hides the control center after clearing all notifications + */ + public bool hide_on_clear { get; set; default = false; } + /* Methods */ /** diff --git a/src/controlCenter/controlCenter.vala b/src/controlCenter/controlCenter.vala index 4de1216..32956ab 100644 --- a/src/controlCenter/controlCenter.vala +++ b/src/controlCenter/controlCenter.vala @@ -218,6 +218,10 @@ namespace SwayNotificatonCenter { } catch (Error e) { stderr.printf (e.message + "\n"); } + + if (ConfigModel.instance.hide_on_clear) { + this.set_visibility (false); + } } private void navigate_list (uint i) {