SafeEyes
SafeEyes copied to clipboard
allow changing audio alerts, at least, through the safeeyes json configuration
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I cannot change the audio alerts
Describe the solution you'd like A clear and concise description of what you want to happen.
allow changing the audio alerts in ~/.config/safeeyes/safeeyes.json
this indirectly would solve #445 , because it would allow to override the alert audio file, so people can select a more softer sound, or edit the file with audacity to lower its volume
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
a bad practice: change the audios directly here
/usr/lib/python3/dist-packages/safeeyes/resource/on_pre_break.wav
/usr/lib/python3/dist-packages/safeeyes/resource/on_stop_break.wav
Additional context Add any other context or screenshots about the feature request here.
I still did not change that files, but I have found a configuration very healthy for me, and I feel it is strangely hidden; it might be the default configuration, here goes a frustrated user story with basic audio alerts configuration:
I setup safeeyes and I feel very cared for by the program. Then I participate on several remote meetings, and I don't use headphones because echo cancellation works fine, and suddenly your screen goes black and everybody hears TIIIIIIIIINIIIIIIIIIIIIIIIN, I press skip and go fast to the traybar and put Disable Safe Eyes for some time. Once you experience this weird situation several times you would like to stop using the program
but with the following configuration the user story goes this way:
I setup safeeyes and I feel very cared for by the program. Then I participate several meetings, and I don't use headphones because echo cancellation works fine, and suddenly your screen goes black but it produces no sound, and you can skip the break; or you can even propose a break to your coleagues.
Ok, that way you can disable the plugin, sounds like a good option.
Changing the audio file played would be a bit more complicated. Seems that can be implemented, allowing the user to manually edit the json config, adding a couple of config lines more here:
https://github.com/slgobinath/SafeEyes/blob/7e53d7d68baa54f64c4c4510e512889a6e7baf3b/safeeyes/config/safeeyes.json#L66-L71
And then reading the configuration after these lines:
https://github.com/slgobinath/SafeEyes/blob/7e53d7d68baa54f64c4c4510e512889a6e7baf3b/safeeyes/plugins/audiblealert/plugin.py#L58-L59
So that it can be used in these lines:
https://github.com/slgobinath/SafeEyes/blob/7e53d7d68baa54f64c4c4510e512889a6e7baf3b/safeeyes/plugins/audiblealert/plugin.py#L69
https://github.com/slgobinath/SafeEyes/blob/7e53d7d68baa54f64c4c4510e512889a6e7baf3b/safeeyes/plugins/audiblealert/plugin.py#L79
Additionally, absolute paths management has to be added here:
https://github.com/slgobinath/SafeEyes/blob/d3594bdb8fb147c2e273b023f468d1563a78b39e/safeeyes/utility.py#L78-L84
@ilario Please send a PR!
I can't test right now - but I think it should already work to put a file in $HOME/.config/safeeyes/resource/on_pre_break.wav
, and that should override the file played?