JACK is weak for suspend because it needs to be stopped and restarted when come back from suspend. So I’m trying to write suspend script which stop JACK before go to suspend mode and start after come back from sleep.
First stop and start qjackctl command is below.
dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.stop
dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.start
Now I have very simple script that very useful when come back from suspend mode because it stop and restart qjackctl automatically. That is
#!/bin/bash dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.stop && dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.start
Actually this is enough useful. Lol. But I will try to make better one.
command. The problem is needs sudoers configuration to use pm-suspend command.
Without this “sudo pm-suspend” in bash shell script won’t do anything.
sudo -S pm-suspend
will work, it receives password from a terminal and will suspend.
And this is almost perfect except for security problem
password='Hacker\'s password' echo $password | sudo -S pm-suspend
It won’t require to input password interactively.
#!/bin/bash #Suspend script for JACK(qjackctl) #First stop JACK and go to suspend dbus-send --system /org/rncbc/qjackctl org.rncbc.qjackctl.stop password='********' echo $password | sudo -S pm-suspend
Then, this should be assigned with hot key on GUI manager on Ubuntu.
And I guess restart script is harder because I should research mechanism and the script path which automatically done when return from suspend mode.
My plan was logging about sudoers configuration but now I think i can go with this.
I will write again soon. Bye.😀