totdb / pycanberra Goto Github PK
View Code? Open in Web Editor NEWA ctypes wrapper for the libcanberra api
License: GNU Lesser General Public License v2.1
A ctypes wrapper for the libcanberra api
License: GNU Lesser General Public License v2.1
A very basic (and incomplete) wrapper for libcanberra
From IRC:
hey, around? I noticed that changing sound theme setting in GSettings affects canberra-gtk-play as expected, but doesn't affect things that use libcanberra directly, eg. pycanberra: It's still looking for the freedesktop theme according to strace. any idea why?
well, only canberra-gtk binds to gsettings
ah, okay, so I need to manually specify the theme in pycanberra apps?
yeah, i fear
okay, thanks
the idea is basically that for canberra-gtk they data comes from gsettings, but for a (theoretic) canberra-kde it comes from some kde specific source
I suggest that pycanberra will add the code to read the configured sound theme from gsettings and use it. I don't know much about ctypes or how to fix it myself, but here's some of the work:
#put that in your imports area at the top
try:
from gi.repository import Gio
has_gio = True
except ImportError:
has_gio = False
#And this when you actually play the sounds or create the Canberra object (your choice)
if has_gio:
settings = Gio.Settings.new('org.gnome.desktop.sound')
theme = settings.get_string('theme-name')
#Insert magic to actually tell libcanberra to use the theme you found here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.