@@ -73,6 +73,8 @@ namespace SwayNotificationCenter {
73
73
public string ? body { get ; set ; default = null ; }
74
74
public string ? urgency { get ; set ; default = null ; }
75
75
public string ? category { get ; set ; default = null ; }
76
+ public string ? sound_name { get ; set ; default = null ; }
77
+ public string ? sound_file { get ; set ; default = null ; }
76
78
77
79
private const RegexCompileFlags REGEX_COMPILE_OPTIONS =
78
80
RegexCompileFlags . MULTILINE
@@ -128,6 +130,22 @@ namespace SwayNotificationCenter {
128
130
REGEX_MATCH_FLAGS );
129
131
if (! result) return false ;
130
132
}
133
+ if (sound_file != null ) {
134
+ if (param. sound_file == null ) return false ;
135
+ bool result = Regex . match_simple (
136
+ sound_file, param. sound_file,
137
+ REGEX_COMPILE_OPTIONS ,
138
+ REGEX_MATCH_FLAGS );
139
+ if (! result) return false ;
140
+ }
141
+ if (sound_name != null ) {
142
+ if (param. sound_name == null ) return false ;
143
+ bool result = Regex . match_simple (
144
+ sound_name, param. sound_name,
145
+ REGEX_COMPILE_OPTIONS ,
146
+ REGEX_MATCH_FLAGS );
147
+ if (! result) return false ;
148
+ }
131
149
return true ;
132
150
}
133
151
@@ -243,6 +261,8 @@ namespace SwayNotificationCenter {
243
261
spawn_env + = " SWAYNC_BODY=%s " . printf (param. body);
244
262
spawn_env + = " SWAYNC_URGENCY=%s " . printf (param. urgency. to_string ());
245
263
spawn_env + = " SWAYNC_CATEGORY=%s " . printf (param. category);
264
+ spawn_env + = " SWAYNC_SOUND_NAME=%s " . printf (param. sound_name);
265
+ spawn_env + = " SWAYNC_SOUND_FILE=%s " . printf (param. sound_file);
246
266
spawn_env + = " SWAYNC_ID=%s " . printf (param. applied_id. to_string ());
247
267
spawn_env + = " SWAYNC_REPLACES_ID=%s " . printf (param. replaces_id. to_string ());
248
268
spawn_env + = " SWAYNC_TIME=%s " . printf (param. time. to_string ());
0 commit comments