Giter Club home page Giter Club logo

Comments (13)

 avatar commented on July 16, 2024
  • wheel up increase the volume (+10%? or +3dB?)
  • wheel down to decrease the volume (same as above, which unit?)

I would suggest the +/-3dB for volume because that typically gives a better human sound gradient.
Volume Humor

  • Mute on middle click (I find it convenient to keep the left click free, to manually update the volume after being changed by an alternative UI)

I'm curious if the right click might be more appropriate. I agree the left click is inappropriate because that is how a manual refresh is achieved, but I feel that middle click may be a touch counter intuitive.

  • convenient values for CARD, MIXER, SCONTROL? Is there a candidate for BLOCK_INSTANCE?

I'd suggest the defaults be 0, defalut, and Master respectively. I'm not sure what you mean by BLOCK_INSTANCE? however.

For a perl alternative you can use:

perl -ne '/.*\[(\d+%)\].*?\[(on|off)\]/; if ($2 eq "on") {print "$1"; exit} elsif ($2 eq "off") {print "MUTE"; exit}'

In fact, this script better handles microphones and stereo controls. 👍

I also noted the SCONTROL patch wasn't present in the latest version. It'll need to be rewritten to handle the volume adjust patches of course. Want me go ahead and do that?

from i3blocks.

vivien avatar vivien commented on July 16, 2024

OK with +/-XdB then. (Is 3 a confortable value?)
OK with the right click, since the middle click is used to scroll with the trackpoint on Lenovo keyboards.
The BLOCK_INSTANCE env variable is set to what you specify as instance= in the block config, I was just wondering if it could be used for the mixer for instance, but it doesn't seem interesting here.

Thanks for the snippet! I was able to make it even shorter:

format () {
  perl -ne 'if (/\[(\d+%)\].*?\[(on|off)\]/) {CORE::say $2 eq "off" ? "MUTE" : "$1"; exit}'
}

Yes, please go ahead for the patch, I'll give credits to you guys in the commit message before merging.

from i3blocks.

 avatar commented on July 16, 2024

Love the shortening! I would however change it from 'if (/\[(\d+% to 'if (/.*\[(\d+% to enable it's use for microphones.

from i3blocks.

 avatar commented on July 16, 2024

I may have assumed incorrectly. I see my output of amixer get Mic as:
Mono: Playback 0 [0%] [-41.00dB] [on] Capture 0 [0%] [16.00dB] [on]
then I run amixer sset Mic 3dB+ and get:
Mono: Playback 48 [10%] [-38.00dB] [on] Capture 3 [23%] [19.00dB] [on]

Can someone confirm that we want to see and modify Capture or if ALSA is messing with me and we only want Playback?

from i3blocks.

xelite avatar xelite commented on July 16, 2024

@Nycroth, only Playback IMO.
@vivien, dB unit seems fine.

from i3blocks.

 avatar commented on July 16, 2024

Thanks @xelite!
Alright, the second commit I made to the merge pull then is the one to fully merge.

from i3blocks.

vivien avatar vivien commented on July 16, 2024

@Nycroth I adjusted #51 in scripts/volume but there's an issue, the volume change doesn't work for me. Am I the only one?

from i3blocks.

vivien avatar vivien commented on July 16, 2024

If it works for you, it means that my mixer doesn't have dB information, which might be the case for others. In that case, we should maybe use +/-5%.

from i3blocks.

jpleau avatar jpleau commented on July 16, 2024

I can only change the volume when using percentage values, as @vivien just suggested. Using dB does not work for me.

I'm using PulseAudio, if that matters.

from i3blocks.

 avatar commented on July 16, 2024

That may just be a Pulse thing. I'm running pure ALSA and it's working fine for me but I barely notice the difference between the percent and dB. I'm also liking control of 5%.

from i3blocks.

vivien avatar vivien commented on July 16, 2024

Merged, thanks guys!

from i3blocks.

jpleau avatar jpleau commented on July 16, 2024

I am currently testing the scripts in a default install (Debian stable at the moment), and the script gives me this error:

CORE::say is not a keyword at -e line 1.
amixer: invalid option -- 'M'
Invalid switch or option needs an argument.

This is with perl 5.14, could it be that it's just an old version or there's a perl library that's required ? (if it's just the old version then nevermind that, i3blocks package will never be for current debian stable anyway..)

from i3blocks.

 avatar commented on July 16, 2024

The problem is your audio card doesn't use "Master" as it's default main control. Many USB cards do this. I've created a patch to prevent this issue in future and more sensibly allow you to change it. Try out patch pull request #53 and see if that's got it for you.

from i3blocks.

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.