GithubHelp home page GithubHelp logo

olovy / mediactl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaaaaaaalex/mediactl

0.0 0.0 0.0 27 KB

Media controls for Linux, powered by MPRIS via D-Bus

License: GNU General Public License v3.0

Shell 4.55% C 95.45%

mediactl's Introduction

Ultra-barebones, Linux mediaplayer controls for VLC, your web browser, etc.

Designed as a zero-redundancy alternative to the accepted means of binding multimedia keys to i3, but can also be used for general-purpose media control :D

Installation

Download the x86-64 binary, or...

build from src, its easy c:

Requires libdbus-1 headers: sudo apt update && sudo apt install -y libdbus-1-dev

then build... ./build.sh

optionally install with ln or cp or whatever, e.g. cp ./mediactl /usr/bin/mediactl

Usage

mediactl to list all mediaplayers found over D-Bus

mediactl <MPRIS Method Name> to call an mpris method

mediactl simply propagates MPRIS methods from the commandline over the D-Bus to all active mediaplayers, so hypothetically, any zero-argument MPRIS method will work normally.

e.g, to play: mediactl Play

A list of all MPRIS methods can be found here, but keep in mind not everything fully implements it!

Example mediactl usage in i3 config

The original purpose of this program was to enable my keyboard's multimedia keys after installing i3. My i3 config now has the following lines enabling this behaviour:

# bind keyboard media keys to mpris methods
bindsym XF86AudioPlay exec mediactl PlayPause
bindsym XF86AudioNext exec mediactl Next
bindsym XF86AudioPrev exec mediactl Previous
bindsym XF86AudioStop exec mediactl Stop

Disclaimer

This is a WIP and is provided with no guarantees or safety nets, please contribute with PRs and logged issues :)

mediactl's People

Contributors

aaaaaaaalex 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.