Code Monkey home page Code Monkey logo

nancho's Introduction

Nancho

Automatically pause MPRIS music players (e.g. spotify) when another application (e.g. your browser) starts playing sound.

Compilation dependencies

Ubuntu

sudo apt install libdbus-1-dev libpulse-dev meson

Arch linux

sudo pacman -S dbus pulseaudio meson

Compile and install

mkdir build
meson setup build
meson install

Then as normal user

systemctl --user enable nancho

Running from commandline

Automatically pause music player when a trigger starts playing sound
Usage:
  Nancho [OPTION...]

  -c, --cooldown arg  Time in minutes after which the music will no longer resume. 0 disables cooldown (default: 0)
  -d, --delay arg     Time in seconds to wait before pausing music (default: 0)
      --trigger arg   Names of the binaries that trigger a switch (default: firefox)
  -p, --player arg    Name of the binary that is controlled by the switch.(default: spotify)
      --debug         Enable debugging
  -h, --help          Print this help message

Acknowledgements

Uses code adapted from:

dbus-print-message by Philip Blundell (GPL)
pulsetest by Jason White (Public Domain)
dbus-sample by MakerCrew on GitHub (MIT license)

nancho's People

Contributors

dmry avatar

Watchers

 avatar  avatar

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.