ErikReider / SwayNotificationCenter

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

Action scripts #194

Closed auctumnus closed 1 year ago

auctumnus commented 1 year ago

Closes #192.

This solution is likely not the most maintainable. run_action_scripts duplicates most of the content from new_notification, and requires you to repeat a lot of the NotifyParams content. Unfortunately, I'm not familiar enough with Vala to know how to fix this. (That is - this is my first time programming in Vala, so please check over all of my work.)

auctumnus commented 1 year ago

I tried getting it to be an enum, but I can't figure out how to get it to serialize the enum value from the config? Otherwise, the other issues are fixed. It should be a pretty simple change to have it not be a string - I have the enum there in the config model and such.

ErikReider commented 1 year ago

I tried getting it to be an enum, but I can't figure out how to get it to serialize the enum value from the config? Otherwise, the other issues are fixed. It should be a pretty simple change to have it not be a string - I have the enum there in the config model and such.

Removing the question mark from public ScriptRunOnType ? run_on { get; set; default = ScriptRunOnType.RECEIVE; }should do the trick

auctumnus commented 1 year ago

Both of those should now be fixed. Thanks for the tip about removing the question mark!

auctumnus commented 1 year ago

Should be fixed; thanks for spotting these, I hadn't tried building without scripting so I wouldn't have seen these.

auctumnus commented 1 year ago

No problem! Thank you for helping me through this PR :+1: