#!/bin/bash #--------------------------------------------------------------------- # File information. # File: qmmp.wrapper.in # Purpose: Single-instance wrapper (Laclin-specific) # License: BSD-style (for this file only) # Revision: 241117 #--------------------------------------------------------------------- # Wrapper parameters. BASEDIR=$PRODTREE/qmmp BINDIR=$BASEDIR/xbin LIBDIR=$BASEDIR/lib SNDFLAG=false TARGET=$BINDIR/qmmp PROGNAME="qmmp" #--------------------------------------------------------------------- # Run the target if it's available. if [ -f $TARGET ]; then # If no arguments, start in the user's # home directory # if [ "x$1" = "x" ]; then cd; fi if [ "@$SNDFLAG" == "@true" ]; then resetpcmvol # Adjust volume fi if [ -d $LIBDIR ]; then # Adjust LD_LIBRARY_PATH LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi PATH=$BINDIR:$PATH # Adjust PATH CFGDIR=$HOME/.config/qmmp CFGFILE=$CFGDIR/qmmp.conf SKINSDIR=$HOME/.config/qmmp/skins if [ \! -f $CFGFILE ]; then mkdir -p $CFGDIR cat > $CFGFILE << END [Skinned] always_on_top=false antialiasing=true double_size=true skin_path=$SKINSDIR/KGP_Win98.zip start_hidden=false [Midi] conf_path=$PRODTREE/wildmidi/etc/wildmidi.cfg enhanced_resampling=false reverberation=false sample_rate=44100 END mkdir -p $SKINSDIR pushd $SKINSDIR ln -nsf $PRODTREE/qmmp/skins/* . popd fi /laclin/lacutil/single-instance --wait --usepid \ "/xbin/qmmp\b" $TARGET & pause100ms $TARGET $* exit fi #--------------------------------------------------------------------- # Display a missing-program dialog. TITLE="$PROGNAME isn't installed" /laclin/lacutil/single-instance \ --wait --usewin "^$TITLE" \ zenity --error --no-wrap --title="$TITLE" --text="$TITLE"