aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2022-04-30 03:12:56 +0000
committerKyle Evans <kevans@FreeBSD.org>2022-06-18 03:50:58 +0000
commit4014365e421991814703249d4748d6dcac6686b6 (patch)
tree39860d028dd177c5a355679b38de6c9d4c61075c /usr.bin
parent11bd40d04af59daa7ae7feea0518081a35f07053 (diff)
downloadsrc-4014365e421991814703249d4748d6dcac6686b6.tar.gz
src-4014365e421991814703249d4748d6dcac6686b6.zip
mixer: remove volume backwards compat, add % interpretation
The current situation is fairly confusing, where an integer is interpreted as a percent until you slap a decimal on it and magically it becomes an absolute value. Let's have a flag day in 14.0 and remove this shim entirely. Setting with percent can still be useful, so allow a trailing '%' to indicate as such. As a side effect, we tighten down the format allowed in the volume a little bit by ensuring there's no trailing garbage after the value once it's separated into left and right components. Reviewed by: christos, hselasky, pauamma_gundo.com (manpages) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D35101
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/fortune/datfiles/freebsd-tips2
-rw-r--r--usr.bin/usbhidaction/usbhidaction.114
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips
index e8fa84e02489..930110a0c3fe 100644
--- a/usr.bin/fortune/datfiles/freebsd-tips
+++ b/usr.bin/fortune/datfiles/freebsd-tips
@@ -339,7 +339,7 @@ If you have sudo(8) installed and permissions to use it, type
``<ESC>w ! sudo tee %'' to force a write.
%
You can adjust the volume of various parts of the sound system in your
-computer by typing 'mixer <type>.volume=<volume>'. To get a list of what
+computer by typing 'mixer <type>.volume=<volume>%'. To get a list of what
you can adjust, just type 'mixer'.
%
You can automatically download and install binary packages by doing
diff --git a/usr.bin/usbhidaction/usbhidaction.1 b/usr.bin/usbhidaction/usbhidaction.1
index f50af8fff1ad..54d114925714 100644
--- a/usr.bin/usbhidaction/usbhidaction.1
+++ b/usr.bin/usbhidaction/usbhidaction.1
@@ -139,11 +139,11 @@ The following configuration file can be used to control a pair
of Philips USB speakers with the HID controls on the speakers.
.Bd -literal -offset indent
# Configuration for various Philips USB speakers
-Consumer:Volume_Increment 1 0 mixer -f $1 vol.volume=+1
-Consumer:Volume_Decrement 1 0 mixer -f $1 vol.volume=-1
+Consumer:Volume_Increment 1 0 mixer -f $1 vol.volume=+1%
+Consumer:Volume_Decrement 1 0 mixer -f $1 vol.volume=-1%
Consumer:Mute 1 0 mixer -f $1 vol.mute=^
-Consumer:Channel_Top.Microsoft:Base_Up 1 0 mixer -f $1 bass.volume=+1
-Consumer:Channel_Top.Microsoft:Base_Down 1 0 mixer -f $1 bass.volume=-1
+Consumer:Channel_Top.Microsoft:Base_Up 1 0 mixer -f $1 bass.volume=+1%
+Consumer:Channel_Top.Microsoft:Base_Down 1 0 mixer -f $1 bass.volume=-1%
.Ed
.Pp
A sample invocation using this configuration would be
@@ -153,9 +153,9 @@ A sample invocation using this configuration would be
The following example controls the mixer volume using a Logitech Wingman.
Notice the debounce of 1 for buttons and 5 for the slider.
.Bd -literal -offset indent
-Button:Button_1 1 1 mixer vol.volume=+10
-Button:Button_2 1 1 mixer vol.volume=-10
-Generic_Desktop:Z * 5 mixer vol.volume=`echo $V | awk '{print int($$1/255*100)}'`
+Button:Button_1 1 1 mixer vol.volume=+10%
+Button:Button_2 1 1 mixer vol.volume=-10%
+Generic_Desktop:Z * 5 mixer vol.volume=`echo $V | awk '{printf("%.02f", $$1/255)}'`
.Ed
.Sh SEE ALSO
.Xr usbhidctl 1 ,