GithubHelp home page GithubHelp logo

pycanberra's Introduction

A very basic (and incomplete) wrapper for libcanberra

pycanberra's People

Contributors

jbicha avatar totdb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pycanberra's Issues

pycanberra ignores system configured sound theme

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.