Giter Club home page Giter Club logo

ranger-cmus's Introduction

Hello! ๐Ÿ‘‹

Here is a list of my repos:

Repository Description GitHub
Science
bitermplus Biterm topic models (for short texts)
fixation-correction Fixation Correction plugin for Pupil Labs software
mchmm Markov chains and hidden Markov models
scikit-na Missing data analysis
scikit-posthocs Multiple pairwise comparison tests
tmplot Visualization of topic modeling results
Web
youtrack-vscode-extension YouTrack Extension for Visual Studio Code
droneci-vscode-extension Drone CI Extension for Visual Studio Code
tab Start page generator
randpaper Random photo from Pexels
CLI tools
ranger-archives Ranger plugin for creating and extracting archives
ranger-cmus Ranger plugin for integration with *cmus audio player
mufi Simple music finder for command-line
lastfm-cli-scrobbler Last.fm CLI scrobbler
Arduino
spectrumLED Spectrum analyzer on a LED matrix
heart-sensor Heart rate sensor
lastfm-cli-scrobbler Mood lamp based on arduino and WS2812 RGB leds
Linux WMs
i3blocks-blocklets Useful blocklets for *i3blocks*
awesome-wm-widgets Widgets for Awesome WM

ranger-cmus's People

Contributors

maximtrp avatar

Stargazers

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

Watchers

 avatar

ranger-cmus's Issues

Feature: play a file/folder directly

Hi,

This small piece of software is just great. I've spent some time looking around
and, wow, this is exactly it. Thank you so much for sharing.

Now, I said "exactly" but I feel there is a small improvement that could be
added. When I browse my files/folders, I'd like to select one and play it right
away. That is: no adding to a playlist, no adding to a queue: just play it.

As far as I can tell, the cli commands for such a thing would apparently be:

cmus-remote -c -q && cmus-remote -q [file/folder] && cmus-remote -n

This works for me.

Do you think a fourth command could be added to provide this
functionality? There must be a cleaner way (never wrote in python before), but I guess something like this
works for me:

class cmus_justplay(Command):
    def execute(self):
        """ Play selected files or folders """
        file_objs = get_files(self.fm)

        cmus1 = ["cmus-remote", "-c", "-q"]
        self.fm.execute_command(cmus1)
        cmus2 = ["cmus-remote", "-q"]
        cmus2.extend([f.path for f in file_objs])
        self.fm.execute_command(cmus2)
        cmus3 = ["cmus-remote", "-n", "-p"]
        self.fm.execute_command(cmus3)
        self.fm.notify("Cmus queue was cleared and files were sent to it.")
        self.fm.thisdir.mark_all(False)

I provisionally named it cmus_justplay because imho there would be a collision
in names, since probably this new command deserves the name cmus_play, while
the old cmus_play could be called cmus_playlist, or something like that.

What do you think?

EDIT: There are some corners to round up: if there's a song playing, the last command is -n, but if the player is stopped, we need -p. I don't know how to get around this atm.
EDIT 2: Apparently, it's as easy as to use both flags simultaneously: -n -p.

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.