kitty icon indicating copy to clipboard operation
kitty copied to clipboard

Add option to set XDG sound theme on Linux

Open serebit opened this issue 3 years ago • 3 comments
trafficstars

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.

serebit avatar Mar 21 '22 20:03 serebit

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

kovidgoyal avatar Mar 22 '22 02:03 kovidgoyal

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.

serebit avatar Mar 22 '22 14:03 serebit

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

kovidgoyal avatar Mar 22 '22 16:03 kovidgoyal

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.

serebit avatar Mar 18 '23 20:03 serebit