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
ebd726e3
Unverified
Commit
ebd726e3
authored
Oct 09, 2022
by
lazytanuki
Committed by
GitHub
Oct 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: transient notification visibility (#170)
parent
81fb57ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
+14
-7
swaync.5.scd
man/swaync.5.scd
+1
-1
configModel.vala
src/configModel/configModel.vala
+6
-1
configSchema.json
src/configSchema.json
+1
-1
notiDaemon.vala
src/notiDaemon/notiDaemon.vala
+6
-4
No files found.
man/swaync.5.scd
View file @
ebd726e3
...
...
@@ -110,7 +110,7 @@ config file to be able to detect config errors
type: string ++
optional: false ++
default: enabled ++
values: ignored, muted, enabled ++
values: ignored, muted,
transient,
enabled ++
description: The notification visibility state. ++
*app-name*++
type: string ++
...
...
src/configModel/configModel.vala
View file @
ebd726e3
...
...
@@ -137,7 +137,8 @@ namespace SwayNotificationCenter {
public
enum
NotificationStatusEnum
{
ENABLED
,
MUTED
,
IGNORED
;
IGNORED
,
TRANSIENT
;
public
string
to_string
()
{
switch
(
this
)
{
...
...
@@ -147,6 +148,8 @@ namespace SwayNotificationCenter {
return
"muted"
;
case
IGNORED
:
return
"ignored"
;
case
TRANSIENT
:
return
"transient"
;
}
}
...
...
@@ -158,6 +161,8 @@ namespace SwayNotificationCenter {
return
MUTED
;
case
"ignored"
:
return
IGNORED
;
case
"transient"
:
return
TRANSIENT
;
}
}
}
...
...
src/configSchema.json
View file @
ebd726e3
...
...
@@ -186,7 +186,7 @@
"type"
:
"string"
,
"description"
:
"The notification visibility state."
,
"default"
:
"enabled"
,
"enum"
:
[
"ignored"
,
"muted"
,
"enabled"
]
"enum"
:
[
"ignored"
,
"muted"
,
"enabled"
,
"transient"
]
},
"app-name"
:
{
"type"
:
"string"
,
...
...
src/notiDaemon/notiDaemon.vala
View file @
ebd726e3
...
...
@@ -172,16 +172,18 @@ namespace SwayNotificationCenter {
synchronous_ids
.
set
(
param
.
synchronous
,
id
);
}
// Only show popup notification if it is ENABLED
if
(
state
==
NotificationStatusEnum
.
ENABLED
// Only show popup notification if it is ENABLED
or TRANSIENT
if
(
(
state
==
NotificationStatusEnum
.
ENABLED
||
state
==
NotificationStatusEnum
.
TRANSIENT
)
&&
!
control_center
.
get_visibility
())
{
if
(
param
.
urgency
==
UrgencyLevels
.
CRITICAL
||
(!
dnd
&&
param
.
urgency
!=
UrgencyLevels
.
CRITICAL
))
{
NotificationWindow
.
instance
.
add_notification
(
param
,
this
);
}
}
// Only add notification to CC if it isn't IGNORED and not transient
if
(
state
!=
NotificationStatusEnum
.
IGNORED
&&
!
param
.
transient
)
{
// Only add notification to CC if it isn't IGNORED and not transient/TRANSIENT
if
(
state
!=
NotificationStatusEnum
.
IGNORED
&&
state
!=
NotificationStatusEnum
.
TRANSIENT
&&
!
param
.
transient
)
{
control_center
.
add_notification
(
param
,
this
);
}
...
...
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