#!/bin/bash if [ "$1" = "votecoin" ]; then NAME="VoteCoin Wallet" TMP="/tmp/votecoin.tar.gz" EXECUTABLE="/opt/VoteCoin Wallet-linux-x64/VoteCoin Wallet" INSTALL="wget -O $TMP 'https://votecoin.site/download.php?os=linux' && tar -xf $TMP -C /opt && rm -f $TMP" POSTINSTALL="" ONLY64=true fi if [ "$1" = "vlc" ]; then NAME="VLC Video Player" EXECUTABLE="/usr/bin/vlc" INSTALL="apt install --yes vlc" POSTINSTALL="rm /usr/share/applications/vlc.desktop; mkdir /home/guest/.config/vlc; echo '[qt4] qt-privacy-ask=0' > /home/guest/.config/vlc/vlcrc;" GUEST=true fi if [ "$1" = "chromium" ]; then NAME="Chromium Web Browser" EXECUTABLE="/usr/bin/chromium" INSTALL="apt install --yes chromium" POSTINSTALL="rm -f /usr/share/applications/chromium.desktop" GUEST=true fi shift # ------------------------------------------------ # do not touch anything below this line # ------------------------------------------------ if [ "$EXECUTABLE" = "" ]; then exit fi if [ ! -f "$EXECUTABLE" ]; then if [ $(uname -m) != 'x86_64' -a "$ONLY64" = "true" ]; then gtkdialog -i /usr/share/icons/gnome/16x16/status/dialog-warning.png -t Error -m "$NAME only works in 64bit version of Slax" -y OK exit 1 fi if gtkdialog -i /usr/share/icons/gnome/16x16/status/dialog-question.png -t Install -m "$NAME is not yet installed. Do you like to download and install it now?" -y Yes -n No; then xterm -ls -e bash --login -c -- "$INSTALL; $POSTINSTALL" fi fi if [ -f "$EXECUTABLE" ]; then fbstartupnotify if [ "$GUEST" = "true" -a "$EUID" -eq 0 ]; then xhost + >/dev/null 2>/dev/null exec su -c "$EXECUTABLE "$@"" guest fi exec "$EXECUTABLE" "$@" fi