-
Notifications
You must be signed in to change notification settings - Fork 33
Aggiunte opzioni notify e help, settata la creazione della variabile $MANNAGGIAURL solo se l'audioflag è vera #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,10 +27,18 @@ DELSTRING1="</FONT>" | |
| DELSTRING2="</b>" | ||
| DEFPLAYER="mplayer -really-quiet -ao alsa" | ||
| PLAYER="${PLAYER:-$DEFPLAYER}" | ||
|
|
||
| notify=0 | ||
| help=0 | ||
| # lettura parametri da riga comando | ||
| for parm in "$@" | ||
| do | ||
| if [ "$parm" = "--help" ];then | ||
| help=1 | ||
| fi | ||
| if [ "$parm" = "--notify" ] | ||
| then | ||
| notify=1 | ||
| fi | ||
| # leggi dai parametri se c'e' l'audio | ||
| if [ "$parm" = "--audio" ] | ||
| then | ||
|
|
@@ -44,7 +52,7 @@ for parm in "$@" | |
|
|
||
| # leggi dai parametri se c'e' da mandare i commenti su wall | ||
| if [ "$parm" = "--wall" ] | ||
| then | ||
| then | ||
| wallflag=true | ||
| fi | ||
|
|
||
|
|
@@ -90,7 +98,7 @@ while [ "$nds" != 0 ] | |
| # shellcheck disable=SC2019 | ||
| MANNAGGIA="Mannaggia $(curl -s "www.santiebeati.it/$(</dev/urandom tr -dc A-Z|head -c1)/"|grep -a tit|cut -d'>' -f 4-9|shuf -n1 |awk -F "$DELSTRING1" '{print$1$2}'|awk -F "$DELSTRING2" '{print$1}')" | ||
| MANNAGGIAURL="http://www.ispeech.org/p/generic/getaudio?text=$MANNAGGIA%2C&voice=euritalianmale&speed=0&action=convert" | ||
|
|
||
| if [ "$wallflag" = true ] | ||
| then | ||
| pot=$(( nds % 50 )) | ||
|
|
@@ -101,7 +109,20 @@ while [ "$nds" != 0 ] | |
| # attenzione: se non siete root o sudoers dovete togliere dalla riga successiva "sudo" e "-n" | ||
| echo "$MANNAGGIA" | sudo wall -n | ||
| fi | ||
| #mannaggia via notifica desktop | ||
| elif [ "$notify" = 1 ]; then | ||
| if ( ! type "notify-send" >/dev/null 2>&1 ); then | ||
| echo "Ti serve notify-send" | ||
| exit 1 | ||
| else | ||
| notify-send "$MANNAGGIA" 2>/dev/null | ||
| fi | ||
| elif [ "$help" = 1 ]; then | ||
| echo "Uso: ./mannaggiatore.sh [opzioni]\nQuesto script provvede a nominare tutti i santi per voi quando vi sentite depressi.\n\nOpizoni:\n --audio: attiva mplayer per fargli pronunciare i santi | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Diversi problemi:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per quanto riguarda l'usage, ho preso le descrizioni che avete dato voi alle opzioni |
||
| --spm: numero di santi per minuto\n --wall: invia l'output a tute le console: atenzione, se non siete root o sudoers disattivare il flag -n\n --notify: invia una notifica desktop\n --help: mostra questa pagina\n\n Buona managgiata a tutti e ricordate: $MANNAGGIA systemd merda 0/" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/atenzione/attenzione/
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refuso |
||
| exit 0 | ||
|
|
||
| else | ||
| echo "$MANNAGGIA" > /dev/stdout | ||
| fi | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Da un punto di vista puramente logico, se l'utente chiede l'help ogni azione dovrebbe essere soppressa, quindi il check dovrebbe essere in cima