Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-notification-center
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-shell-notification-center
Commits
69375cc7
Unverified
Commit
69375cc7
authored
Oct 21, 2022
by
Tobias Langendorf
Committed by
GitHub
Oct 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to configure control center layer (#175)
parent
1ef364c3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
1 deletion
+55
-1
swaync.5.scd
man/swaync.5.scd
+6
-0
config.json.in
src/config.json.in
+1
-0
configModel.vala
src/configModel/configModel.vala
+24
-0
configSchema.json
src/configSchema.json
+6
-0
controlCenter.vala
src/controlCenter/controlCenter.vala
+18
-1
No files found.
man/swaync.5.scd
View file @
69375cc7
...
...
@@ -21,6 +21,12 @@ config file to be able to detect config errors
values: top, bottom ++
description: Vertical position of control center and notification window
*layer* ++
type: string ++
default: top ++
values: background, bottom, top, overlay ++
description: Layer of control center window relative to normal windows. background is below all windows, overlay is above all windows.
*control-center-margin-top* ++
type: integer ++
default: 0 ++
...
...
src/config.json.in
View file @
69375cc7
...
...
@@ -2,6 +2,7 @@
"$schema": @JSONPATH@,
"positionX": "right",
"positionY": "top",
"layer": "top",
"control-center-margin-top": 0,
"control-center-margin-bottom": 0,
"control-center-margin-right": 0,
...
...
src/configModel/configModel.vala
View file @
69375cc7
...
...
@@ -42,6 +42,25 @@ namespace SwayNotificationCenter {
}
}
public
enum
Layer
{
BACKGROUND
,
BOTTOM
,
TOP
,
OVERLAY
;
public
string
parse
()
{
switch
(
this
)
{
default
:
return
"top"
;
case
BACKGROUND
:
return
"background"
;
case
BOTTOM
:
return
"bottom"
;
case
TOP
:
return
"top"
;
case
OVERLAY
:
return
"overlay"
;
}
}
}
public
class
Category
:
Object
{
public
string
?
sound
{
get
;
set
;
default
=
null
;
}
public
string
?
icon
{
get
;
set
;
default
=
null
;
}
...
...
@@ -284,6 +303,11 @@ namespace SwayNotificationCenter {
get
;
set
;
default
=
PositionY
.
TOP
;
}
/** Layer of control center */
public
Layer
layer
{
get
;
set
;
default
=
Layer
.
TOP
;
}
/** The timeout for notifications with NORMAL priority */
private
const
int
TIMEOUT_DEFAULT
=
10
;
private
int
_timeout
=
TIMEOUT_DEFAULT
;
...
...
src/configSchema.json
View file @
69375cc7
...
...
@@ -14,6 +14,12 @@
"default"
:
"right"
,
"enum"
:
[
"right"
,
"left"
,
"center"
]
},
"layer"
:
{
"type"
:
"string"
,
"description"
:
"Layer of control center window"
,
"default"
:
"top"
,
"enum"
:
[
"background"
,
"bottom"
,
"top"
,
"overlay"
]
},
"positionY"
:
{
"type"
:
"string"
,
"description"
:
"Vertical position of control center and notification window"
,
...
...
src/controlCenter/controlCenter.vala
View file @
69375cc7
...
...
@@ -212,7 +212,24 @@ namespace SwayNotificationCenter {
#else
GtkLayerShell
.
set_keyboard_interactivity
(
this
,
keyboard_shortcuts
);
#endif
GtkLayerShell
.
set_layer
(
this
,
GtkLayerShell
.
Layer
.
TOP
);
// Set layer
GtkLayerShell
.
Layer
layer
=
GtkLayerShell
.
Layer
.
TOP
;
switch
(
ConfigModel
.
instance
.
layer
)
{
case
Layer
.
BACKGROUND
:
layer
=
GtkLayerShell
.
Layer
.
BACKGROUND
;
break
;
case
Layer
.
BOTTOM
:
layer
=
GtkLayerShell
.
Layer
.
BOTTOM
;
break
;
case
Layer
.
TOP
:
layer
=
GtkLayerShell
.
Layer
.
TOP
;
break
;
case
Layer
.
OVERLAY
:
layer
=
GtkLayerShell
.
Layer
.
OVERLAY
;
break
;
}
GtkLayerShell
.
set_layer
(
this
,
layer
);
// Set the box margins
box
.
set_margin_top
(
ConfigModel
.
instance
.
control_center_margin_top
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment