summaryrefslogtreecommitdiff
path: root/assets/easyeffects-eq-presets.sh
blob: 40e9cd93e68cfea7bc375d0368a8ea3aa02f817b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
# Install EasyEffects parametric EQ presets (Harman target)
#
# Presets:
#   dt770-pro-250-harman-eq.json   - Beyerdynamic DT 770 Pro 250 Ohm (oratory1990)
#   pxc-550-ii-harman-eq.json      - Sennheiser PXC 550-II (AutoEQ/oratory1990)
#   pixel-buds-pro-2-harman-eq.json - Google Pixel Buds Pro 2 (AutoEQ/DHRME)
#
# Prerequisites: easyeffects, pipewire, pipewire-pulse
#
# Usage: ./easyeffects-eq-presets.sh [install|uninstall]

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PRESET_DIR="${HOME}/.config/easyeffects/output"

PRESETS=(
    "dt770-pro-250-harman-eq.json"
    "pxc-550-ii-harman-eq.json"
    "pixel-buds-pro-2-harman-eq.json"
)

install_presets() {
    # Ensure easyeffects is installed
    if ! command -v easyeffects &>/dev/null; then
        echo "easyeffects not found. Installing..."
        sudo pacman -S --needed --noconfirm easyeffects
    fi

    mkdir -p "$PRESET_DIR"

    for preset in "${PRESETS[@]}"; do
        if [[ -f "${SCRIPT_DIR}/${preset}" ]]; then
            cp "${SCRIPT_DIR}/${preset}" "${PRESET_DIR}/${preset}"
            echo "Installed: ${preset}"
        else
            echo "Warning: ${preset} not found in ${SCRIPT_DIR}" >&2
        fi
    done

    echo ""
    echo "Presets installed to ${PRESET_DIR}"
    echo "Open EasyEffects and select a preset from the dropdown."
}

uninstall_presets() {
    for preset in "${PRESETS[@]}"; do
        if [[ -f "${PRESET_DIR}/${preset}" ]]; then
            rm "${PRESET_DIR}/${preset}"
            echo "Removed: ${preset}"
        fi
    done
}

case "${1:-install}" in
    install)   install_presets ;;
    uninstall) uninstall_presets ;;
    *)
        echo "Usage: $0 [install|uninstall]" >&2
        exit 1
        ;;
esac