You are not logged in.

#1 2013-02-01 14:07:42

ThunderRush
Member
From: Austria
Registered: 2013-01-31
Posts: 22

Change Background per Script

I've got yet another problem. I want to write a script that changes my background each time a given timespan runs out.
I use gsetting to change it. Strange thing is, outside of the script it works fine with...

gsettings set org.gnome.desktop.background picture-uri "file:///home/thunderuser/Wallpaper/Applejack - Silhouette.png"

... but in the Script, Gnome seems to go to sleep or drink some beer or whatever. Point is, it does not do what it should. Here is the script.

  1 #!/bin/bash
  2 
  3 #set -o errexit
  4 
  5 TIMEOUT=10
  6 BGDIR=/home/thunderuser/Wallpaper
  7 
  8 while :
  9 do
 10     for f in $BGDIR/*
 11     do
 12         echo "$f"
 13         gsettings set org.gnome.desktop.background picture-uri "file//$f"
 14         sleep $TIMEOUT
 15     done
 16 done

Thanks in advance.

Offline

#2 2013-02-01 14:20:02

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,805
Website

Re: Change Background per Script

file:// != file//  You're missing a colon.

Last edited by Trilby (2013-02-01 14:22:01)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#3 2013-02-01 18:36:29

ThunderRush
Member
From: Austria
Registered: 2013-01-31
Posts: 22

Re: Change Background per Script

Trilby wrote:

file:// != file//  You're missing a colon.

Wow. I will kill myself right now. That is really, really emberrasing. I even looked up the dconf-edior and should have noticed the :
Thank you very much, it works like a charm now.

Offline

Board footer

Powered by FluxBB