From d47c77237e3b1156fdd132147fbef25088d447d8 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Thu, 24 Oct 2024 12:36:28 +1000 Subject: Add options[] to aataaj.lua. --- aataaj.lua | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/aataaj.lua b/aataaj.lua index f7371cf..5357ac9 100755 --- a/aataaj.lua +++ b/aataaj.lua @@ -85,6 +85,74 @@ NOTE - Seems both ALSA and JACK are per user. So you need to run +local options = +{ + start = + { + help = 'Command to start the scanning process, for Sys V init.', + }, + restart = {start}, + ['force-reload'] = {start}, + status = + { + help = 'Command to check the status of the scanning process, for Sys V init.', + }, + stop = + { + help = 'Command to stop the scanning process, for Sys V init.', + }, + JACK = + { + help = 'Command to start the JACK stuff, for users.', + }, + STOP = + { + help = 'Command to stop the JACK stuff, for users.', + func = function(a, args, i) + _.killEmAll{'qsynth'} + __[[#!/bin/bash + a2j_control --stop + sleep 2 + a2j_control --exit + sleep 2 + ]]:Do() + _.killEmAll{'alsa_in', 'alsa_out', 'zita-a2j', 'zita-j2a', 'aseqjoy', 'jack-plumbing'} + __[[#!/bin/bash + sleep 2 + jack_control stop + sleep 2 + jack_control exit + sleep 2 + ]]:Do() + _.killEmAll{'jmcore', 'qjackctl'} + -- Catia is python, and no easy way to kill it. + -- Also it keeps jackdbus alive, no matter how hard you kill it. + __"pkill -TERM -u $USER -f catia":Do() + __"sleep 2":Do() + _.killEmAll{'jackdbus', 'a2jmidid'} + os.exit(0) + end + }, + help = + { + help = 'Print help.', + func = function(a, args, i) + print(Help) + os.exit(0) + end + }, + ['--help'] = {help}, +} + +local args = {...} +_.parseArgs(options, args) + + + + + + +--[=[ local args = {...} if 0 ~= #args then -- for i,a in pairs(args) do @@ -135,7 +203,7 @@ else print("Usage: aataaj.lua {help|start|stop|restart|force-reload|status|JACK|STOP}") return(1) end - +]=] -- cgit v1.1