Bash script: Rotate your wallpaper and SLiM theme at the same time

EDIT;
I've decided I should really thank Cerebral for his help with writing this script; this thank you should have been here from the get go.
After writing:
#!/usr/bin
echo "Hello World!"
I wrote a script to rotate my fluxbox background and SLiM theme at the same time, so I could have a contiuously changing background and still have a smooth transition from SLiM to fluxbox.  (It just looks so much cooler when both have matching backgrounds).  By the time you finish reading it, and configuring your box so it will work, you will probably have decided you could have writtin your own, better script to do the same thing.  But, on the off chance anybody finds use for it, here it is:
(this should be obvious, but: don't run this script without at least reading the comments)
#!/bin/bash
#this is a script to rotate a number of backgrounds
#to be shared by the fluxbox desktop and SLiM login manager.
#it is the first meaningful script I've written. It may be
#freely distributed and used with the understanding that you are
#using it at your own risk.
#Before running this script you need to check that your SLiM
#themes are installed to the path /usr/share/slim/themes, which
#is the defulat path for installation in Arch. Here are some
#other things you need to set up:
#1. create (if you don't have it) the directory /usr/share/wallpapers
#2. create a wallpaper in /usr/share/wallpapers called 'dummy' by copying
#you current wallpaper to that filename
#3. set your window manager to display the wallpaper 'dummy', this works fine
#using a style overlay in fluxbox, I haven't tested it with any other window
#manager, but I don't see why this would cause a problem.
#4. create a directory /usr/share/slim/themes/current, you can copy one of
#your slim themes into that directory if you want. (this will prevent you
#from seeing some error messages the first time you run the script)
#5. define the names of the themes you want to rotate, in order for this
#script to work, you must name them "themeNUMBER", where NUMBER is replaced
#by an integer. Your themes must be numbered consecutively, start with 1
# that is:
#theme1 , theme2, theme3, etc. , theme305
#If you don't number consecutively, this script will not run properly. You
#must also define the total number of themes as "rotate_number"
#6. Check if the script runs, if it does, you should change /etc/slim.conf to
#use the theme "current"
#7. This theme will now rotate your SLiM theme and wallpaper in such a way as
#to make them match each other. Note that SLiM will not let you change themes
#"on the fly", (as of July 6, 2008), so changes will not be apparent unless you
#restart SLiM. I run the script before I run slim in my etc/rc.local local
#script, so each time I reboot I get different wallpaper / login background.
#Fred Drueck 2008
#Define here all themes to be rotated and the total number of
#themes to rotate:
rotate_number=9
theme1=/usr/share/slim/themes/default
theme2=/usr/share/slim/themes/lake
theme3=/usr/share/slim/themes/lunar
theme4=/usr/share/slim/themes/flower2
theme5=/usr/share/slim/themes/the-light
theme6=/usr/share/slim/themes/mindlock
theme7=/usr/share/slim/themes/parallel-dimensions
theme8=/usr/share/slim/themes/wave
theme9=/usr/share/slim/themes/fingerprint
#check you are running this script as super-user:
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
echo "rotating themes"
#figure out which theme is currently set, then name it as the variable
#"last theme number", otherwise set last theme number as 0
if [ -f /usr/share/slim/themes/current/current_theme_number ]
then
echo "checking current theme"
cd /usr/share/slim/themes/current/
eval last_theme_number=$(cat /usr/share/slim/themes/current/current_theme_number)
echo $last_theme_number
else
echo "no theme is currently set, using theme 1"
last_theme_number=0
echo $1 > /usr/share/slim/themes/current/current_theme_number
fi
#set the new theme number
eval new_theme_number=$(($(($last_theme_number % $rotate_number))+1))
#select the new theme
placeholder=theme
eval new_theme=\$$placeholder$new_theme_number
echo $new_theme
#now clean out the "current" theme where I keep the current
#theme for slim
rm /usr/share/slim/themes/current/background*
rm /usr/share/slim/themes/current/panel*
rm /usr/share/slim/themes/current/slim.theme
#the wildcards are there since the themes use jpg and png files
cp $new_theme/background* /usr/share/slim/themes/current
cp $new_theme/panel* /usr/share/slim/themes/current
cp $new_theme/slim.theme /usr/share/slim/themes/current
#increase the theme number, but first clear the old file
rm /usr/share/slim/themes/current/current_theme_number
echo $new_theme_number > /usr/share/slim/themes/current/current_theme_number
#copy over the dummy wallpaper in "/usr/share/wallpapers" (with the theme
#background file
cp $new_theme/background* /usr/share/wallpapers/dummy
exit 0
Last edited by pseudonomous (2008-07-07 21:59:42)

oh i forgot to mention... its rotating while moving. i.e. is doesn't have to stop rotate and then continue back to origin.

Similar Messages

  • Can i add two country holiday on my iCal and see them at the same time?

    Can i add two country holiday on my iCal and see them at the same time? HOW?

    Just subscribe to the appropriate calendars: you can subscribe to as many as you like.
    http://www.apple.com/downloads/macosx/calendars/

  • HT1550 I'm having trouble with importing them into iTunes and converting them at the same time. when i hold down option over the files i can't find where its supposed to say create new version. is this if you're in iTunes?

    I'm having trouble with importing them into iTunes and converting them at the same time. when i hold down option over the files i can't find where its supposed to say create new version. is this if you're in iTunes?

    You can't do it in one step. Add to iTunes first, Once the tracks are in iTunes you may convert to a different format.
    tt2

  • IS there a way to load and purchase different photos from iPhoto and ship them at the same time? the only way that I can find is to purchase each photo (or multiple of one) at a time, which increases the cost of shipping, as I want to get one print of 20

    Is there a way to order multiple different prints in any quantity from Iphoto? it appears currently like I would have to ship each separately, even if only one print... is there a way around this so I can can get several DIFFERENT prints of any quantity and ship all at the same time?

    Sure - easiest way is to make an album for photos you want to order and drag photos to it - when it is complete open the album, select all and order
    LN

  • Rotating guns and shooting them at the same time?

    I put the registration point as the gun's arms. So then the gun would rotate from the arms. But then the bullets come out from the registration point as well. So if I make the registration point on the barrel of the gun, the gun would rotate from the barrel and then shoot from the barrel. So I'm a bit confused where is the right place to place the registration point.
    Now what I want would be: Shooting the bullets from the barrel, not the arms. And also rotating by placing an axis on the arms, not the barrel. At the same time.
    I tried tweeking it like, bullet.x = x - 100 to make the bullet placed on the barrel and come out from there, but if i rotate let's say (180 degrees) it shoots from the from x - 100 but then the gun is on the other side, so the bullet wouldn't be coming out from the barrel anymore.
    I also tried tweeking it by adding a movieclip INSIDE the movieclip gun's barrel so the bullets would come from THAT location, but it shot bullets weirdly and not in the right position.
    here is my code, is there any modifications i can put? so it can shoot from the barrel regardless of rotating the gun and changing positions, and also rotate from the arms at the same time? if there is any other solution to tweek it, thanks a lot.
      function initialize(e:Event)
       //add a click listener to the stage
       stage.addEventListener(MouseEvent.CLICK, fire);
      function fire(m:Event)
       //spawn a bullet
       var b = new Bullet;
       //set the position and the rotation of the bullet
       b.rotation = rotation;
       b.x = x;
       b.y = y;
       //add the bullet to the parent object
       parent.addChild(b);
       //play the firing animation
       play();
      function update(e:Event)
       //make the gun face the mouse
       if (parent != null)
        var dx = parent.mouseX - x;
        var dy = parent.mouseY - y;
        var angle = Math.atan2(dy, dx)/Math.PI * 180
        rotation = angle;
    Thank you for reading, sorry if it was long.

    For some reason, the gun's bullets still come out from the registration point. The registration points are on the arms, the gun is facing right and the barrel is at the end of the right.
    But I tried this code but the bullet comes out from the same place of the rotating axis. I tried playing around with the code but no possible solutions.
    Thanks.
    EDIT: Also, if I put
    b.x=platform.x+Math.cos(gun.rotation*Math.PI/180)*gun.length;  // where platform is the parent of the gun (assuming your gun is attached to a platform like a tank).
    b.y=platform.y+Math.sin(gun.rotation*Math.PI/180)*gun.length;
    The bullet comes out from the platform's registration point. If I remove the platform part, it comes out from the gun's reg point.
    Another thing, if I modify it like "length - 100", it will change it's position but won't follow the rotation of the gun like I stated above. If it shoots from a certain location., and then I rotate the gun a certain amount of degrees the bullet will shoot from that side instead of following the gun's barrel.
    So I'm wasn't completely sure on how to fix this. Thanks again.

  • I'd like to sync two videos and edit them at the same time, possible?

    I've recently recorded a conference speaker with a camera and a screen capture of his slides I'd like to import the two video files and sync them together (they received the same audio feed) then perform very basic edits of removing any intro before the speaker and the q&a after his talk. Any tips on making this as easy as possible would be greatly appreciated. I need to have a copy of each video (headshot and screen capture) that is the same length.

    Here is the user manual about creating and editing Multicam clips.
    http://help.apple.com/finalcutpro/mac/10.1/#ver23c76439
    macProVideo.com and Ripple Training have the best online training available.
    http://www.macprovideo.com/finalcut
    http://www.rippletraining.com/categories/apple-pro-apps-tutorials/final-cut-pro- x-tutorials.html
    The "Apple Pro Training Series: Final Cut Pro X 10.1, Professoinal Post Production" book is what we use to teach Apple authorized training, and is really quite good.  It is step-by-step, hands-on training you can't beat.
    http://www.peachpit.com/store/apple-pro-training-series-final-cut-pro-x-10.1-pro fessional-9780321949561
    I've found the Lynda.com FCPX training to be lacking, and it is not kept up to date very well.

  • Why can't I rotate multiple points in puppet warp at the same time?

    You can rotate single points in puppet warp, and you can shift+click to select multiple points and move them at the same time but I see no way to rotate multiple points as one group using puppet warp.  This would be a very helpful feature I think should be added.

    Please post Bug Reports and Feature Requests over at
    http://feedback.photoshop.com/photoshop_family/

  • I recently reset my iPod touch 4th gen. (holding power and home buttons at the same time.)  now it won't let me change my wallpaper, in the photo section or the settings. Any ideas, please? Thanks.

    I recently reset my iPod touch 4th gen. (holding power and home buttons at the same time.)  now it won't let me change my wallpaper, in the photo section or the settings. Any ideas, please? Thanks.

    What happens when you try to change them?
    Try:
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       

  • In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    Sorry, I tried to say your answer solved my question, but I guess I told it that my response to you solved it. Now that I liked it, the solved option doesn't appear.

  • My ipad won't let me sign in to my FaceTime and iMessage and won't update my apps no more ever since I got my iphone and put them on the same account. Does anyone know how to fix it or why it's doing this

    II've had my ipad with retina display for about a 1 now and everything was fine In till I got my iphone 4s and put them on the same account then my ipad stopped letting me log in to my FaceTime and iMessage and it doesn't let me update my apps and dosnt let me log in to iCloud ever since I got my phone and put them on the same account does anyone know how I could fix it and still be able to connected to my iphone??

    Did you change your Apple ID?
    Unable to make or receive FaceTime calls after April 16, 2014
    http://support.apple.com/kb/TS5419
    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime is 'Unable to verify email because it is in use'
    http://support.apple.com/kb/TS3510
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
    Set Up Alert Sounds
    http://www.quepublishing.com/articles/article.aspx?p=1873027&seqNum=3
    Extra FaceTime IDs
    http://tinyurl.com/k683gr4
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Troubleshooting iMessage Issues: Some Useful Tips You Should Try
    http://www.igeeksblog.com/troubleshooting-imessage-issues/
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Fix Can’t Sign Into FaceTime or iMessage iOS 7
    http://ipadtutr.com/fix-login-facetime-imessage-ios-7/
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    iOS 7 allows you to block phone numbers or e-mail addresses from contacting you via the Phone, FaceTime, or Messages
    http://howto.cnet.com/8301-11310_39-57602643-285/you-can-block-people-from-conta cting-you-on-ios-7/
    How to Block Someone on FaceTime
    http://www.ehow.com/how_10033185_block-someone-facetime.html
    My Facetime Doesn't Ring
    https://discussions.apple.com/message/19087457#19087457
    How to watch FaceTime calls on the big screen with Apple TV
    http://www.imore.com/daily-tip-ios-5-airplay-mirroring-facetime
    Send an iMessage as a Text Message Instead with a Quick Tap & Hold
    http://osxdaily.com/2012/11/18/send-imessage-as-text-message/
    To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Text on the iPad
    http://ipad.about.com/od/ipad_tricks/a/How-To-Text-On-The-Ipad.htm
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
    How to Receive SMS Messages on an iPad
    http://yourbusiness.azcentral.com/receive-sms-messages-ipad-16776.html
    Apps for Texting http://appadvice.com/appguides/show/apps-for-texting
    You can check the status of the FaceTime/iMessage servers at this link.
    http://www.apple.com/support/systemstatus/
     Cheers, Tom

  • All of a sudden, my settings have been changed, my homepage, and EVERYTHING. No matter how many times I go in and change them again, the SAME pages open up when I start FireFox and I am constantly being asked if I want Yahoo as my start page and default s

    I don't know what happened. All of a sudden, my settings have been changed, my homepage, and EVERYTHING. No matter how many times I go in and change them again, the SAME pages open up when I start FireFox and I am constantly being asked if I want Yahoo as my start page and default search engine. I click the box 'do not ask me again' and it comes up EVERY TIME. I change things like I don't want history remembered, and when I reload FireFox again, it's back to the way it was BEFORE. EVERY SINGLE TIME. I don't know why this is happening, or how to fix it. What do I do??

    I do not want to download another virus program.. I do not believe it is a virus. I am running the full version of Norton 360 and it is doing a daily scan. I have Windows 7, 64 bit OS.
    This is very irritating !! If I wanted Yahoo I would ask for it !

  • I have family plan of 5 iphones and all them have the same apple id, the q. is how I can set each one with their own apple id? please advise...

    I have family plan of 5 iphones and all them have the same apple id, the q. is how I can set each one with their own apple id? please advise...

    See How to Stop Sharing an Apple ID.
    (Note that I am affiliated with that site, and some pages contain ads).

  • How to record a USB mic and a guitar at the same time?

    I have an Audio-Technia AT-2020 USB mic and an Ovation acoustic/electric guitar. I wanted to record both of them at the same time, so i plugged the mic into the USB port (duh!) and the guitar into the 1/8" port on the computer (with a 1/4" to 1/8" adapter and a male/male headphone cable). However, when i went to select the inputs for the diffrent tracks, it was either one or the other. My question is, do you need an audio interface to be able to do multitrack recording? If so, could I use a USB hub, 1/8" to USB adapter, and plug both the guitar and mic to fool the computer into thinking i have an audio interface? I would rather not spend money on an audio interface ($200) and a new mic ($120) when i already have something that could work!
    Thanks to anyone who can help!

    beberhard14 wrote:
    do you need an audio interface to be able to do multitrack recording?
    create an aggregate device from the mic and line-IN:
    http://www.bulletsandbones.com/GB/Tutorials.html#allaboutaggregatedevices
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Getting Logic master  to send to both 1-2 and 3-4 at the same time

    I have an native Instruments Audio Kontrol 1 'sound card' that I'm running 2 different sets of M-Audio monitors off of. My question i, can I run the master output to both 1-2 and 3-4 at the same time so I can easily check mixes on both sets of speakers without changing every single tracks output?
    Also, is this possible to do in iTunes also? I can find nothing in Logic (or anywhere) that will allow this and I initially thought my device was broken until I simply choose 3-4instead of 1-2.
    thanks so much!

    Pancenter wrote:
    Sampleconstruct wrote:
    In Logic you could just setup additional sends of your Audio tracks using the send knobs and send the signal to a Bus. Set the outputs of that Bus to 3-4 and you'll have your signal played through 1-2 as well as 3-4.
    Also, if any of the audio tracks used sends (reverb on a bus..etc) those would also have to be sent to the same bus as the audio tracks.
    panleft-
    How about routing all the outputs that are currently on Output 1-2 to a bus first then:
    Option 1: Switching that bus's output between outputs 1-2 and 3-4 (for A/B comparisons)
    or
    Option 2: Use the Send on that bus's output to another bus, route that second bus's output to 3-4 (so both busses are sending audio to both sets of speakers simultaneously).
    As an alternative, the Mackie Big Knob is a great hardware solution for routing a signal to 3 sets of speakers, allowing you to switch among them with simple button presses.
    -droo

  • How to transform a layer object and a path at the same time?

    Hi all,
    I know I am going to kick myself when you tell me the answer to this!
    I would really like to know if there is any way I can manage to to transform both a layer object and a path at the same time....or if there is any workaround to achieve this.
    In a nutshell, say for example I spend a VERY long time creating an intricate path around a very detailed object, and then at the very end notice just how crooked and out of perspective it is, and would like to straighten it.
    Of course I could transform and correct the object, and then carefully transform the path - but it just won't be exact, and I will have to spend a long time adjusting the path and making SURE it is perfect.
    Isn't there any way I could get to transform them together?
    Usually of course I do all the correction to straighten and correct perspective beforehand, but in some instances after I am done creating the path I then notice that the image could have used further adjustments.
    I appreciate so very much any advice you may have:)
    Thank you kindly,
    Christine

    Okay...I found another way as well... suddenly it all started coming to me in the last few minutes:)
    Once the image is on it's own layer, then we can select the path and then make a vector mask by going to "Layer>Vector Mask>Current Path". Once the vector mask is created, simply click on the image icon on it's layer, then transform away to your heart's content, and the path is transformed along with it. Once finished, the path for the vector mask can be saved as usual. (Don't click on the vector mask icon when transforming the image, otherwise only the path will be transformed.)

Maybe you are looking for

  • Bluetooth hardware is not recognized in windows vista

    Hi I just installed wvista with boot camp but in the bluetooth settings it does not show any bluetooth hardware therefore I am not able to connect any bluetooth device, can anybody help me?

  • How to use the new MacBook 13'' with Built-in 7-hour battery

    Hi, I just bought the new MacBook, it is my first Mac, and having the Built-in 7-hour battery I don't know if I can plug it in most of the times without doing any damage to the battery. On other portable computers, I just take the battery out and tha

  • Price indicator - 004 plan & 008 Actual

    Hi Experts, I have checked the documentation for price indicator and understand that price indicator 004 and 008 are active when we activate purely iterative in CO version maintainance. Now my question is how can we select 004 while planning and how

  • How to convert milliseconds to HH:MM:SS

    hi how to convert milliseconds to HH:MM:SS and also is that possible to covert milliseconds to hh:mm:ss and date , plz any idea thanks in advance reg vino

  • USB stop working

    My USB port stoped working, so when I cannoect an external hard or flash memory or anything else there is no response, the other one still working though! I remember once I faced this problem and called Apple support and they asked me to restart and