diff --git a/man/swaync.5.scd b/man/swaync.5.scd index effcbc6..bdccc3c 100644 --- a/man/swaync.5.scd +++ b/man/swaync.5.scd @@ -126,6 +126,11 @@ config file to be able to detect config errors default: true ++ description: Hides the control center when clicking on notification action +*text-empty* ++ + type: string ++ + default: "No Notifications" ++ + description: Text that appears when there are no notifications to show + *fit-to-screen* ++ type: bool ++ default: true ++ diff --git a/src/config.json.in b/src/config.json.in index 9c51fb4..609ebfd 100644 --- a/src/config.json.in +++ b/src/config.json.in @@ -28,6 +28,7 @@ "transition-time": 200, "hide-on-clear": false, "hide-on-action": true, + "text-empty": "No Notifications", "script-fail-notify": true, "scripts": { "example-script": { diff --git a/src/configModel/configModel.vala b/src/configModel/configModel.vala index 56f6547..f443ecb 100644 --- a/src/configModel/configModel.vala +++ b/src/configModel/configModel.vala @@ -412,6 +412,9 @@ namespace SwayNotificationCenter { /** Hides the control center when clicking on notification action */ public bool hide_on_action { get; set; default = true; } + /** Text that appears when there are no notifications to show */ + public string text_empty { get; set; default = "No Notifications"; } + /** The controlcenters horizontal alignment. Supersedes `positionX` if not `NONE` */ public PositionX control_center_positionX { // vala-lint=naming-convention get; set; default = PositionX.NONE; diff --git a/src/configSchema.json b/src/configSchema.json index 6421007..1a7f05c 100644 --- a/src/configSchema.json +++ b/src/configSchema.json @@ -176,6 +176,11 @@ "description": "Hides the control center when clicking on notification action", "default": true }, + "text-empty": { + "type": "string", + "description": "Text that appears when there are no notifications to show", + "default": "No Notifications" + }, "script-fail-notify": { "type": "boolean", "description": "Sends a notification if a script fails to run", diff --git a/src/controlCenter/controlCenter.ui b/src/controlCenter/controlCenter.ui index 07d230a..52bfa03 100644 --- a/src/controlCenter/controlCenter.ui +++ b/src/controlCenter/controlCenter.ui @@ -68,7 +68,7 @@ - + True False No Notifications diff --git a/src/controlCenter/controlCenter.vala b/src/controlCenter/controlCenter.vala index b768989..05a7ef3 100644 --- a/src/controlCenter/controlCenter.vala +++ b/src/controlCenter/controlCenter.vala @@ -4,6 +4,8 @@ namespace SwayNotificationCenter { [GtkChild] unowned Gtk.Box notifications_box; [GtkChild] + unowned Gtk.Label text_empty_label; + [GtkChild] unowned Gtk.Stack stack; [GtkChild] unowned Gtk.ScrolledWindow scrolled_window; @@ -61,11 +63,13 @@ namespace SwayNotificationCenter { list_box.get_style_context ().add_class ("control-center-list"); viewport.add (list_box); + text_empty_label.set_text (ConfigModel.instance.text_empty); + if (swaync_daemon.use_layer_shell) { if (!GtkLayerShell.is_supported ()) { stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n"); stderr.printf ("Swaync only works on Wayland!\n"); - stderr.printf ("If running waylans session, try running:\n"); + stderr.printf ("If running wayland session, try running:\n"); stderr.printf ("\tGDK_BACKEND=wayland swaync\n"); Process.exit (1); }