Skip to content

Add option to set XDG sound theme on Linux #4858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2023
Merged

Add option to set XDG sound theme on Linux #4858

merged 1 commit into from
Mar 19, 2023

Conversation

serebit
Copy link
Contributor

@serebit serebit commented Mar 21, 2022

Based on #2125. The default sound theme is __custom, which is the custom theme created by GNOME and Budgie. If this theme doesn't exist, canberra instead uses the default theme to produce the sound, so it should work without a hitch on all desktop environments.

This is a draft because I was unable to figure out how to regenerate to-c-generated.h to get the changes to propagate, and it seems that the code to add a new option changed in the time between #2125 and now. Let me know how to get everything connected and I'll get it ready to merge.

@kovidgoyal
Copy link
Owner

You create it with ./gen-config.py Although is this really needed anymore since we can specify an actual file for the bell sound?

@serebit
Copy link
Contributor Author

serebit commented Mar 22, 2022

I ran gen-config.py before as per the header on the top of the file, and as far as I could tell, it did nothing. Maybe I didn't put my changes in the right place?

You're right that this has more limited utility now that the bell sound can be specified, but this change specifically uses a default value that will result in the correct sound theme being used on GNOME and Budgie, and will fall back to the default freedesktop theme when the custom theme doesn't exist. In practice, this means that the correct sound should play on Budgie and GNOME without additional configuration, while keeping the old behavior on other desktop environments.

@kovidgoyal
Copy link
Owner

You need to add ctype to the definition and add the function to-c.h see for example bell_path

@serebit
Copy link
Contributor Author

serebit commented Mar 18, 2023

Rebased, compiled, and tested, and getting a segfault - seems like OPT(linux_bell_theme_name) is resolving to null, not sure why. I did figure out that gen-config.py likely isn't making changes because there's no need for a ctype, similar to font_family, since it's just a string value.

@kovidgoyal kovidgoyal merged commit 14dcf38 into kovidgoyal:master Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants