SwayNotificationCenter icon indicating copy to clipboard operation
SwayNotificationCenter copied to clipboard

hints: parse sound-name and sound-file

Open earboxer opened this issue 1 year ago • 0 comments

On mobile devices, it can be helpful to play the audio sound indicated by the notification's hint.

This allows for minimal audio-capabilities (without including another library).

Example config:

{
	"scripts": {
		"sound-name": {
			"exec": "sh -c 'mpv --really-quiet /usr/share/sounds/freedesktop/stereo/$SWAYNC_SOUND_NAME.oga'",
			"sound-name": "."
		},
		"sound-file": {
			"exec": "sh -c 'mpv --really-quiet \"$SWAYNC_SOUND_FILE\"'",
			"sound-file": "."
		}
	}
}

run notify-send "Where am I?" -h STRING:sound-name:audio-channel-front-right

or notify-send "Where am I?" -h STRING:sound-file:/usr/share/sounds/freedesktop/stereo/audio-channel-front-left.oga

(Similar to https://github.com/emersion/mako/pull/470)

See also #58

earboxer avatar Sep 08 '24 00:09 earboxer