#!/bin/sh # Voyager — user-local installer for the Voyager sound theme. # SPDX-License-Identifier: BSD-2-Clause # # Usage: # ./install.sh install into ~/.local/share/sounds # ./install.sh -d /some/dir install into /sounds # ./install.sh -s install into /usr/share/sounds (needs root) # ./install.sh -y activate the theme without asking set -eu THEME=Voyager SRC=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) DEST="${HOME}/.local/share" ASSUME_YES=0 usage() { sed -n '3,10p' "$0" | sed 's/^# \{0,1\}//' exit "${1:-0}" } while [ $# -gt 0 ]; do case "$1" in -d) DEST="${2:?-d richiede un percorso}"; shift 2 ;; -s) DEST=/usr; shift ;; -y) ASSUME_YES=1; shift ;; -h|--help) usage 0 ;; *) usage 1 ;; esac done TARGET="$DEST/share/sounds/$THEME" mkdir -p "$TARGET" cp -r "$SRC/$THEME/." "$TARGET/" echo "installato: $TARGET" echo "cue installati: $(find "$TARGET/stereo" -name '*.oga' | wc -l)" if command -v kwriteconfig6 >/dev/null 2>&1; then echo if [ "$ASSUME_YES" = 1 ]; then answer=y elif [ -t 0 ]; then printf 'attivare ora %s come tema sonoro? [s/N] ' "$THEME" read -r answer || answer=n else answer=n fi case "$answer" in s|S|y|Y) kwriteconfig6 --file kdeglobals --group Sounds --key Theme "$THEME" echo "tema attivo: $THEME" ;; *) echo "tema non attivato (Impostazioni di sistema > Colori e temi > Suoni)" ;; esac fi