Comments (13)
- 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.
- 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.
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.
Love the shortening! I would however change it from 'if (/\[(\d+%
to 'if (/.*\[(\d+%
to enable it's use for microphones.
from i3blocks.
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.
@Nycroth, only Playback IMO.
@vivien, dB unit seems fine.
from i3blocks.
Thanks @xelite!
Alright, the second commit I made to the merge pull then is the one to fully merge.
from i3blocks.
@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.
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.
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.
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.
Merged, thanks guys!
from i3blocks.
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.
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)
- Enable utf-8 string in i3blocks
- Persistent command does not actually persist HOT 3
- How do I tell i3blocks to refresh all blocks? HOT 2
- block freezing my status bar HOT 2
- battery regexp breaks with two batteries HOT 1
- `autogen.sh` Generates a `configure` File that Tries to Call Autoconf macro `PKG_CHECK_MODULES` HOT 1
- [Feature Request] Add ticker support
- I'm having trouble getting fixed-width strings to work on i3blocks. HOT 1
- Block's character will turn into "[" character after clicked and turn normal after sway is reloaded. HOT 1
- Can't use the config variable when running the script using i3-msg -q exec myscript HOT 4
- Simple way to display title of focused window in i3blocks HOT 2
- i3blocks does not show anything except datetime HOT 3
- dmenu hang when called from i3blocks with -fn option
- Battery regex in example doesn't handle 100% HOT 2
- Trouble with setting a label with emoji via the json format HOT 1
- Any script with a 'for' loop doesn't produce any output
- How to get back monochrome icons / emojis? Weird font issue!
- Question: is running a secondary command when clicking a button with an interval possible? HOT 1
- Change the color of borders from within a script
- If I launch a graphical program from a block and restart i3, the program dies even if disowned. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3blocks.