@@ -87,6 +87,8 @@ namespace SwayNotificationCenter {
8787 public string ? body { get ; set ; default = null ; }
8888 public string ? urgency { get ; set ; default = null ; }
8989 public string ? category { get ; set ; default = null ; }
90+ public string ? sound_name { get ; set ; default = null ; }
91+ public string ? sound_file { get ; set ; default = null ; }
9092
9193 private const RegexCompileFlags REGEX_COMPILE_OPTIONS =
9294 RegexCompileFlags . MULTILINE ;
@@ -141,6 +143,22 @@ namespace SwayNotificationCenter {
141143 REGEX_MATCH_FLAGS );
142144 if (! result) return false ;
143145 }
146+ if (sound_file != null ) {
147+ if (param. sound_file == null ) return false ;
148+ bool result = Regex . match_simple (
149+ sound_file, param. sound_file,
150+ REGEX_COMPILE_OPTIONS ,
151+ REGEX_MATCH_FLAGS );
152+ if (! result) return false ;
153+ }
154+ if (sound_name != null ) {
155+ if (param. sound_name == null ) return false ;
156+ bool result = Regex . match_simple (
157+ sound_name, param. sound_name,
158+ REGEX_COMPILE_OPTIONS ,
159+ REGEX_MATCH_FLAGS );
160+ if (! result) return false ;
161+ }
144162 return true ;
145163 }
146164
@@ -256,6 +274,8 @@ namespace SwayNotificationCenter {
256274 spawn_env + = " SWAYNC_BODY=%s " . printf (param. body);
257275 spawn_env + = " SWAYNC_URGENCY=%s " . printf (param. urgency. to_string ());
258276 spawn_env + = " SWAYNC_CATEGORY=%s " . printf (param. category);
277+ spawn_env + = " SWAYNC_SOUND_NAME=%s " . printf (param. sound_name);
278+ spawn_env + = " SWAYNC_SOUND_FILE=%s " . printf (param. sound_file);
259279 spawn_env + = " SWAYNC_ID=%s " . printf (param. applied_id. to_string ());
260280 spawn_env + = " SWAYNC_REPLACES_ID=%s " . printf (param. replaces_id. to_string ());
261281 spawn_env + = " SWAYNC_TIME=%s " . printf (param. time. to_string ());
0 commit comments