ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.16k stars 59 forks source link

[Feature] passing notification subject and body to scripts #323

Closed ghost closed 7 months ago

ghost commented 9 months ago

Hi,

looking for a way for passing information of a remote ssh session via OSC to emacs. The idea is: from inside a ssh session I want to send a OSC notifiy with hostname and directory to swaync and execute a script which opens a tramp session in emacs for editing files.

But I realized that there is no way to bring the subject of the message to the script. At least it is not documented. exec: /path/to/script.sh {subject} {body} would be very nice Or did I miss something?

thanks

teto commented 7 months ago

Interested in this as well. I am trying to funnel more messages to swaync, for instance neovim errors but then I can't copy/paste the error anymore. I would like to make a script that when I click a notification copies its content into clipboard

ErikReider commented 7 months ago

Sorry for the late response. A lot of assignments and finals these past few weeks. 😅

Check the environment variables, SWAYNC_BODY should contain the body if I remember correctly :)

teto commented 4 months ago

for future people arriving on this issue, the following works for me on on.10

  "scripts": {
    "example-action-script": {
      "exec": "bash -c 'wl-copy \"$SWAYNC_BODY\"'",
      "run-on": "action"
    }
  },