Thursday, May 2, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2657  / 1 Year ago, thu, december 29, 2022, 9:30:57

I can now open Qjackctl using the terminal. This is the code that I am using.



pulseaudio --kill
jack_control start


This will open the program successfully. Then when I am finished I can type this code:



jack_control exit
pulseaudio --start


It takes a little bit of typing, but it works. How do I save the commands and make it work automatically? Thanks in advance for all of your help.


More From » command-line

 Answers
5

You can create a .desktop file for doing this.



First, create a script using terminal:



mkdir -p bin
gedit ~/bin/jack_control.sh


In the new opened file, add the following lines:



#!/bin/bash

pid=$(pgrep -x jack_control)

if [ "$pid" = "" ]; then
pulseaudio --kill
jack_control start
else
jack_control exit
pulseaudio --start
fi


Save the file, close it and make it executable:



chmod +x ~/bin/jack_control.sh


Now you can create your .desktop file:



gedit ~/Desktop/jack_control.desktop


In the new opened file, add the following lines:



[Desktop Entry]
Version=1.0
Name=Qjackctl
Comment=Start or stop jack_control
Exec=/home/your_username/bin/jack_control.sh
Icon=/path/to/icon.png # <-- this line is optional
Terminal=false
Type=Application
Categories=Utility;Application;


Save the file, close it and make it executable:



chmod +x ~/Desktop/jack_control.desktop


Finally, go to desktop and test your new .desktop file.



More about: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles


[#29603] Friday, December 30, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enytidge

Total Points: 169
Total Questions: 105
Total Answers: 107

Location: Papua New Guinea
Member since Tue, Aug 24, 2021
3 Years ago
enytidge questions
Tue, Feb 28, 23, 15:26, 1 Year ago
Sun, Jan 1, 23, 19:36, 1 Year ago
Sun, Oct 24, 21, 07:30, 3 Years ago
Wed, Nov 9, 22, 22:02, 2 Years ago
;