Improve docs
This commit is contained in:
parent
916d9ee756
commit
28190c055c
38
README.md
38
README.md
@ -1,38 +1,22 @@
|
|||||||
# pa-xtouch-control
|
# pamidi
|
||||||
Control PulseAudio and X with a Behringer X-Touch Mini
|
Control PulseAudio and X with a Behringer X-Touch Mini (or other MIDI controllers, with some customization).
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
This program was written to work within the stock Pop!_OS desktop environment (running X and PulseAudio) with the `xdotool` package installed to enable binding the currently-focused application to a column.
|
This program was written to work within the stock Pop!_OS desktop environment (running X and PulseAudio) with the `xdotool` package installed to enable binding the currently-focused application to a column.
|
||||||
|
|
||||||
I am open to supporting other window systems if there is sufficient interest.
|
I am open to supporting other window systems if there is sufficient interest.
|
||||||
|
|
||||||
# Installation as a foreground script
|
# Installation as a foreground script
|
||||||
|
|
||||||
Download the script (via `curl` or `wget`) and `chmod +x pa_xtouch_control` to make it executable. Then run it with `./pa_xtouch_control` and test your Behringer X-Touch Mini to make sure everything is working.
|
1. Clone this repository. `git clone https://github.com/Jafner/pamidi.git`
|
||||||
|
2. Make the script executable. `chmod +x pamidi.sh`
|
||||||
|
3. Run the script. `./pamidi.sh`
|
||||||
|
|
||||||
# Installation as a daemon (`systemd`)
|
# Installation as a daemon with `systemd`
|
||||||
1. Download the `pa_xtouch_control.sh` and `pa_xtouch_control.service` files.
|
1. Clone this repository. `git clone https://github.com/Jafner/pamidi.git`
|
||||||
2. Make the `pa_xtouch_control.sh` script executable with `chmod +x pa_xtouch_control.sh`.
|
2. Make the installation script executable with `chmod +x install_daemon_systemd.sh`
|
||||||
3. Place `pa_xtouch_control.sh` into `/usr/bin/` with `mv pa_xtouch_control.sh /usr/bin/`.
|
3. Run the installation script with `./install_daemon_systemd.sh`
|
||||||
4. Place `pa_xtouch_control.service` into `~/.config/systemd/user/` (just 'user', not your username) with `mv pa_xtouch_control.service ~/.config/systemd/user/`
|
|
||||||
5. Create this directory if it does not already exist `mkdir -p ~/.config/systemd/user/`.
|
|
||||||
6. Reload systemd with `systemctl --user daemon-reload`.
|
|
||||||
7. Enable autostart of the systemd service with `systemctl --user enable pa_xtouch_control.service`.
|
|
||||||
8. Start the service with `systemctl --user start pa_xtouch_control.service`.
|
|
||||||
|
|
||||||
You can do all of these steps with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl -o /usr/bin/pa_xtouch_control.sh https://raw.githubusercontent.com/Jafner/pa-xtouch-control/main/pa_xtouch_control.sh && \
|
|
||||||
chmod +x /usr/bin/pa_xtouch_control.sh && \
|
|
||||||
mkdir -p ~/.config/systemd/user && \
|
|
||||||
curl -o ~/.config/systemd/user/pa_xtouch_control.service https://raw.githubusercontent.com/Jafner/pa-xtouch-control/main/pa_xtouch_control.service && \
|
|
||||||
systemctl --user daemon-reload && \
|
|
||||||
systemctl --user enable pa_xtouch_control.service && \
|
|
||||||
systemctl --user start pa_xtouch_control.service
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
# Modifying the script
|
# Modifying the script
|
||||||
|
|
||||||
I've done my best to make the script readable and modifyable. Here is a summary of how the script is laid out:
|
I've done my best to make the script readable and modifyable. Here is a summary of how the script is laid out:
|
||||||
|
14
install_daemon_systemd.sh
Normal file
14
install_daemon_systemd.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Installing script..."
|
||||||
|
chmod +x pamidi.sh
|
||||||
|
cp pamidi.sh /usr/bin/pamidi
|
||||||
|
echo "Installing daemon..."
|
||||||
|
mkdir -p ~/.config/systemd/user/
|
||||||
|
cp pamidi.service ~/.config/systemd/user/
|
||||||
|
echo "Enabling systemd daemon..."
|
||||||
|
systemctl --user daemon-reload
|
||||||
|
systemctl --user enable pamidi.service
|
||||||
|
systemctl --user start pamidi.service
|
||||||
|
|
||||||
|
edho "Done!"
|
@ -1,8 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=PulseAudio X-Touch control daemon
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/usr/bin/pa_xtouch_control.sh
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
8
pamidi.service
Normal file
8
pamidi.service
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Control PulseAudio with a Midi device
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/pamidi.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
@ -48,6 +48,7 @@ initialize(){
|
|||||||
col_8_app_pid=-1
|
col_8_app_pid=-1
|
||||||
assign_profile_1
|
assign_profile_1
|
||||||
print_col_app_ids
|
print_col_app_ids
|
||||||
|
notify-send "Initialized pamidi"
|
||||||
}
|
}
|
||||||
|
|
||||||
assign_profile_1() {
|
assign_profile_1() {
|
||||||
@ -122,6 +123,16 @@ change_volume_standard() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
change_mic_volume_standard(){
|
||||||
|
# take the stream ID of a microphone and change its volume
|
||||||
|
|
||||||
|
new_vol=$2
|
||||||
|
|
||||||
|
mic_sid=$1
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
toggle_mute() {
|
toggle_mute() {
|
||||||
# take the pid of an app
|
# take the pid of an app
|
||||||
# toggle mute all streams for that app
|
# toggle mute all streams for that app
|
Loading…
Reference in New Issue
Block a user