afficher résultat d'une recherche dans un fichier [Réglé]

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
.gif)
Voila cette question est pour de grands spécialistes du script , ainsi que les suivantes.
J'ai besoin d'aide pour faire un script qui récupère le résultat de ceci :
Code TEXT :
qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData
Et l'écrive dans un fichier.log ; à moins qu'il est possible d'ajouter un print ou autre chose à cette ligne :
Code TEXT :
${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w40}
.gif)
P.S J'ai mis le post ici pour ne pas encombrer le post sur les conky.
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX

thierryR Membre non connecté
-
- Voir le profil du membre thierryR
- Inscrit le : 02/02/2010
- Site internet
débusqueur de bugs et chercheur en améliorations
Amicalement vôtre.
Kernel: 4.4.92-desktop-1.mga5 x86_64 (64 bit) Desktop: KDE 4.14.35 Distro: Mageia 5 thornicroft
Machine: Mobo: ASUSTeK model: X751SA v: 1.0 Bios: American Megatrends v: X751SA.403
CPU: Quad core Intel Pentium N3710 (-MCP-) cache: 1024 KB Graphics: Card: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller

Kernel: 4.4.92-desktop-1.mga5 x86_64 (64 bit) Desktop: KDE 4.14.35 Distro: Mageia 5 thornicroft
Machine: Mobo: ASUSTeK model: X751SA v: 1.0 Bios: American Megatrends v: X751SA.403
CPU: Quad core Intel Pentium N3710 (-MCP-) cache: 1024 KB Graphics: Card: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
.gif)
Merci ça fonctionne mais j'ai du ajouter une deuxième ligne sinon plus d'affichage dans le conky.
Code TEXT :
${font URW Chancery L:style=Bold:size=10}${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w40 } ${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w40 > ~/.conky/radiotray/artiste_titre.txt}
Maintenant que j'ai mon fichier .txt qui change à chaque artiste comme le conky



Du beaucoup plus hard , comment faire un script qui me récupère cette ligne pour aller chercher l'image de la pochette avec google-image ou autre.
un truc de ce genre:
Code TEXT :
#!/bin/bash # demander à google image wget https://www.google.com/searchbyimage?image_url= ligne généré par le artiste_titre.txt #prendre la première image la convertir et l'afficher dans : convert ~/.conky/radiotray/$nomimage.jpg ~/.conky/radiotray/cover.png exit
.gif)
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
.gif)
Code TEXT :
#bin/bash titre=$(head -1 ~/.conky/radiotray/artiste_titre.txt) lienMiniature=$(wget -U'Googlebot-Image/1.0' -qO - "www.google.fr/search?q=$titre&tbm=isch" | perl -pe 's!.*?<img .*?src="([^"]*)".*!$1!') wget -qO miniatureGoogleImage $lienMiniature convert ~/miniatureGoogleImage ~/.conky/radiotray/pochette.png
.gif)
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie