How to randomly change wallpaper in Awesome 3.5?

Hello there,
Sorry this may be a noob question.
In the rc.lua file of Awesome 3.5, the wallpaper is set like this.
for s = 1, screen.count() do
gears.wallpaper.maximized("Your wallpaper here", s, true)
end
How would I go about making this randomly choose wallpapers from a directory?
Thanks

I hope this isn't resurrecting a dead thread, but I wrote an almost purely lua version (with ls and grep) based off of these comments, stackoverflow for scandir in lua, and the awesome wiki's 3.4 wallpaper changer.
-- {{{ Random Wallpapers
-- Get the list of files from a directory. Must be all images or folders and non-empty.
function scanDir(directory)
local i, fileList, popen = 0, {}, io.popen
for filename in popen([[find "]] ..directory.. [[" -type f]]):lines() do
i = i + 1
fileList[i] = filename
end
return fileList
end
wallpaperList = scanDir("/home/david/Images/Wallpaper SFW")
-- Apply a random wallpaper on startup.
gears.wallpaper.maximized(wallpaperList[math.random(1, #wallpaperList)], s, true)
-- Apply a random wallpaper every changeTime seconds.
changeTime = 600
wallpaperTimer = timer { timeout = changeTime }
wallpaperTimer:connect_signal("timeout", function()
gears.wallpaper.maximized(wallpaperList[math.random(1, #wallpaperList)], s, true)
-- stop the timer (we don't need multiple instances running at the same time)
wallpaperTimer:stop()
--restart the timer
wallpaperTimer.timeout = changeTime
wallpaperTimer:start()
end)
-- initial start when rc.lua is first run
wallpaperTimer:start()
Last edited by teratomata (2013-03-14 05:28:17)

Similar Messages

  • How do I change wallpaper back to original on iPad 2, How do I change wallpaper back to original on iPad 2, How do I change wallpaper back to original on iPad 2

    How do I change wallpaper back to original bubbles?

    Go to Settings > Brightness & Wallpaper > Wallpaper > Wallpaper then choose the original wallpaper.

  • How to randomly change an image upon refresh?

    Hello, I just started my website and i was wondering if it is possible to randomly change an image upon reloading the page? I can't really find the answer anywhere and the widget confuses me.. anyone knows the answer to this one?

    it can be done with javascript and cookie.
    q: how are you with javascript?
    http://www.cyclosaurus.com/iWeb2/Welcome.html
    background will change when you refresh the page.

  • How do i change wallpaper with ios7

    how do i change wall paper with ios7

    Settings > Wallpapers & Brightness, and then you have to tap the default wallpaper at the lower left side of the page.  That takes you to another level and you can tap for more optional papers or tap your photo albums to select a photo for wallpaper.
    It takes some playing around but try taping and then when you get a larger selection you can swipe through.

  • How do I change wallpaper on new iPad

    Trying to change the wallpaper on my new iPad, I go to wallpaper and brightness but there is no option to use saved photos.  What am I missing

    To change the wallpaper on your iPad follow the instructions in this post http://www.efrennolasco.com/how-to-change-wallpaper-on-iphone-ipad-and-ipad-mini /
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.  <Edited by Host>

  • HOW DO I CHANGE WALLPAPER?

    Please tell me the steps to change my wallpaper.

    Wallpaper (aka desktop background) is part of the Windows operating system, not Firefox related.
    https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/display_change_desktop_background.mspx

  • How do I stop DW CS6 randomly changing file permissions via FTP?

    How do I stop Dreamweaver CS6 12.0.1.5842 randomly changing file permissions when it uploads files to my web server via FTP.
    I can no longer trust Dreamweaver to upload websites correctly as it changes permissions on some files which then deny the server access to the file which in turn makes the webpage unreachable/return a 403 error.
    This is driving me insane.
    I'm using an early 2011 Macbook Pro 10.7.5.

    Hi,
    I'm having this problem too. Has Adobe fixed the issue yet? This appears to be an Adobe problem, not all the web hosts out there. CS6 is ramdomly (meaning: not every time) changing permissions on files uploaded with it and is not usable for web work until this problem is fixed by Adobe or a solution is provided. If I wanted to use a separate FTP program I would not have recommended that my employer buy multiple Adobe CS6 product licenses. One of the primary appeals of DW is the integration of FTP into the workflow.
    I am using a destop iMac2.8 GHz Intel Core 2 Duo, 4 gigs of 800 MHz DDR2 SDRAM.
    OSX 10.7.5
    I am using DW Version 12 Build: 5808
    Dreamweaver CS4 that I was using until this new purchase was working just fine. No file permisssion changes. I am being forced to go back to using it until Adobe posts a fix for this.
    I should ask while I'm here: has anyone found a solution for this yet?
    Thanks,
    -c-

  • When i have my bluetooth connected in my car my iphone is listed as a random name. How do I change it

    When my phone is connected to Bluetooth in my car it is listed as a completely random name. How do I change the name of my phone?

    Make sure you setup iCloud correctly >  Apple - iCloud - Learn how to set up iCloud on all your devices

  • "Awesome Bar" uses Bing search. How do I change it to Google search?

    Though the Help files says that the "Awesome Bar" uses Google search, it is actually using Bing. I want it to use Google. How can I change it. Please note that I am talking about the "Awesome Bar" a.k.a. Address bar - not the Search Bar. Thanks.

    Did you or do you have a "Community Toolbar" installed? Your address bar search runs through Conduit, which is the company behind most of those toolbars.
    To reset your search to Google, the simplest method is an add-on, but you also can do it manually.
    * [https://addons.mozilla.org/en-US/firefox/addon/searchreset/]
    * [[Search the web from the Address Bar]] - see "Changing the Internet Keyword service"
    Any luck?

  • How do I change the wallpaper around the address bar?

    I customized the wallpaper around the address bar through a pop up advertisement. The option disappeared after posting a picture. It is too bright. How do I change it?

    Ahh. The issue is the system perrefences -> Wallpaper screen came up behind an open app on the second screen and therefore I didn't see it.
    Thanks Mr. Vortex!
    P

  • How do i change my wallpaper to black?

    How do i change my wallpaper to black like it shows on some of the boxes ive seen before?

    I downloaded a black jpg on my desktop and tried to drag it into the iphone but it wouldnt work. How do i get it on the iphone and once i have it there how do i make it my wallpaper.

  • How do I change the image used on an movie project icon? iMovie seems to select an image at random from the images I imported.

    How do I change the image used on an movie project icon?
    iMovie seems to select an image at random from the images I imported.

    Not sure I understand how to use what you have posted. Here's what my init() looks like:
    public void init()
    setLayout(new BorderLayout());
    p=new Panel();
    p.setLayout(new GridLayout(1,1));
    callnowButtonURL = getURL(callnowButtonFilename);
    if (callnowButtonURL != null)
    callIcon = new ImageIcon(callnowButtonURL,"call");
    endcallButtonURL = getURL(endcallButtonFilename);
    if (endcallButtonURL != null)
    endIcon = new ImageIcon(endcallButtonURL);
    b=new JButton(callIcon);
    b.setBorder(new EmptyBorder(0,0,0,0));
    b.setBorderPainted(false);
    b.addActionListener(this);
    p.add(b);
    add(p,"Center");
    Now the ActionListener is basically:
    public void actionPerformed(ActionEvent e)
    if (mybool == false)
    <Perform actions here set mybool to true>
    Change JButton b to use EndIcon
    else
    <Perform actions here set mybool to false>
    Change JButton b to use CallIcon
    Can you clarify how to perform the action I require? You can have a couple of Dukes if you can help me sort this out.

  • HOW 2 CHANGE WALLPAPER @ A ZE

    Hi i just bought a Zen V ( IT RUUULLLEEEZZZ) , but the only thing i want 2 know is how i can change my wallpaper i cant find that anywhere. thx a lot

    got it

  • How Do I change color randomly of a MovieClip in a Timer event?

    I have created a MovieClip named "Target" and called it from actionscript. Inside this movie clip I have created an 'action' layer and written the code in it:
    import fl.motion.Animator;
    import fl.motion.MotionEvent;
    var this_xml:XML = <Motion duration="30" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
        <source>
            <Source frameRate="12" x="202" y="169.15" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="Target">
                <dimensions>
                    <geom:Rectangle left="-32.05" top="-30.85" width="64.05" height="61.7"/>
                </dimensions>
                <transformationPoint>
                    <geom:Point x="0.5003903200624512" y="0.5"/>
                </transformationPoint>
            </Source>
        </source>
        <Keyframe index="0" tweenSnap="true" tweenSync="true">
            <tweens>
                <SimpleEase ease="0"/>
            </tweens>
        </Keyframe>
        <Keyframe index="29" scaleX="2.096" scaleY="2.096"/>
    </Motion>;
    var this_animator:Animator = new Animator(this_xml, this);
    this_animator.play();
    this_animator.addEventListener(MotionEvent.MOTION_END, removeTarget);
    function removeTarget(event:MotionEvent):void
        this.parent.removeChild(this);
    In the main timeline I also have created another 'action' layer and written the code like this:
    var timer:Timer;
    var targetCount:uint;
    var container:MovieClip;
    function initGame():void
        container = new MovieClip();
        addChild(container);
        targetCount = 10;
        timer = new Timer(1000, targetCount);
        timer.addEventListener(TimerEvent.TIMER, generateTarget);
        timer.start();
    function generateTarget(event:TimerEvent):void
        var target:MovieClip = new Target();
         target.x = Math.random() * stage.stageWidth;
        target.y = Math.random() * stage.stageHeight;
        container.addChild(target);
    initGame();
    Now I can get 10 animating circles in different places of the stage after every second. And every circles will leave the stage after completing the animation. Though I have given 'pink' color in that circle, that's why its generating with 'pink' color always. How do I change the color of each circle while it will generate?
    Regards
    Dipesh Pal.

    I have tried in this way......
    function generateTarget(event:TimerEvent):void
        var target:MovieClip = new Target();
        var colorT:ColorTransform = new ColorTransform();
        colorT.redOffset = Math.round(Math.random() * 510) - 255;
        colorT.greenOffset = Math.round(Math.random() * 510) - 255;
        target.transform.colorTransform = colorT;
        target.x = Math.random() * stage.stageWidth;
        target.y = Math.random() * stage.stageHeight;
        container.addChild(target);
    but its not working......
    infact i have used function 'circleColor' which holds this random color transform.... and call that function from 'generateTarget' function also....but it doesnt work too...
    then how do I change the color of every circle which is randomly generating in the stage....?

  • Wallpaper randomly changes to blue

    Occasionly the wallpaper on my windows xp laptop randomly changes to solid blue. If I go into display properties, all the options are still there but the wallpaper will not change if I select an other one. This is surprising as I recently re-installed windows!
    Does anyone have any suggestions? Thankyou.

    Yes, I used the supplied media in order to restore it. I have a Toshiba Sattelite Pro M70, with the Intel 915GM chipset. Thankyou for your reply, but I think I may have found the source of the problem, it seems to only occur when I set a wallpaper using windows live photo gallery.

Maybe you are looking for

  • Can 2 Macs connect with ethernet cable to share DVD for remote install?

    Can I simply connect a Mac Mini Server and MacBook together with an ethernet cable? I want to reinstall Mac OS X Server on the DVDless Mac Mini. There is no separate AirPort device. So do I just connect the two machines with an ethernet cable, start

  • Setting default value in dynamic drop-down menu

    Hi, I created a simple drop-down menu that can be used to edit an existing record or to create a new record. When creating a new record, I'd like the drop-down menu to display "Not specified" by default. Could anyone help me with this? The "Not speci

  • IP address not showing when creating Network Session

    Hi, Odd one here. I have been having issues with CoreMIDI lately. To try to rectify I deleted my existing Network Session 1 from the Network applet in the Audio MIDI app. This has been working fine with lots of iPad based synths except for one app (V

  • Issue with BCM 7.0 VU_Website

    Hi Experts, We installed BCM 7.0 SP2 on win 2008, SQL 2008 (single server with 1 Physical and 5 Virtual IP's). Create a HAC Node and added VU's on each Virtual IP. VU_Website getting issue when assigned to one IP. the ip is going down, it is not turn

  • HT5569 After upgrade to i0s7, cannt connect to home WiFi

    Hi, I just upgraded to i0s7 on my iPhone 4 and suddenly cant connect to my home WiFi.  have done all the basic troubleshooting steps including resetting network settings on my phone. Any input would be appreciated. Thanks! Brian