Skip to content

Commit 7e38ea1

Browse files
Pass hints as environment to scripts
1 parent 653058b commit 7e38ea1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

man/swaync.5.scd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,5 +713,6 @@ SWAYNC_CATEGORY="SwayNC notification category"
713713
SWAYNC_REPLACES_ID="ID of notification to replace"
714714
SWAYNC_ID="SwayNC notification ID"
715715
SWAYNC_SUMMARY="Notification summary"
716+
SWAYNC_HINT_[NAME]="Value of the hint [NAME]"
716717
```
717718
#END scripting

src/configModel/configModel.vala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ namespace SwayNotificationCenter {
247247
spawn_env += "SWAYNC_REPLACES_ID=%s".printf (param.replaces_id.to_string ());
248248
spawn_env += "SWAYNC_TIME=%s".printf (param.time.to_string ());
249249
spawn_env += "SWAYNC_DESKTOP_ENTRY=%s".printf (param.desktop_entry ?? "");
250+
foreach (string hint in param.hints.get_keys()) spawn_env += "SWAYNC_HINT_%s=%s".printf(hint.up ().replace ("-", "_"), param.hints[hint].print (false));
250251

251252
return yield Functions.execute_command (exec, spawn_env, out msg);
252253
}

0 commit comments

Comments
 (0)