How to call a repetitive script in .profile

Forum rules
Before you post please read how to get help

How to call a repetitive script in .profile

Postby Stewbond on Thu Feb 07, 2013 3:34 am

I have written a script to change my wallpaper every 10 min.

wallppr.sh:
Code: Select all
#!/bin/bash
pic=(/home/user/Pictures/Wallpapers/*)
gsettings set org.gnome.desktop.background picture-uri \
         "file://${pic[RANDOM % ${#pic[@]}]}"


Then to call it repetitively:
wallChanger.sh:
Code: Select all
#!/bin/bash
watch -n 10 wallppr.sh


Calling wallChanger.sh from a terminal is no problem. However, when I put it into ~/.profile I don't see the effects of the script when I log in. I assume that I need to run this in a new thread or something, but how?
Stewbond
Level 1
Level 1
 
Posts: 44
Joined: Sun Feb 03, 2013 9:01 am

Linux Mint is funded by ads and donations.
 

Re: How to call a repetitive script in .profile

Postby karlchen on Thu Feb 07, 2013 4:40 am

Hello, Stewbond.

I guess you will hve to make your script wallChanger.sh another startup application so that it gets loaded after you have logged on to the graphical user environment (Mate, Cinnamon, xfce, KDE, whichever you are using).

You can do so by launching "Startup Programmes" from the menu (Menu => Preferences => Startup Progams on Cinnamon e.g.), clicking on [Add], selecting your script and clicking [Apply].

As you want to change your wallpaper periodically, however, I would rather check whether the desktop environment which you are using does offer a built-in function to change wallpapers periodically out of the box.

HTH,
Karl
User avatar
karlchen
Level 12
Level 12
 
Posts: 4141
Joined: Sat Dec 31, 2011 7:21 am

Re: How to call a repetitive script in .profile

Postby Stewbond on Thu Feb 07, 2013 1:06 pm

karlchen wrote:Hello, Stewbond.

I guess you will hve to make your script wallChanger.sh another startup application so that it gets loaded after you have logged on to the graphical user environment (Mate, Cinnamon, xfce, KDE, whichever you are using).

You can do so by launching "Startup Programmes" from the menu (Menu => Preferences => Startup Progams on Cinnamon e.g.), clicking on [Add], selecting your script and clicking [Apply].

As you want to change your wallpaper periodically, however, I would rather check whether the desktop environment which you are using does offer a built-in function to change wallpapers periodically out of the box.

HTH,
Karl


Great idea Karl. I'm playing with it now. Hopefully I'll get some good results.

Cheers
Stewbond
Level 1
Level 1
 
Posts: 44
Joined: Sun Feb 03, 2013 9:01 am


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 0 guests