Skip to content

Commit

Permalink
Pass hints as environment to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDuperDeou committed Jun 15, 2024
1 parent 653058b commit 8d09c98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions man/swaync.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -713,5 +713,6 @@ SWAYNC_CATEGORY="SwayNC notification category"
SWAYNC_REPLACES_ID="ID of notification to replace"
SWAYNC_ID="SwayNC notification ID"
SWAYNC_SUMMARY="Notification summary"
SWAYNC_HINT_[NAME]="Value of the hint [NAME]"
```
#END scripting
1 change: 1 addition & 0 deletions src/configModel/configModel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ namespace SwayNotificationCenter {
spawn_env += "SWAYNC_REPLACES_ID=%s".printf (param.replaces_id.to_string ());
spawn_env += "SWAYNC_TIME=%s".printf (param.time.to_string ());
spawn_env += "SWAYNC_DESKTOP_ENTRY=%s".printf (param.desktop_entry ?? "");
foreach (string hint in param.hints.get_keys()) spawn_env += "SWAYNC_HINT_%s=%s".printf(hint.up (), param.hints[hint].print (false));

return yield Functions.execute_command (exec, spawn_env, out msg);
}
Expand Down

0 comments on commit 8d09c98

Please sign in to comment.