Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 63

Thread: HOWTO: Finally! How to easily change your desktop to a random file at specified times

  1. #41
    Join Date
    Jul 2005
    Beans
    740
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    which version are you using as there have been a few modifications in this thread

  2. #42
    Join Date
    Sep 2008
    Beans
    3

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    ubuntu version 8.10, first version of coding(post 1) - nt sure on what u mean by which version

  3. #43
    Join Date
    Jul 2005
    Beans
    740
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    ok there are other few modifications of the scripts in later posts, including one by me.

  4. #44
    Join Date
    Sep 2008
    Beans
    3

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    my problem seems to be with the timer as it changes on reboot an i can change it manually

  5. #45
    Join Date
    Jul 2006
    Beans
    3

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    I just switched back to Gnome from XFCE, and found myself sorely missing the random wallpapers function on a timer that displays a unique wallpaper on each monitor. So I wrote a perl script to do it for me. I have posted it at http://lotech.org/code/random_wallpaper.pl.html if you're interested.

  6. #46
    Join Date
    Feb 2007
    Location
    Everywhere
    Beans
    1,529
    Distro
    Ubuntu Development Release

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    Here's a script that can search recursively through sub-folders ...
    Code:
    #!/bin/bash
    
    folder="pictures"
    
    cd $HOME/$folder
    files=(`find * | grep -i "\.jpg$\|\.gif$\|\.png$\|\.bmp$"`)
    
    # Get the size of the array
    n=${#files[@]}
    # Prevent a blank screen if there are no pictures
    if [ $n -eq 0 ]; then exit 1; fi
    
    # Set a random wallpaper with gconftool-2
    gconftool-2 -t str --set /desktop/gnome/background/picture_filename "$HOME/$folder/${files[RANDOM%n]}"
    
    exit 0
    ... but perhaps someone can tell me why it has problems with spaces in filenames?
    "Knowledge is power. Who said that?" - Dave Lister

  7. #47
    Join Date
    Feb 2007
    Location
    Everywhere
    Beans
    1,529
    Distro
    Ubuntu Development Release

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    Ok. I solved the problem with spaces in the filename.
    Code:
    #!/bin/bash
    
    files=(`find $HOME/pictures | grep -i "\.jpg$\|\.gif$\|\.png$\|\.bmp$" | tr ' ' '¿'`)
    
    # Set a random wallpaper with gconftool-2
    gconftool-2 -t str --set /desktop/gnome/background/picture_filename "`echo ${files[RANDOM%${#files[@]}]} | tr '¿' ' '`"
    
    exit 0
    2 lines of code! I added "tr ' ' '¿'" to change spaces to another character (¿), which is very unlikely to be found in a filename. It then gets changed back to a space when setting the background.
    "Knowledge is power. Who said that?" - Dave Lister

  8. #48
    Join Date
    Apr 2009
    Beans
    1

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    Dude,there is something wrong with my pc cant get through with the administrator!i think i am being hacked cos when i pay my monthly bill other name appear on list and it was not my computer's name.when I log in to my pc there are two user's and i cannot log in to my account cos it needs a password.they say reformat is the best solution so I try but it's still there!now I am using other account without password and the name of the account is KAMANDAG...anyone,please help me!i try the how to but it wont work,it say that is not recognized as an internal or external command,operable program or batch file...I am suffering this situation for already two Fu***&&& months...please help! tnxz...you guys rock

  9. #49
    Join Date
    Apr 2009
    Beans
    28

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    wow... pretty impresive! man... i wanna get unbuntu just for this kind of stuff!

  10. #50
    Join Date
    Jan 2008
    Beans
    345

    Re: HOWTO: Finally! How to easily change your desktop to a random file at specified t

    Niicodemus -

    This perl script looks to be exactly what I am looking for. I have dual monitors and would like a different wallpaper on each monitor. I downloaded your script and gave it a try but have some syntax errors.

    I edited two of the Options section as follows:

    Code:
    my @screens = (
      ['1280', '1024'], # Left monitor
      ['1280', '1024'], # Right monitor
    );
    Code:
    my @wallpaper_dirs = (
      '/home/twoblues/Pictures',
    );
    When I run the script I get this:

    Code:
    twoblues@Stealth:~/Documents$ ./random_wallpaper.pl
    syntax error at ./random_wallpaper.pl line 142, near ">"
    syntax error at ./random_wallpaper.pl line 142, near "&lt"
    syntax error at ./random_wallpaper.pl line 142, near "&lt"
    syntax error at ./random_wallpaper.pl line 142, near "$tile_height) "
    syntax error at ./random_wallpaper.pl line 146, near "}"
    syntax error at ./random_wallpaper.pl line 156, near "];"
    syntax error at ./random_wallpaper.pl line 161, near ">"
    syntax error at ./random_wallpaper.pl line 161, near ""${columns}x${rows}")"
    BEGIN not safe after errors--compilation aborted at ./random_wallpaper.pl line 172.
    Since I know about as much about perl as I do about quantum mechanics, I could sure use your help.

    TIA,

    xeddog


    Edit: almost forgot. I don't know if this matters or not, but yesterday I upgraded my Intrepid installation to Jaunty using the upgrade process. I did not try this on Intrepid. I am using Intel 32-bit with an ATI Radeon 9600 graphics card which means that I am having to use the opensource drivers since the ^%$#@ at AMD are dropping support for it.
    Last edited by xeddog; April 24th, 2009 at 08:01 PM. Reason: Additional info

Page 5 of 7 FirstFirst ... 34567 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •