Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
yad_yet_another_dialog [Le 11/09/2022, 11:48] moths-art Suppression des espaces en fin de ligne (détecté et corrigé via le bot wiki-corrector (https://forum.ubuntu-fr.org/viewtopic.php?id=2067892) |
yad_yet_another_dialog [Le 28/09/2022, 21:04] Amiralgaby correction de certain script shell repéré grâce à wiki-corrector |
||
---|---|---|---|
Ligne 151: | Ligne 151: | ||
recherche=$(yad --entry --title='Recherche web' --text='Tapez votre recherche' --text-align="center" --no-escape --mouse --undecorated --skip-taskbar --on-top) | recherche=$(yad --entry --title='Recherche web' --text='Tapez votre recherche' --text-align="center" --no-escape --mouse --undecorated --skip-taskbar --on-top) | ||
recherche=${recherche// /+} | recherche=${recherche// /+} | ||
- | xdg-open "https://www.google.fr/search?q="$recherche"&site=webhp&source=lnt&tbs=lr:lang_1fr&lr=lang_fr" | + | xdg-open "https://www.google.fr/search?q=$recherche&site=webhp&source=lnt&tbs=lr:lang_1fr&lr=lang_fr" |
</code> | </code> | ||
====--form==== | ====--form==== | ||
Ligne 179: | Ligne 179: | ||
--field="recherche:" '' \ | --field="recherche:" '' \ | ||
--field="Moteur:CB" 'Forum ubuntu!^Google fr') | --field="Moteur:CB" 'Forum ubuntu!^Google fr') | ||
- | rech=$(echo $search | awk 'BEGIN {FS="|" } { print $1 }') | + | rech=$(echo "$search" | awk 'BEGIN {FS="|" } { print $1 }') |
- | moteur=$(echo $search | awk 'BEGIN {FS="|" } { print $2 }') | + | moteur=$(echo "$search" | awk 'BEGIN {FS="|" } { print $2 }') |
if [ "$moteur" = "Forum ubuntu" ] | if [ "$moteur" = "Forum ubuntu" ] | ||
then | then | ||
Ligne 202: | Ligne 202: | ||
Exemple avec un script faisant les mises à jour et affichant avec une icône dans la zone de notification pour le signaler : | Exemple avec un script faisant les mises à jour et affichant avec une icône dans la zone de notification pour le signaler : | ||
- | <code>#!/bin/bash | + | <code> |
+ | #!/bin/bash | ||
MSG="Mise à jour du système en cours, n'éteignez pas l'ordinateur..." | MSG="Mise à jour du système en cours, n'éteignez pas l'ordinateur..." | ||
notify-send "$MSG" | notify-send "$MSG" | ||
- | faireMaJ () { (sudo apt update ; sudo apt full-upgrade) > /dev/null; quit ; } | + | faireMaJ () { (sudo apt update ; sudo apt full-upgrade) > /dev/null; } |
faireMaJ | yad --notification --no-middle --text="$MSG" --image="system-software-update" --command="zenity --info --text \"$MSG\"" --listen | faireMaJ | yad --notification --no-middle --text="$MSG" --image="system-software-update" --command="zenity --info --text \"$MSG\"" --listen | ||
- | exit 0</code> | + | </code> |
{{::yad.3.png?400|}} | {{::yad.3.png?400|}} | ||
Ligne 236: | Ligne 237: | ||
--field="recherche:" '' \ | --field="recherche:" '' \ | ||
--field="Moteur:CB" 'Forum ubuntu!^Google fr') | --field="Moteur:CB" 'Forum ubuntu!^Google fr') | ||
- | rech=$(echo $search | awk 'BEGIN {FS="|" } { print $1 }') | + | rech=$(echo "$search" | awk 'BEGIN {FS="|" } { print $1 }') |
- | moteur=$(echo $search | awk 'BEGIN {FS="|" } { print $2 }') | + | moteur=$(echo "$search" | awk 'BEGIN {FS="|" } { print $2 }') |
if [ "$moteur" = "Forum ubuntu" ] | if [ "$moteur" = "Forum ubuntu" ] | ||
then | then | ||
Ligne 257: | Ligne 258: | ||
#!/bin/bash | #!/bin/bash | ||
#####ID --KEY Création aléatoire de l'id | #####ID --KEY Création aléatoire de l'id | ||
- | id=$(echo $[($RANDOM % ($[10000 - 32000] + 1)) + 10000] ) | + | id=$(($RANDOM % ($((10000 - 32000)) + 1) + 10000)) |
##########Onglet 1########## | ##########Onglet 1########## | ||
#####Avec une colonne####### | #####Avec une colonne####### | ||
Ligne 304: | Ligne 305: | ||
else | else | ||
retour=$(yad --title="Fichier à afficher" --width 800 --height 200 --text-align="center" --list --radiolist --column="Sélectionné" --column="Fichier" --column="Mis à jour" --column="Utillisé" False "$HOME/Documents/FichierUn" "Non" "Non" False "$HOME/Documents/FichierDEux" "Oui" "Non" True "$HOME/Documents/FichierTrois" "Oui" "Non") | retour=$(yad --title="Fichier à afficher" --width 800 --height 200 --text-align="center" --list --radiolist --column="Sélectionné" --column="Fichier" --column="Mis à jour" --column="Utillisé" False "$HOME/Documents/FichierUn" "Non" "Non" False "$HOME/Documents/FichierDEux" "Oui" "Non" True "$HOME/Documents/FichierTrois" "Oui" "Non") | ||
- | cat $(echo "$retour" | cut -d'|' -f2) | + | cat "$(echo "$retour" | cut -d'|' -f2)" |
fi | fi | ||
- | exit 0; | ||
</code> | </code> | ||
{{ :yad_disco_00_radiolist.png?direct&800 |}} | {{ :yad_disco_00_radiolist.png?direct&800 |}} |