summaryrefslogtreecommitdiff
path: root/configs/talking-parabola-openrc/root-image/usr/bin/pick-a-card
diff options
context:
space:
mode:
authorDavid P <megver83@openmailbox.org>2017-10-01 17:19:40 -0300
committerDavid P <megver83@openmailbox.org>2017-10-01 17:19:40 -0300
commit1bf80f77f7a8bb4ffdd203c60662421e3f8f589b (patch)
treee7b444e2dd20ffb0b5905942dd853bf4d2c0da8a /configs/talking-parabola-openrc/root-image/usr/bin/pick-a-card
parentf5d62fdcd4a6d351fa25af3b3e443ba4de67a802 (diff)
Added configs/mate-openrc
Other changes: - Updated talkingparabola-X11 packages.both (xorg pkgs) - Updated pacman-init service for profile-openrc
Diffstat (limited to 'configs/talking-parabola-openrc/root-image/usr/bin/pick-a-card')
-rwxr-xr-xconfigs/talking-parabola-openrc/root-image/usr/bin/pick-a-card54
1 files changed, 0 insertions, 54 deletions
diff --git a/configs/talking-parabola-openrc/root-image/usr/bin/pick-a-card b/configs/talking-parabola-openrc/root-image/usr/bin/pick-a-card
deleted file mode 100755
index 7f469e8..0000000
--- a/configs/talking-parabola-openrc/root-image/usr/bin/pick-a-card
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-# If there are multiple usable sound cards, prompt the user to choose one,
-# using auditory feedback.
-# This script is released under the GNU General Public License.
-
-source /usr/share/livecd-sound/functions
-
-nwords() {
- echo $#
-}
-
-is_numeric() {
- local str=$1
- expr match "$str" '[[:digit:]]\+$' > /dev/null 2>&1
-}
-
-set_default_card() {
- local card=$1
- sed -e "s/%card%/$card/g" < /usr/share/livecd-sound/asound.conf.in \
- > /etc/asound.conf
-}
-
-play_on_card() {
- local card=$1 file=$2
- aplay "-Dplughw:$card,0" "$file"
-}
-
-set -f
-usable_cards="$(list_non_pcsp_cards)"
-num_usable_cards=$(nwords $usable_cards)
-
-if [ "$num_usable_cards" -eq 1 ]; then
- exit 0
-fi
-
-for card in $usable_cards; do
- if ! is_numeric "$card"; then
- continue
- fi
- play_on_card "$card" /usr/share/livecd-sound/sounds/pick-a-card.wav&
-done
-wait
-sleep 1
-for card in $usable_cards; do
- if ! is_numeric "$card"; then
- continue
- fi
- play_on_card "$card" /usr/share/livecd-sound/sounds/beep.wav
- if read -t 10; then
- set_default_card "$card"
- break
- fi
-done