diff --git a/README.md b/README.md index 1b6f132..f9b34d7 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ to your `.config/swaync/` folder to customize without needing root access. To reload the config, you'll need to run `swaync-client --reload-config` -- `positionX`: `left` or `right` +- `positionX`: `left`, `right` or `center` - `positionY`: `top` or `bottom` - `timeout`: uint (Any positive number). The notification timeout for notifications with normal priority - `timeout-low`: uint (any positive number). The notification timeout for notifications with low priority diff --git a/src/configModel/configModel.vala b/src/configModel/configModel.vala index 0228582..335538c 100644 --- a/src/configModel/configModel.vala +++ b/src/configModel/configModel.vala @@ -1,6 +1,6 @@ namespace SwayNotificatonCenter { public enum PositionX { - RIGHT, LEFT; + RIGHT, LEFT, CENTER; public string parse () { EnumClass enumc = (EnumClass) typeof (PositionX).class_ref (); diff --git a/src/controlCenter/controlCenter.vala b/src/controlCenter/controlCenter.vala index 6edfaa9..9747106 100644 --- a/src/controlCenter/controlCenter.vala +++ b/src/controlCenter/controlCenter.vala @@ -227,6 +227,14 @@ namespace SwayNotificatonCenter { GtkLayerShell.Edge.LEFT, true); break; + case PositionX.CENTER: + GtkLayerShell.set_anchor (this, + GtkLayerShell.Edge.RIGHT, + false); + GtkLayerShell.set_anchor (this, + GtkLayerShell.Edge.LEFT, + false); + break; default: GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, diff --git a/src/notiWindow/notiWindow.vala b/src/notiWindow/notiWindow.vala index 7c1d0ba..bd11b2b 100644 --- a/src/notiWindow/notiWindow.vala +++ b/src/notiWindow/notiWindow.vala @@ -37,6 +37,12 @@ namespace SwayNotificatonCenter { GtkLayerShell.set_anchor ( this, GtkLayerShell.Edge.LEFT, true); break; + case PositionX.CENTER: + GtkLayerShell.set_anchor ( + this, GtkLayerShell.Edge.RIGHT, false); + GtkLayerShell.set_anchor ( + this, GtkLayerShell.Edge.LEFT, false); + break; default: GtkLayerShell.set_anchor ( this, GtkLayerShell.Edge.LEFT, false);