-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathinstall.sh
executable file
·66 lines (55 loc) · 2.16 KB
/
install.sh
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
64
65
#!/bin/bash
set -e
type=${1:-1000}
echo "Installing GSX-$type"
echo "Installing X11 config"
if [ ! -d /etc/X11/xorg.conf.d ]; then
sudo mkdir -p /etc/X11/xorg.conf.d;
fi
sudo cp usr/share/X11/xorg.conf.d/40-sennheiser-gsx-$type.conf /etc/X11/xorg.conf.d/
echo "Installing udev rule"
if [ -d /lib/udev/rules.d/ ]; then
echo "Udev located in /lib"
sudo cp lib/udev/rules.d/91-pulseaudio-gsx$type.rules /lib/udev/rules.d/
elif [ -d /etc/udev/rules.d/ ]; then
echo "Udev located in /etc"
sudo cp lib/udev/rules.d/91-pulseaudio-gsx$type.rules /etc/udev/rules.d/
else
echo "Udev rules route not found, hence cancelling installation"
echo "Expected locations: /etc/udev/rules.d/ OR /lib/udev/rules.d/"
fi
echo "Installing udev hwdb"
sudo cp etc/udev/hwdb.d/sennheiser-gsx.hwdb /etc/udev/hwdb.d/
echo "Installing pulsaudio profiles"
read -p "Should we install the channelswap-fix, see https://github.com/evilphish/sennheiser-gsx-1000/issues/9 (y for yes, n [default])? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo cp -r usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-$type-channelswap.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-$type.conf
echo "- installed channel-swap mix"
else
sudo cp -r usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-$type.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/
echo "- installed normal channel mix"
fi
if [ -d /usr/share/alsa-card-profile/mixer/profile-sets ]; then
sudo ln -s /usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-$type.conf /usr/share/alsa-card-profile/mixer/profile-sets/
fi
echo "Reloading udev rules"
sudo systemd-hwdb update
sudo udevadm control -R
sudo udevadm trigger
read -p "SKIP pulseaudio be restart () (y for yes, n [default])? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Skipped pulseaudio restart"
else
echo "Restarting pulse audio"
# ignore errors if we restart too often / to fast .. we just ensure to nuke it
pulseaudio -k > /dev/null 2>&1 || true
pulseaudio -k > /dev/null 2>&1 || true
pulseaudio -k > /dev/null 2>&1 || true
echo "Ensure pulseaudio is started"
sleep 2
pulseaudio -D
fi