Bing imagen del día como fondo de escritorio?


28

¿Alguien puede ayudarme a hacer Bing Picture en mi fondo de escritorio?

  • Entonces funciona descargando la más alta calidad de la imagen de hoy.
  • Luego, almacénelo ex en la carpeta Imagen de su cuenta.
  • Después de eso, cambia automáticamente la imagen en sí.
  • Debe continuar igual todos los días sin problemas en el fondo.
  • Probablemente algo que tengo que agregar en las aplicaciones de inicio.
  • ¿Alguna diferencia entre las versiones de Ubuntu?

-¿Tengo que escribir un guión? ¡Esto sería apreciado por muchos otros también! Gracias de antemano :)


incluso me encantaría usar esto, pero creo que no es posible ..
Sukupa91

thejandroman.github.io/bing-wallpaper ¿resuelve esto? Yo personalmente no usé esto.
nitishch

He probado el enlace anterior anteriormente con sus instrucciones, desde github, @nitish. Pero no funcionó, así que estoy tratando de encontrar otras soluciones. Recibí un error sobre la falla de conexión a los servidores GitHubs. Las instrucciones no eran fáciles de seguir. OMGUbuntu también tiene un HowTo, pero incluso ese también falló ...
Amir Shahab

Respuestas:


21

Probablemente lo más fácil sería instalar variedad . Es un administrador de papel tapiz que realmente hace un excelente trabajo para cambiar su fondo de pantalla con la frecuencia que desee.

Estas son algunas de sus configuraciones:

  • la frecuencia de la descarga
  • la frecuencia de cambiar la imagen (una vez al día, en cada reinicio, cada minuto, ...)
  • desde donde desea descargar sus imágenes
  • donde desea almacenarlos en su computadora
  • citas (ya sea automáticamente o de una fuente)
  • Un bonito reloj.

También hay una configuración para ejecutarlo al iniciar sesión. Si habilita eso y luego agrega su imagen de bing de la url del día ( http://www.bing.com/images/search?q=picture+of+the+day&qpvt=picture+of+the+day&FORM=IGRE?), Ya está todo listo.

Se puede encontrar en el centro de software y tiene una calificación de 5 *.

Aquí hay algunas capturas de pantalla:

ingrese la descripción de la imagen aquí ingrese la descripción de la imagen aquí ingrese la descripción de la imagen aquí


1
La variedad no existe en 14.04.
Agoston Horvath

Encontré estas instrucciones para instalar Variety en 14.04 peterlevi.com/variety/how-to-install
Doug T.

Está disponible el 16.04, aunque hecho con GTK funciona muy bien con KDE.
Kwaadpepper el

Variety ahora tiene una opción incorporada para seleccionar Bing Photo of the Day también.
Sandeep C

15

Escribí un pequeño script de nodo que hace exactamente eso: https://github.com/dorian-marchal/bing-daily-wallpaper

Para instalarlo, necesitará nodejs:

sudo apt-get install nodejs npm

Instalación:

En la línea de comando, ejecute:

sudo npm install -g bing-daily-wallpaper

Uso:

Para cambiar el fondo de pantalla, haga (puede agregar este comando a sus aplicaciones de inicio):

bing-daily-wallpaper

Bien, esa es una solución fácil que funciona para mí en Ubuntu 15
Jon Onstott

Seguí los pasos anteriores, pero aparece un error de uso paper96@localhost:~$ bing-daily-wallpaper /usr/bin/env: ‘node’: No such file or directory @ Dorian, ¿puedes decirme qué pasa?
Pankaj Gautam

@PankajGautam su porque en las últimas versiones de Ubuntu cuando lo hace apt-get install nodejsel ejecutable de nodo es, en realidad nodejs, no nodepor lo que si se edita el guión sudo vim /usr/local/bin/bing-daily-wallpaperque puede sustituir a la primera línea nodecon nodejsy funciona bien.
0x7c0

8

Hace algún tiempo encontré el siguiente script (no recuerdo exactamente dónde en este momento, pero cuando lo encuentre, también agregaré la fuente) cuál cambié un poco y que funciona muy bien para lo que me preguntaron si es establecer como un trabajo cron (vea aquí cómo hacerlo):

#!/bin/bash

# export DBUS_SESSION_BUS_ADDRESS environment variable useful when the script is set as a cron job
PID=$(pgrep gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)


# $bing is needed to form the fully qualified URL for
# the Bing pic of the day
bing="www.bing.com"

# $xmlURL is needed to get the xml data from which
# the relative URL for the Bing pic of the day is extracted
#
# The mkt parameter determines which Bing market you would like to
# obtain your images from.
# Valid values are: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA.
#
# The idx parameter determines where to start from. 0 is the current day,
# 1 the previous day, etc.
xmlURL="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=1&n=1&mkt=en-US"

# $saveDir is used to set the location where Bing pics of the day
# are stored.  $HOME holds the path of the current user's home directory
saveDir="$HOME/Pictures/BingDesktopImages/"

# Create saveDir if it does not already exist
mkdir -p $saveDir

# Set picture options
# Valid options are: none,wallpaper,centered,scaled,stretched,zoom,spanned
picOpts="zoom"

# The desired Bing picture resolution to download
# Valid options: "_1024x768" "_1280x720" "_1366x768" "_1920x1200"
desiredPicRes="_1366x768"

# The file extension for the Bing pic
picExt=".jpg"

# Extract the relative URL of the Bing pic of the day from
# the XML data retrieved from xmlURL, form the fully qualified
# URL for the pic of the day, and store it in $picURL

# Form the URL for the desired pic resolution
desiredPicURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "<urlBase>(.*)</urlBase>" | cut -d ">" -f 2 | cut -d "<" -f 1)$desiredPicRes$picExt

# Form the URL for the default pic resolution
defaultPicURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "<url>(.*)</url>" | cut -d ">" -f 2 | cut -d "<" -f 1)

# $picName contains the filename of the Bing pic of the day

# Attempt to download the desired image resolution. If it doesn't
# exist then download the default image resolution
if wget --quiet --spider "$desiredPicURL"
then

    # Set picName to the desired picName
    picName=${desiredPicURL##*/}
    # Download the Bing pic of the day at desired resolution
    curl -s -o $saveDir$picName $desiredPicURL
else
    # Set picName to the default picName
    picName=${defaultPicURL##*/}
    # Download the Bing pic of the day at default resolution
    curl -s -o $saveDir$picName $defaultPicURL
fi

# Set the GNOME3 wallpaper
gsettings set org.gnome.desktop.background picture-uri "file://$saveDir$picName"

# Set the GNOME 3 wallpaper picture options
gsettings set org.gnome.desktop.background picture-options $picOpts

# Remove pictures older than 30 days
#find $saveDir -atime 30 -delete

# Exit the script
exit

¿Dónde agregar ese enlace de la imagen del día?
Speedox

@speedox No puedo entender tu pregunta ...
Radu Rădeanu

3

Aquí se enumera un buen script que todavía funciona bien en Ubuntu 14.04 (necesita curl instalado):

http://ubuntuforums.org/showthread.php?t=2074098

y copiaré la última versión aquí:

#!/bin/bash

# $bing is needed to form the fully qualified URL for
# the Bing pic of the day
bing="www.bing.com"

# $xmlURL is needed to get the xml data from which
# the relative URL for the Bing pic of the day is extracted
#
# The mkt parameter determines which Bing market you would like to
# obtain your images from.
# Valid values are: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA.
#
# The idx parameter determines where to start from. 0 is the current day,
# 1 the previous day, etc.
xmlURL="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=en-US"

# $saveDir is used to set the location where Bing pics of the day
# are stored.  $HOME holds the path of the current user's home directory
saveDir=$HOME'/Pictures/BingDesktopImages/'

# Create saveDir if it does not already exist
mkdir -p $saveDir

# Set picture options
# Valid options are: none,wallpaper,centered,scaled,stretched,zoom,spanned
picOpts="zoom"

# The desired Bing picture resolution to download
# Valid options: "_1024x768" "_1280x720" "_1366x768" "_1920x1200"
desiredPicRes="_1920x1200"

# The file extension for the Bing pic
picExt=".jpg"

# Extract the relative URL of the Bing pic of the day from
# the XML data retrieved from xmlURL, form the fully qualified
# URL for the pic of the day, and store it in $picURL

# Form the URL for the desired pic resolution
desiredPicURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "<urlBase>(.*)</urlBase>" | cut -d ">" -f 2 | cut -d "<" -f 1)$desiredPicRes$picExt

# Form the URL for the default pic resolution
defaultPicURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "<url>(.*)</url>" | cut -d ">" -f 2 | cut -d "<" -f 1)

# $picName contains the filename of the Bing pic of the day

# Attempt to download the desired image resolution. If it doesn't
# exist then download the default image resolution
if wget --quiet --spider "$desiredPicURL"
then

    # Set picName to the desired picName
    picName=${desiredPicURL##*/}
    # Download the Bing pic of the day at desired resolution
    curl -s -o $saveDir$picName $desiredPicURL
else
    # Set picName to the default picName
    picName=${defaultPicURL##*/}
    # Download the Bing pic of the day at default resolution
    curl -s -o $saveDir$picName $defaultPicURL
fi

# Set the GNOME3 wallpaper
DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-uri '"file://'$saveDir$picName'"'

# Set the GNOME 3 wallpaper picture options
DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-options $picOpts

# Exit the script
exit

2

Revisé esto por un tiempo y parece estar funcionando.

#!/bin/bash
cd 
rm ./dodo.html
wget --no-proxy --output-document=dodo.html http://www.bing.com
rm ./dwallpaper.jpg
wget --no-proxy --output-document=dwallpaper `sed -n "s/^.*g_img *= *{ *url:'\([^']*\)'.*$/\1/p" < dodo.html | sed 's/^&quot;\(.*\)&quot;$/\1/' | sed 's/^\/\(.*\)/http:\/\/www.bing.com\/\1/'`
rm ./dodo.html
gsettings set org.gnome.desktop.background picture-uri 'file:///home/YourName/dwallpaper'

Si trabaja con proxy, elimine --no-proxyde la línea 4 y 6 y, en lugar de YourName, coloque el nombre de su carpeta de inicio.

Guarde esto como una secuencia de comandos, hágalo ejecutable y luego ejecútelo cuando desee que se actualice el fondo de pantalla.

No sé cómo ejecutar esto de manera segura al inicio. Agregando a esto rc.localno es seguro ya que entiendo de esto .

Por favor comente si algo sale mal.


Si el script está funcionando (no probado), puede ejecutarlo una vez al día (o cuando lo desee) usando un trabajo cron. Mira por ejemplo en askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job
Rmano

Creo que sería innecesario ejecutarlo más de una vez al día. Además, en un día, se ejecutará solo una vez cuando se establezca una conexión a Internet. ¿Pueden los trabajos cron hacer eso? ¿Podemos saber cuándo se realiza una conexión?
nitishch

todos los trabajos de verificar la conexión a Internet, descargar la imagen, configurar el fondo del escritorio y crear un registro para indicar si el trabajo del día está pendiente o completo debe ser manejado por su script; mientras que cron se encargará de llamar a la secuencia de comandos según su necesidad ..
precisa

Para una mejor portabilidad, reemplace la última línea ( gsettings set org.gnome.desktop.background picture-uri 'file:///home/YourName/dwallpaper') con gsettings set org.gnome.desktop.background picture-uri ` echo "'file:///home/$USER/dwallpaper'" `
totti

2

Aquí está mi herramienta para descargar los fondos de pantalla más nuevos de Bing y configurarlo como fondo de escritorio. Puede consultarlo https://github.com/bachvtuan/Bing-Linux-Wallpaper


Por favor, incluya al menos instrucciones de instalación y uso en la respuesta.
muru

@ParanoidPanda Ese es el enlace a la página de origen. Si muere, entonces esta respuesta sería nula de todos modos.
Sparhawk

0

Busqué la respuesta pero no la encontré, así que escribí un guión para configurar el fondo de pantalla de Bing. Aquí está el guión ...

#! / bin / sh

ping -q -c5 bing.com

si [$? -eq 0]

luego

wget "http://www.bing.com/HPImageArchive.aspx?format=rss&idx=0&n=1&mkt=en-US" -O bing.txt
img_result = $ (grep -o 'src = "[^"] * "' bing.txt | grep -o '/.*.jpg')
wget "http://www.bing.com" $ img_result
img_name = $ (grep -o 'src = "[^"] * "' bing.txt | grep -o '[^ /] *. jpg')
pwdPath = $ (pwd)
picPath = "/ inicio / SU NOMBRE DE USUARIO / Imágenes / Fondos de pantalla"
cp $ pwdPath "/" $ img_name $ picPath
gsettings set org.gnome.desktop.background picture-uri "archivo: //" $ picPath "/" $ img_name

dormir 10
rm $ img_name
rm bing.txt 
fi
Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.