mirror of
https://github.com/jhechavarria/say.sh.git
synced 2025-12-10 14:16:59 +00:00
implementation de l'operation uninstall
This commit is contained in:
30
say.sh
30
say.sh
@@ -182,7 +182,18 @@ say ()
|
|||||||
play $SNDPATH vol ${cfg[1]} speed ${cfg[2]};
|
play $SNDPATH vol ${cfg[1]} speed ${cfg[2]};
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "$1" = "install" ]]; then
|
# Script related instructions
|
||||||
|
if [ "$1" = "config" ]; then
|
||||||
|
saycfg $2 $3 $4;
|
||||||
|
elif [ "$1" = "gui" ]; then
|
||||||
|
saygui $2;
|
||||||
|
elif [ "$1" = "say" ]; then
|
||||||
|
if [ "`pgrep -x play`" > /dev/null ]; then
|
||||||
|
shutup;
|
||||||
|
else
|
||||||
|
say "`xsel`" ;
|
||||||
|
fi
|
||||||
|
elif [ "$1" = "install" ]; then
|
||||||
if [ ! -d "$ROOTPATH" ]; then
|
if [ ! -d "$ROOTPATH" ]; then
|
||||||
mkdir -p $ROOTPATH
|
mkdir -p $ROOTPATH
|
||||||
echo "Created directory: $ROOTPATH"
|
echo "Created directory: $ROOTPATH"
|
||||||
@@ -206,14 +217,11 @@ if [[ "$1" = "install" ]]; then
|
|||||||
if [ "$2" = "-d" ]; then
|
if [ "$2" = "-d" ]; then
|
||||||
sudo apt-get install libttspico-utils sox zenity xsel;
|
sudo apt-get install libttspico-utils sox zenity xsel;
|
||||||
fi
|
fi
|
||||||
elif [ "$1" = "config" ]; then
|
elif [ "$1" = "uninstall" ]; then
|
||||||
saycfg $2 $3 $4;
|
cat "$HOME/.bashrc" | grep -v "$SRCPATH" > ~/.bashrc
|
||||||
elif [ "$1" = "gui" ]; then
|
echo "Script autoload instruction removed from $HOME/.bashrc"
|
||||||
saygui $2;
|
source "$HOME/.bashrc"
|
||||||
elif [ "$1" = "say" ]; then
|
echo "Reloaded source: $HOME/.bashrc"
|
||||||
if [ "`pgrep -x play`" > /dev/null ]; then
|
rm -rf "$ROOTPATH"
|
||||||
shutup;
|
echo "Directory removed: $ROOTPATH"
|
||||||
else
|
|
||||||
say "`xsel`" ;
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user