hastinbe / i3-volume Goto Github PK
View Code? Open in Web Editor NEWVolume control and volume notifications
License: GNU General Public License v2.0
Volume control and volume notifications
License: GNU General Public License v2.0
shortcut to change volume via sxhkd:
super + {F10, F11} i3-volume {down, up} 5 -np -N dunstify
super + F12 i3-volume mute -np -N dunstify
what is looks like now:
using the -y option won't fix it, instead making the whole thing greenish like this:
without the -p option it still persists.
What could be the cause of that blue progress bar appearing suddenly?
on arch with i3wm, was normal until i tried to change volume while playing a video via mpv, it was normal before.
See phuhl/notify-send.py#19. When I run your script like this:
USE_NOTIFY_SEND_PY=true ./volume -n -t i3status -u SIGUSR1 up 5
This causes the following error:
File "/home/reindert/.local/lib/python3.7/site-packages/notify_send_py/notify_send_py.py", line 126, in notify
conn = Client(pidf.read())
File "/usr/lib/python3.7/multiprocessing/connection.py", line 487, in Client
family = family or address_type(address)
File "/usr/lib/python3.7/multiprocessing/connection.py", line 108, in address_type
raise ValueError('address type of %r unrecognized' % address)
ValueError: address type of b'' unrecognized
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/reindert/.local/bin/notify-send.py", line 8, in <module>
sys.exit(main())
File "/home/reindert/.local/lib/python3.7/site-packages/notify_send_py/notify_send_py.py", line 218, in main
NotifySendPyCLI()
File "/home/reindert/.local/lib/python3.7/site-packages/notify_send_py/notify_send_py.py", line 211, in __init__
dontQuitOnAction=args.dontQuitOnAction
File "/home/reindert/.local/lib/python3.7/site-packages/notify_send_py/notify_send_py.py", line 132, in notify
pidf.write(listener.address)
TypeError: a bytes-like object is required, not 'str'
Using python 3.7.3 on Debian buster.
Unfortunatlely there is no way to open pull requests for wiki pages, or I would have done that.
The documentation for using i3-volume with i3blocks is this
[i3volume]
label=
command=~/i3-volume/volume -o i3blocks
interval=once
signal=10
color=#b8bb26
separator_block_width=10
markup=pango
The -o
flag doesn't work, so the example should be updated to
[i3volume]
label=
command=~/i3-volume/volume output i3blocks
interval=once
signal=10
color=#b8bb26
separator_block_width=10
markup=pango
😃
Running the current git version of i3-volume on Ubuntu 17.10 x86_64 with i3 window manager
i3-volume changes the volume properly, but if run with the -n switch, the notification does not appear and errors show up:
$ notify-send --version
notify-send 0.7.7
$ ./volume -i 5 -n
./volume: line 117: [: : integer expression expected
./volume: line 119: [: : integer expression expected
./volume: line 121: [: : integer expression expected
./volume: line 123: [: : integer expression expected
Value "" of hint "value" could not be parsed as type "int".
Hello, thanks for sharing the project it helped me understand some nuances of sounds in linux.
I was wondering if you ever thought about putting a small enhancement which would apply the changes to all sinks that are currently in RUNNING state. (notation is specific to pactl
.
basically the script could extract a list of sinks running using something like:
for s in $(pactl list short sinks | grep RUNNING | cut -f2); do volume -n -s $s down 10; done
and a loop could be applied to all the sinks which comes out of the command.
Just an idea, you might have already thought about it...
Cheers,
Rodrigo
if you run .scripts/volume up 1.5 -x 105.5
, you get ./volume: line 1025: 105.5: syntax error: invalid arithmetic operator (error token is ".5")
. It would be nice if one could use decimal values.
I'm leaving this product.
I had some trouble manually placing the scripts so I decided to use yay. I noticed my /etc/i3/config was completely reset to default...
Why is that necessary? I have to rewrite my config again, as I didnt do a backup because I didnt expect anything to overwrite it.
If you set your vol to 0 and then execute ./volume up 3 -x 100
, you can only get to 99% because 100 is not a multiple of 3.
If you have the volume set to 98%, i3-volume won't increase the volume to the max volume set with -x 100
.
However, if you set the volume to -0.17dBa (see also: #25) and ./volume up 1 -x 100
, it'll set the volume to 0.09dBa, which is slightly more than 100%.
Please consider changing the behaviour of the script so it a) adheres to the max volume if you have "crude" dBa volumes set, and b) increases the volume to the max volume even if it's not a multiple of the increase.
On my computer this code dosn't work
get_volume_pulseaudio() {
local sink="$1"
pacmd list-sinks |
awk -W posix -v 'RS=\r?\n' \
'/^[ \t]+name: /{insink = $2 == "<'$sink'>"}
/^[ \t]+volume: / && insink {gsub("%", ""); print $5; exit}'
}
But, this code work very well
get_volume_pulseaudio() {
local sink="$1"
pacmd list-sinks |
gawk '/^[ \t]+name: /{insink = $2 == "<'$sink'>"}/^[ \t]+volume: / && \
insink {gsub("%", ""); print $5; exit}'
}
I on ArchLinux with i3, i use PulseAudio and libnotify.
I have a similar problem to #11 , but I'm using an icon font that calls the symbolic files "audio-volume-high-symbolic.svg" (so a middle case between legacy and the redundant "*-symbolic.symbolic" thing.
I'd suggest a numeric -l option, so that it would be
0: "audio-volume-high-symbolic.symbolic"
1: "audio-volume-high"
2: "audio-volume-high-symbolic"
(probably defaulting to 0 if not given and 1 if given without a number)
Currently i3-volume
became incompatible with distributions that switched from Pulseaudio to Pipewire as pacmd
is removed during the migration. Not sure what options are there to bring it back.
I can't help but feel like I'm doing something wrong here. No matter what I do, the help/usage always pops up and it seems like the volume doesn't change at all.
I've tried the default settings, which don't work. This is expected because of my setup.
➜ ~ i3-volume/volume -an -t i3status -u SIGUSR1 up 5
amixer: Unable to find simple control 'Master',0
So then I update the command to use the Headphone mixer, which I assume it finds because the above error goes away:
➜ ~ i3-volume/volume -an -m Headphone -t i3status -u SIGUSR1 up 5
Usage: i3-volume/volume [<options>] <command> [<args>]
Control volume and related notifications.
Commands:
up <value> increase volume
down <value> decrease volume
set <value> set volume
mute toggle mute
listen listen for changes to a PulseAudio sink
output <format> output volume in a supported format
custom format substitutions:
%v = volume
example: "My current volume is %v"
outputs show available output formats
notifications show available notification methods
help display help
Options:
-a use amixer
-n enable notifications
-t <process_name> process name of status bar (requires -u)
-u <signal> signal to update status bar (requires -t)
-x <value> maximum volume
-X <value> maximum amplification; if supported (default: 2)
-h display help
amixer Options:
-c <card> card number to control
-m <mixer> set mixer (default: Master)
PulseAudio Options:
-s <sink> symbolic name of sink
Notification Options:
-N <method> notification method (default: libnotify)
-p enable progress bar
-e <expires> expiration time of notifications in ms
-l use fullcolor instead of symbolic icons
-S <suffix> append suffix to symbolic icon names
-y use dunstify (default: notify-send)
I've tried many different combinations of things and no matter what I do, I still get the usage script. Is it me?
Simplifying it down to i3-volume/volume -an -m Headphone up 5
doesn't help, either.
Hi, I have a small problem with the notification icon. It is not showing and I can see warning messages such as the following if run from the terminal.
WARNING: No icon found in path: 'audio-volume-high'
What I tried:
I have double checked the dunst config:
$ grep icon_path ~/.config/dunst/dunstrc
icon_path = /usr/share/icons/Adwaita/16x16/status/:/usr/share/icons/Adwaita/16x16/devices/
And I do have these stuff on my system:
$ ls /usr/share/icons/Adwaita/16x16/status/audio*
/usr/share/icons/Adwaita/16x16/status/audio-volume-high-symbolic.symbolic.png
/usr/share/icons/Adwaita/16x16/status/audio-volume-low-symbolic.symbolic.png
/usr/share/icons/Adwaita/16x16/status/audio-volume-medium-symbolic.symbolic.png
/usr/share/icons/Adwaita/16x16/status/audio-volume-muted-symbolic.symbolic.png
/usr/share/icons/Adwaita/16x16/status/audio-volume-overamplified-symbolic.symbolic.png
Not sure what else I might be missing and I'm not familiar with how dunst pulls icons, so I am not sure if it's even hitting those files or am I missing packages.
Thanks for your time.
Obviously it depends on where the i3-volume directory is put. Worked for me when I changed $volumepath
from ~/i3-volume
to ~/i3-volume/volume
with the cloned directory in my home. That seems like a better sample path to me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.