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
d295a76e
Unverified
Commit
d295a76e
authored
May 14, 2022
by
Erik Reider
Committed by
GitHub
May 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GetSubscribeData to dbus daemon (#123)
* Added GetSubscribeData to dbus daemon * Updated client to use GetSubscribeData
parent
f4ba9214
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
client.vala
src/client.vala
+13
-6
swayncDaemon.vala
src/swayncDaemon/swayncDaemon.vala
+16
-0
No files found.
src/client.vala
View file @
d295a76e
public
struct
SwayncDaemonData
{
public
bool
dnd
;
public
bool
cc_open
;
public
uint
count
;
}
[DBus (name = "org.erikreider.swaync.cc")]
[DBus (name = "org.erikreider.swaync.cc")]
interface
CcDaemon
:
GLib
.
Object
{
interface
CcDaemon
:
GLib
.
Object
{
...
@@ -21,6 +27,9 @@ interface CcDaemon : GLib.Object {
...
@@ -21,6 +27,9 @@ interface CcDaemon : GLib.Object {
public
abstract
void
set_visibility
(
bool
value
)
throws
DBusError
,
IOError
;
public
abstract
void
set_visibility
(
bool
value
)
throws
DBusError
,
IOError
;
[
DBus
(
name
=
"GetSubscribeData"
)]
public
abstract
SwayncDaemonData
get_subscribe_data
()
throws
Error
;
public
signal
void
subscribe
(
uint
count
,
bool
dnd
,
bool
cc_open
);
public
signal
void
subscribe
(
uint
count
,
bool
dnd
,
bool
cc_open
);
}
}
...
@@ -58,9 +67,8 @@ private void on_subscribe (uint count, bool dnd, bool cc_open) {
...
@@ -58,9 +67,8 @@ private void on_subscribe (uint count, bool dnd, bool cc_open) {
private
void
print_subscribe
()
{
private
void
print_subscribe
()
{
try
{
try
{
on_subscribe
(
cc_daemon
.
notification_count
(),
SwayncDaemonData
data
=
cc_daemon
.
get_subscribe_data
();
cc_daemon
.
get_dnd
(),
on_subscribe
(
data
.
count
,
data
.
dnd
,
data
.
cc_open
);
cc_daemon
.
get_visibility
());
}
catch
(
Error
e
)
{
}
catch
(
Error
e
)
{
on_subscribe
(
0
,
false
,
false
);
on_subscribe
(
0
,
false
,
false
);
}
}
...
@@ -86,9 +94,8 @@ private void on_subscribe_waybar (uint count, bool dnd, bool cc_open) {
...
@@ -86,9 +94,8 @@ private void on_subscribe_waybar (uint count, bool dnd, bool cc_open) {
private
void
print_subscribe_waybar
()
{
private
void
print_subscribe_waybar
()
{
try
{
try
{
on_subscribe_waybar
(
cc_daemon
.
notification_count
(),
SwayncDaemonData
data
=
cc_daemon
.
get_subscribe_data
();
cc_daemon
.
get_dnd
(),
on_subscribe_waybar
(
data
.
count
,
data
.
dnd
,
data
.
cc_open
);
cc_daemon
.
get_visibility
());
}
catch
(
Error
e
)
{
}
catch
(
Error
e
)
{
on_subscribe_waybar
(
0
,
false
,
false
);
on_subscribe_waybar
(
0
,
false
,
false
);
}
}
...
...
src/swayncDaemon/swayncDaemon.vala
View file @
d295a76e
namespace
SwayNotificationCenter
{
namespace
SwayNotificationCenter
{
public
struct
Data
{
public
bool
dnd
;
public
bool
cc_open
;
public
uint
count
;
}
[
DBus
(
name
=
"org.erikreider.swaync.cc"
)]
[
DBus
(
name
=
"org.erikreider.swaync.cc"
)]
public
class
SwayncDaemon
:
Object
{
public
class
SwayncDaemon
:
Object
{
public
StateCache
cache_state
;
public
StateCache
cache_state
;
...
@@ -57,6 +63,16 @@ namespace SwayNotificationCenter {
...
@@ -57,6 +63,16 @@ namespace SwayNotificationCenter {
}
}
}
}
/** Gets subscribe data but in one call */
[
DBus
(
name
=
"GetSubscribeData"
)]
public
Data
get_subscribe_data
()
throws
Error
{
return
Data
()
{
dnd
=
get_dnd
(),
cc_open
=
get_visibility
(),
count
=
notification_count
(),
};
}
/**
/**
* Called when Dot Not Disturb state changes and when
* Called when Dot Not Disturb state changes and when
* notification gets added/removed
* notification gets added/removed
...
...
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