Skip to content

Instantly share code, notes, and snippets.

@petrohs
Created August 20, 2020 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petrohs/abf4b1e41e940b05c79dd6cd70c6288b to your computer and use it in GitHub Desktop.
Save petrohs/abf4b1e41e940b05c79dd6cd70c6288b to your computer and use it in GitHub Desktop.
_Pprism¦ Lista en zenity para prism
#!/bin/bash
ayuda () { echo '
#===============================================================================
#
# SCRIPT: _Pprism.sh
#
# USO: _Pprism.sh
#
# DESCRIPCION: ---
#
# OPCIONES: ---
# DEPENDENCIAS: ---
# BUGS: ---
# NOTAS: ---
# URL: ---
# VERSIONES: 20090506 0.0.1 PetrOHS Creacion.
#===============================================================================
' | more;}
#ayuda
if [ "$1" = "-h" -o "$1" = "--help" ]
then ayuda; exit 1;
elif [ "$1" = "-v" -o "$1" = "--version" ] #version
then echo "`grep '# VERSIONES: ' $0 | grep -v grep | cut -d' ' -f8-10`"; exit 1;
fi
#conf
XULRUNNER="/usr/bin/xulrunner";
PRISM="/usr/share/prism/application.ini";
ZENITY="/usr/bin/zenity";
ALLTRAY="/usr/bin/alltray";
#Dependencias
if [ ! -x $XULRUNNER ]; then echo "Error: No esta disponible $XULRUNNER"; exit 1; fi;
if [ ! -r $PRISM ]; then echo "Error: No esta disponible $PRISM"; exit 2; fi;
if [ ! -x $ZENITY ]; then echo "Error: No esta disponible $ZENITY"; exit 3; fi;
if [ ! -x $ALLTRAY ]; then ALLQ="NO"; else ALLQ="SI"; fi;
#Consulta
PERFIL=`(echo "Crear nuevo...";cd $HOME/.prism && find . -name "*@*" | cut -d"/" -f4) | \
$ZENITY --list --title "prism" --window-icon=question --text "Selecciona el perfil para prism" --column "perfil"`;
if [ "$PERFIL" != "" ]
then
if [ $ALLQ == "NO" ]
then
nohup $XULRUNNER $PRISM -webapp $PERFIL 2>/dev/null &
else
$ZENITY --question --title "icontray" --text "Quiere que este presente en el area de notificacion";
if [ $? -ne 0 ]; then ALLTRAY=""; fi;
nohup $ALLTRAY $XULRUNNER $PRISM -webapp $PERFIL 2>/dev/null &
fi
fi
#Influenza porcina: origen en los cerdos politicos.
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment