-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from EugenMayer/features/improve-scripts
Fix/improve install script
- Loading branch information
Showing
6 changed files
with
282 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,53 @@ | ||
sudo cp etc/X11/xorg.conf.d/40-sennheiser-gsx-1000.conf /etc/X11/xorg.conf.d | ||
sudo cp lib/udev/rules.d/91-pulseaudio-gsx1000.rules /lib/udev/rules.d/ | ||
sudo cp -r usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-1000.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/ | ||
#!/bin/bash | ||
|
||
set -e | ||
type=${1:-1000} | ||
|
||
echo "Installing GSX-$type" | ||
|
||
echo "Installing X11 config" | ||
if [ -f /etc/debian_version ]; then | ||
echo "- Debian/Ubuntu base" | ||
sudo cp usr/share/X11/xorg.conf.d/40-sennheiser-gsx-$type.conf /usr/share/X11/xorg.conf.d/ | ||
else | ||
echo "- Assuming arch base" | ||
sudo cp usr/share/X11/xorg.conf.d/40-sennheiser-gsx-$type.conf /etc/X11/xorg.conf.d/ | ||
fi | ||
|
||
echo "Installing udev rule" | ||
sudo cp lib/udev/rules.d/91-pulseaudio-gsx$type.rules /lib/udev/rules.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/ | ||
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 | ||
|
||
|
||
echo "Reloading udev rules" | ||
sudo udevadm control -R | ||
sudo udevadm trigger | ||
|
||
pulseaudio -k | ||
pulseaudio -k | ||
pulseaudio -k | ||
sleep 2 | ||
pulseaudio -k | ||
pulseaudio -D | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
type=${1:-1000} | ||
|
||
echo "Uninstalling GSX-$type" | ||
|
||
sudo rm -f /usr/share/X11/xorg.conf.d/40-sensheiser-gsx-$type.conf | ||
sudo rm -f /etc/X11/xorg.conf.d/40-sensheiser-gsx-$type.conf | ||
sudo rm -f /lib/udev/rules.d/91-pulseaudio-gsx$type.rules | ||
sudo rm -f /usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-$type.conf | ||
|
||
echo "Reloading udev rules" | ||
sudo udevadm control -R | ||
sudo udevadm trigger | ||
|
||
read -p "Should pulseaudio be restarted (y for yes)? " -n 1 -r | ||
echo # (optional) move to a new line | ||
if [[ $REPLY =~ ^[Yy]$ ]] | ||
then | ||
echo "Restart pulse audio" | ||
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 | ||
else | ||
echo "Skipped pulseaudio restart" | ||
fi | ||
|
85 changes: 85 additions & 0 deletions
85
usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-1000-channelswap.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
######################################################################### | ||
# Configuration file for the Sennheiser GSX 1000 # | ||
# by Alexander Heuer <evilphish@phishtank.de> # | ||
######################################################################### | ||
# With this device, regarding sinks, # | ||
# hw:1,0 is the mono "chat" output useful for mumble or similar voice # | ||
# programs. Its offset from the main volume can be controlled # | ||
# with an extra volume knob on the side of the device. # | ||
# hw:1,1 is the main 7.1 channel surround output into the device and # | ||
# is controlled directly via the main volume knob. # | ||
# # | ||
# Regarding sources, hw:1,0 is the microphone input. # | ||
# # | ||
# This configuration enables two output devices labeled "main output" # | ||
# and "chat output" with respect to the two previously mentioned sinks. # | ||
# # | ||
# If you have troubles with your distributions volume control, use the # | ||
# pulseaudio pavucontrol program # | ||
######################################################################### | ||
# This program is free software: you can redistribute it and/or modify # | ||
# it under the terms of the GNU General Public License v2 as published # | ||
# by the Free Software Foundation. # | ||
# # | ||
# This program is distributed in the hope that it will be useful, but # | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of # | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # | ||
# General Public License for more details. # | ||
# # | ||
# You should have received a copy of the GNU General Public License # | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. # | ||
######################################################################### | ||
|
||
[General] | ||
auto-profiles = no | ||
|
||
[Mapping analog-output-surround71] | ||
description = main output | ||
device-strings = hw:CARD=GSX1000,DEV=1 | ||
#device-strings = hw:%f,1 | ||
channel-map = front-left,front-right,front-center,lfe,rear-left,rear-right,side-left,side-right | ||
paths-output = analog-output analog-output-lineout analog-output-speaker | ||
priority = 2 | ||
|
||
[Mapping analog-output-chat] | ||
description = chat output | ||
device-strings = hw:CARD=GSX1000,DEV=0 | ||
#device-strings = hw:%f,0 | ||
channel-map = mono | ||
paths-output = analog-output-headphones analog-output-headphones-2 analog-output-mono | ||
priority = 1 | ||
|
||
|
||
[Mapping analog-input] | ||
description = microphone input | ||
device-strings = hw:CARD=GSX1000,DEV=0 | ||
#device-strings = hw:%f,0 | ||
channel-map = mono | ||
paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic | ||
priority = 2 | ||
|
||
# Combined output profile | ||
[Profile output:analog-output-surround71+output:analog-output-chat+input:analog-input] | ||
description = 7.1 Surround | ||
output-mappings = analog-output-surround71 analog-output-chat | ||
input-mappings = analog-input | ||
priority = 88 | ||
skip-probe = yes | ||
|
||
# If you do not want two devices but only one with a switchable profile | ||
# (don't know why you would want that) uncomment the following two | ||
# blocks and comment the one block above this comment. | ||
|
||
#[Profile output:analog-output-surround71+input:analog-input] | ||
#description = 7.1 Surround | ||
#output-mappings = analog-output-surround71 | ||
#input-mappings = analog-input | ||
#priority = 88 | ||
#skip-probe = yes | ||
# | ||
#[Profile output:analog-output-chat] | ||
#description = chat output | ||
#output-mappings = analog-output-chat | ||
#input-mappings = analog-input | ||
#priority = 80 | ||
#skip-probe = yes |
85 changes: 85 additions & 0 deletions
85
usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-1200-channelswap.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
######################################################################### | ||
# Configuration file for the Sennheiser GSX 1200 # | ||
# by Alexander Heuer <evilphish@phishtank.de> # | ||
######################################################################### | ||
# With this device, regarding sinks, # | ||
# hw:1,0 is the mono "chat" output useful for mumble or similar voice # | ||
# programs. Its offset from the main volume can be controlled # | ||
# with an extra volume knob on the side of the device. # | ||
# hw:1,1 is the main 7.1 channel surround output into the device and # | ||
# is controlled directly via the main volume knob. # | ||
# # | ||
# Regarding sources, hw:1,0 is the microphone input. # | ||
# # | ||
# This configuration enables two output devices labeled "main output" # | ||
# and "chat output" with respect to the two previously mentioned sinks. # | ||
# # | ||
# If you have troubles with your distributions volume control, use the # | ||
# pulseaudio pavucontrol program # | ||
######################################################################### | ||
# This program is free software: you can redistribute it and/or modify # | ||
# it under the terms of the GNU General Public License v2 as published # | ||
# by the Free Software Foundation. # | ||
# # | ||
# This program is distributed in the hope that it will be useful, but # | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of # | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # | ||
# General Public License for more details. # | ||
# # | ||
# You should have received a copy of the GNU General Public License # | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. # | ||
######################################################################### | ||
|
||
[General] | ||
auto-profiles = no | ||
|
||
[Mapping analog-output-surround71] | ||
description = main output | ||
device-strings = hw:CARD=GSX1200,DEV=1 | ||
#device-strings = hw:%f,1 | ||
channel-map = front-left,front-right,front-center,lfe,rear-left,rear-right,side-left,side-right | ||
paths-output = analog-output analog-output-lineout analog-output-speaker | ||
priority = 2 | ||
|
||
[Mapping analog-output-chat] | ||
description = chat output | ||
device-strings = hw:CARD=GSX1200,DEV=0 | ||
#device-strings = hw:%f,0 | ||
channel-map = mono | ||
paths-output = analog-output-headphones analog-output-headphones-2 analog-output-mono | ||
priority = 1 | ||
|
||
|
||
[Mapping analog-input] | ||
description = microphone input | ||
device-strings = hw:CARD=GSX1200,DEV=0 | ||
#device-strings = hw:%f,0 | ||
channel-map = mono | ||
paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic | ||
priority = 2 | ||
|
||
# Combined output profile | ||
[Profile output:analog-output-surround71+output:analog-output-chat+input:analog-input] | ||
description = 7.1 Surround | ||
output-mappings = analog-output-surround71 analog-output-chat | ||
input-mappings = analog-input | ||
priority = 88 | ||
skip-probe = yes | ||
|
||
# If you do not want two devices but only one with a switchable profile | ||
# (don't know why you would want that) uncomment the following two | ||
# blocks and comment the one block above this comment. | ||
|
||
#[Profile output:analog-output-surround71+input:analog-input] | ||
#description = 7.1 Surround | ||
#output-mappings = analog-output-surround71 | ||
#input-mappings = analog-input | ||
#priority = 88 | ||
#skip-probe = yes | ||
# | ||
#[Profile output:analog-output-chat] | ||
#description = chat output | ||
#output-mappings = analog-output-chat | ||
#input-mappings = analog-input | ||
#priority = 80 | ||
#skip-probe = yes |