Script para Trocar Wallpapper Gnome 3

1 – Crie o arquivo change-wallpapper.sh

#!/bin/bash

# As duas linhas abaixo so servem para o script funcionar no cron
SESSIONFILE=$( find "$HOME/.dbus/session-bus/" -type f )
export $( grep "DBUS_SESSION_BUS_ADDRESS" "$SESSIONFILE" | sed '/^#/d' )

WALLPAPPER_DIR=$HOME/wallpapper
GET_WALLPAPPER=$( ls $WALLPAPPER_DIR | shuf -n1 )

gsettings set org.gnome.desktop.background picture-uri "file://$WALLPAPPER_DIR/$GET_WALLPAPPER"

2 – Com o comando “crontab -e” adicione a seguinte linha no crontab do usuário para trocar o wallpapper a cada 3 minutos

0-59/3 * * * * /usr/local/bin/change-wallpapper.sh
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s