Skip to content

AI generated script for Linux Mint 22 (PipeWire) #8

@Senor-S

Description

@Senor-S

So, I used AI to port the Ubuntu 22.10 PipeWire-script to Mint 22. I'm too scared to run it because I'm not experienced enough to spot flaws, but maybe someone in here is?

⚠️⚠️ AI generated, don't run without checking it first ⚠️⚠️

#!/bin/bash
# ---------------------------
# This is a bash script for configuring Linux Mint 22 for pro audio.
# ---------------------------
# NOTE: Execute this script by running the following command on your system:
# wget -O ~/install-audio.sh https://raw.githubusercontent.com/your-repository-path/install-audio.sh && chmod +x ~/install-audio.sh && ~/install-audio.sh

# Exit if any command fails
set -e

notify () {
  echo "--------------------------------------------------------------------"
  echo $1
  echo "--------------------------------------------------------------------"
}

# ---------------------------
# Update the system
# ---------------------------
notify "Update the system"
sudo apt update && sudo apt dist-upgrade -y

# ---------------------------
# Install the Liquorix kernel
# The Liquorix kernel is a low-latency kernel optimized for multimedia and gaming.
# ---------------------------
notify "Install the Liquorix kernel"
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:damentz/liquorix -y && sudo apt-get update
sudo apt-get install linux-image-liquorix-amd64 linux-headers-liquorix-amd64 -y

# ---------------------------
# Modify GRUB options for performance
# These options disable security mitigations, enable threaded IRQs, and set CPU to performance mode.
# ---------------------------
notify "Modify GRUB options"
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs mitigations=off cpufreq.default_governor=performance"/g' /etc/default/grub
sudo update-grub

# ---------------------------
# System performance tweaks in sysctl.conf
# These settings reduce system memory swapping and increase the max number of file watches.
# ---------------------------
notify "Configure sysctl.conf for audio performance"
echo 'vm.swappiness=10
fs.inotify.max_user_watches=600000' | sudo tee -a /etc/sysctl.conf

# ---------------------------
# Configure audio limits for real-time processing
# This config grants real-time priority and unlimited memory locking to users in the audio group.
# ---------------------------
notify "Configure audio.conf for real-time processing"
echo '@audio - rtprio 90
@audio - memlock unlimited' | sudo tee -a /etc/security/limits.d/audio.conf

# ---------------------------
# Add current user to the audio group
# This step is needed for accessing real-time audio privileges configured above.
# ---------------------------
notify "Add user to the audio group"
sudo adduser $USER audio

# ---------------------------
# Install REAPER (portable) for professional audio production
# ---------------------------
notify "Install REAPER"
wget -O reaper.tar.xz http://reaper.fm/files/7.x/reaper720_linux_x86_64.tar.xz
mkdir ./reaper
tar -C ./reaper -xf reaper.tar.xz
./reaper/reaper_linux_x86_64/install-reaper.sh --install ~/ --integrate-desktop
rm -rf ./reaper
rm reaper.tar.xz
touch ~/REAPER/reaper.ini

# ---------------------------
# Install Wine (staging) and Winetricks, required for yabridge and Windows VST plugins
# ---------------------------
notify "Install Wine for Windows VST compatibility"
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources
sudo apt update
sudo apt install --install-recommends winehq-staging -y

# Install Winetricks for additional Wine configurations
sudo apt install cabextract -y
mkdir -p ~/.local/share
wget -O winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
mv winetricks ~/.local/share
chmod +x ~/.local/share/winetricks
echo '' >> ~/.bash_aliases
echo '# Audio: winetricks' >> ~/.bash_aliases
echo 'export PATH="$PATH:$HOME/.local/share"' >> ~/.bash_aliases
. ~/.bash_aliases

# Install corefonts via Winetricks for VST compatibility
winetricks corefonts

# Copy Wine prefix as a base for future VST installations
cp -r ~/.wine ~/.wine-base

# ---------------------------
# Install yabridge to bridge Windows VST plugins to Linux
# ---------------------------
notify "Install yabridge"
wget -O yabridge.tar.gz https://github.com/robbert-vdh/yabridge/releases/download/5.1.0/yabridge-5.1.0.tar.gz
mkdir -p ~/.local/share
tar -C ~/.local/share -xavf yabridge.tar.gz
rm yabridge.tar.gz
echo '' >> ~/.bash_aliases
echo '# Audio: yabridge path' >> ~/.bash_aliases
echo 'export PATH="$PATH:$HOME/.local/share/yabridge"' >> ~/.bash_aliases
. ~/.bash_aliases

# Install libnotify-bin for yabridge plugin notifications
sudo apt install libnotify-bin -y

# Create standard directories for VST plugins
mkdir -p "$HOME/.wine/drive_c/Program Files/Steinberg/VstPlugins"
mkdir -p "$HOME/.wine/drive_c/Program Files/Common Files/VST2"
mkdir -p "$HOME/.wine/drive_c/Program Files/Common Files/VST3"

# Register these directories with yabridge for Windows VST hosting
yabridgectl add "$HOME/.wine/drive_c/Program Files/Steinberg/VstPlugins"
yabridgectl add "$HOME/.wine/drive_c/Program Files/Common Files/VST2"
yabridgectl add "$HOME/.wine/drive_c/Program Files/Common Files/VST3"

# ---------------------------
# Finished!
# Reboot the system to apply all changes and start making music!
# ---------------------------
notify "Done - please reboot."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions