change sv script and executor to use a temporary file

This commit is contained in:
Tyler Starr 2024-11-10 19:32:05 -08:00
parent 7ddac3af49
commit ab8f5de80a
2 changed files with 6 additions and 2 deletions

View File

@ -16,7 +16,7 @@
"center-active" = false;
"left-active" = false;
"right-active" = true;
"right-commands-json" = ''{"commands":[{"isActive":true,"command":"pySVS 54:B7:E5:57:1A:7B --volume=A | grep -oP \"(?<=VOLUME': )-?\\d+\" | xargs -I{} echo \"󰓃 {}dB\"","interval":20,"uuid":"732cd6de-ff5f-46a7-b8bb-51d1c621cc60"}]}'';
"right-commands-json" = ''{"commands":[{"isActive":true,"command":"echo \"󰓃 $(cat /tmp/svs)dB\"","interval":10,"uuid":"732cd6de-ff5f-46a7-b8bb-51d1c621cc60"}]}'';
};
};
};

View File

@ -9,7 +9,11 @@ in {
pySVS # control SVS subwoofers from the command-line
(pkgs.writeScriptBin "sv" ''
#!/bin/sh
pySVS 54:B7:E5:57:1A:7B --volume="$1"
pySVS 54:B7:E5:57:1A:7B --volume="$1" && echo "$1" > /tmp/svs
'')
(pkgs.writeScriptBin "svv" ''
#!/bin/sh
pySVS 54:B7:E5:57:1A:7B --volume=A | grep -oP "(?<=VOLUME': )-?\\d+" > /tmp/svs
'')
opensc # Open source smart card tools and middleware
pcsc-tools # Tools are used to test a PC/SC drivers