Comment puis-je créer et définir automatiquement des fonds d'écran basés sur des guillemets aléatoires?

J'aime beaucoup les citations et j'aimerais l'afficher sur mon bureau en tant que fond d'écran.

Citation imprimée au milieu de l'image normale en tant que fond d'écran.

Existe-t-il un logiciel pour faire ce travail? Je sais qu'il existe de nombreux logiciels pour afficher des images aléatoires en tant que fond d'écran, mais celui-ci devrait générer des images avec du texte et l'afficher comme fond d'écran.

Vous pourriez écrire un script bash pour faire cela pour vous. Basé sur le tutoriel xplanet (pour définir le fond d'écran, c'est un gconf-magic;)) et ce thread pour écrire le texte à l'aide d'imagemagick.

Quelque chose comme ça:

#!/bin/bash convert -font "./verdana.ttf" -fill "#101411" -pointsize 33 -gravity "West" -draw "text 1,0 'foobar'" bg.png text.png gconftool -t str -s /desktop/gnome/background/picture_filename text.png 

Ici, nous allons, une «création complète d'un fond d'écran avec une citation aléatoire sur elle», qui pourrait même être modifiée pour «choisir un fond d'écran aléatoire pour imprimer un devis aléatoire sur elle». 😉

Utilisation: il suffit de regarder la section conf. S'amuser!

 #!/bin/bash # This is a script which prints random quotes (gathered from files) on to # a defined wallpaper. # Some ideas are coming from the xplanet-script located at: http://rbrusu.com/xplanet-desktop-wallpape.html # Written by Robert 'Bobby' Zenz ([email protected]) # Written for UK at Superuser.com # Config-Section # -------------- quote=~/quotes.txt # Set this to a folder, for picking random files, or set # set it to a file, to pick random lines wallpaper=~/wallpapers/ # Set it to a fixed wallpaper, or to a folder to pick # a random one inside that tempPic=tempWall.png # The name of the temporary file textSize=33 # The size of the text textColor="#555555" # The color of the text (watch the quotation marks!) sleep=3m # Set how long the script will pause before # picking a new wallpaper/quote #--------------- # Global variable, please ignore this... pickedFile=GlobalyDefined pickedQuote=GlobalyDefined pickedWallpaper=GlobalyDefined function getRandomLine { pickedQuote=$(shuf -n 1 $1) } function getRandomFile { cd $1 set -- * length=$# random_num=$(( $RANDOM % ($length + 1) )) pickedFile=${!random_num} while [ ! -e $pickedFile ]; do pickedFile=${!random_num} done pickedFile=$(pwd)/$pickedFile cd - } function main { if [ -d $quote ]; then getRandomFile $quote pickedQuote=$(cat $pickedFile) fi if [ -f $quote ]; then getRandomLine $quote fi if [ -d $wallpaper ]; then getRandomFile $wallpaper pickedWallpaper=$pickedFile fi if [ -f $wallpaper ]; then pickedWallpaper=$wallpaper fi convert -fill "$textColor" -pointsize $textSize -gravity "Center" -draw "text 1,0 '$pickedQuote'" $pickedWallpaper $tempPic gconftool -t str -s /desktop/gnome/background/picture_filename $tempPic sleep $sleep exec $0 } main 

Ce script possède maintenant une maison chez GitHub .