linux:scripts_bash:vrac
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédente | |||
linux:scripts_bash:vrac [22/07/2010 16:47] – aj journaux fc avec zenity daniel | linux:scripts_bash:vrac [22/07/2010 17:29] (Version actuelle) – daniel | ||
---|---|---|---|
Ligne 86: | Ligne 86: | ||
commande && echo -e $OK || echo -e $KO | commande && echo -e $OK || echo -e $KO | ||
</ | </ | ||
+ | |||
Ligne 121: | Ligne 122: | ||
# les urls des rss, à modifier si ça devait changer... | # les urls des rss, à modifier si ça devait changer... | ||
urls=([7]=http:// | urls=([7]=http:// | ||
+ | |||
+ | # qq tests | ||
+ | which zenity >/ | ||
+ | # Attention avec $?, 0 => OK, on change | ||
+ | [ $? -eq 0 ] && zenok=TRUE || zenok=FALSE | ||
+ | |||
+ | which notify-send >/ | ||
+ | [ $? -eq 0 ] && notifok=TRUE || notifok=FALSE | ||
+ | # faudrait plutôt se baser sur le test [ -z " | ||
+ | |||
# les fonctions | # les fonctions | ||
get_heure() { | get_heure() { | ||
- | if [ $# -eq 0 ] && [ -x / | + | if [ $# -eq 0 ] && [ " |
then | then | ||
- | ret=$(/usr/bin/zenity --title=' | + | ret=$(zenity --title=' |
--column='' | --column='' | ||
' | ' | ||
Ligne 147: | Ligne 158: | ||
return $h | return $h | ||
} | } | ||
+ | |||
set_msg() { | set_msg() { | ||
- | [ -x / | + | [ $notifok = " |
} | } | ||
+ | |||
check_heure() { | check_heure() { | ||
url='' | url='' | ||
Ligne 160: | Ligne 171: | ||
[ -z " | [ -z " | ||
} | } | ||
+ | |||
ask2continue() { | ask2continue() { | ||
- | if [ -x / | + | if [ $zenok = TRUE ] |
then | then | ||
| | ||
Ligne 173: | Ligne 184: | ||
fi | fi | ||
} | } | ||
+ | |||
get_url() { | get_url() { | ||
xml="/ | xml="/ | ||
Ligne 184: | Ligne 195: | ||
} | } | ||
s# | s# | ||
+ | |||
jour=$(date ' | jour=$(date ' | ||
[ " | [ " | ||
- | | + | |
# si abandon on est déjà sorti | # si abandon on est déjà sorti | ||
fich=/ | fich=/ | ||
Ligne 199: | Ligne 210: | ||
fi | fi | ||
} | } | ||
- | | + | |
# et le main | # et le main | ||
get_heure $* | get_heure $* |
linux/scripts_bash/vrac.1279810078.txt.gz · Dernière modification : 22/07/2010 16:47 de daniel