Code Monkey home page Code Monkey logo

Comments (4)

francma avatar francma commented on August 24, 2024 1

Implemented in #67

from wob.

bwiercinski avatar bwiercinski commented on August 24, 2024

I would also rethink behaviour for inputs out of range [0;100]. It is not something unimaginable that I want to set my volume to 150%... Ultimate solution would be displaying the bar as if it were set to 100% with the text in the middle 150. Displaying text is also handy for values below 100.

Of course all of these would be set via flags so I'm proposing:

  • accept values above 100 (default allow)
  • ignore invalid input (default true)
  • display text (default true)

Temporary solution

some_command | grep -P '^([0-9]{1,2}|100)$' > /path/to/wob.fifo

from wob.

francma avatar francma commented on August 24, 2024

You can set maximum value via -m flag to allow values above 100. I think there is always some kind of maximum value - sound/brightness doesn't go up to +inf. I have not come across situation where it wasn't possible to feed wob only valid values. Maybe you provide some examples where this might happen.

One thing I want to add is to print input that caused wob to exit. With startup command like this, it should give you some hints about what went wrong.

exec mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob 2> ~/.wob.log

from wob.

NilsIrl avatar NilsIrl commented on August 24, 2024

Temporary solution

some_command | grep -P '^([0-9]{1,2}|100)$' > /path/to/wob.fifo

My solution is this: $(($volume > 100 ? 100 : $volume))

from wob.

Related Issues (20)

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.