shithub: riscv

Download patch

ref: 908a7524eec1bbefc431041dfdf805f585d7f255
parent: af7dd9721926881f08591e777bc2dcdb6bbad04b
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Jun 14 19:22:18 EDT 2023

reform/shortcuts: use "mixfs" for volume control, fall back to "master"

--- a/sys/man/1/reform
+++ b/sys/man/1/reform
@@ -158,7 +158,8 @@
 .I Hyper+F10
 (un)mutes the audio,
 .I Hyper+F11/F12
-decreases/increases "master" volume.  Optionally, a single step amount
+decreases/increases "mix" volume, or "master" if former isn't
+available.  Optionally, a single step amount
 can be set with
 .I -l
 for LCD light level (default is 5) and
--- a/sys/src/cmd/reform/shortcuts.c
+++ b/sys/src/cmd/reform/shortcuts.c
@@ -42,10 +42,6 @@
 				fprint(light, "lcd %+d", -lightstep);
 			else if(r == Kbrtup)
 				fprint(light, "lcd %+d", lightstep);
-			else if(r == Kvoldn)
-				fprint(vol, "master %+d", -volstep);
-			else if(r == Kvolup)
-				fprint(vol, "master %+d", volstep);
 			else if(r == Kmute)
 				fprint(actl, "master toggle");
 			else if(r == Ksbwd)
@@ -54,8 +50,15 @@
 				aplumb("key >");
 			else if(r == Kpause)
 				aplumb("key p");
-			else
+			else if(r == Kvoldn){
+				if(fprint(vol, "mix %+d", -volstep) < 0)
+					fprint(vol, "master %+d", -volstep);
+			}else if(r == Kvolup){
+				if(fprint(vol, "mix %+d", volstep) < 0)
+					fprint(vol, "master %+d", volstep);
+			}else{
 				skip = 0;
+			}
 		}
 
 		if(!skip){