geeky | arfore dot com | Page 2

I have been updating my wallpaper to a new monthly desktop wallpaper from the Smashing Magazine site for several months.

With earlier versions of Mac OS X it was easy to update all spaces at once because the default change action affected all the spaces. With the advent of Mac OS X 10.7 (aka Lion) each space is capable of having a unique wallpaper. While this is a neat feature, there is no option to apply the change to all the spaces. One workaround is to manually change each space.  Another workaround is remove all your spaces, make the change then add the spaces back.

Neither of these options is suitable to me. The first option is fairly cumbersome, and the second will undo my application-to-space bindings. To solve this problem I have written a script than handles it.

Here’s the script:

#!/bin/bash

# Simple Script to update the desktop wallpaper
# background for all desktop spaces in Mac OS X 10.7
#
# Usage: update_desktop_wallpaper.sh old_wallpaper_path new_wallpaper_path
#
# Andy Fore
# http://arfore.com

# Check for command line arguments
if [ -z "$1" ]; then
    echo "Usage: update_desktop_wallpaper.sh old_wallpaper_path new_wallpaper_path"
    exit 1;
else
    # Change location to the active user preferences directory
    cd ~/Library/Preferences

    # Backup the original plist file
    echo "Making a backup of the original plist file..."
    cp com.apple.desktop.plist com.apple.desktop.plist_backup

    # Convert the desktop plist from binary to xml
    echo "Converting plist file to text format..."
    plutil -convert xml1 com.apple.desktop.plist

    # Update the desktop wallpaper file location/name
    echo "Editing the file..."
    sed -i "" "s/$1/${2}/g" com.apple.desktop.plist

    # Convert the desktop plist back to binary format
    echo "Converting plist file back to binary format..."
    plutil -convert binary1 com.apple.desktop.plist

    # Killing Dock process
    echo "Sending the kill signal to the Dock process to force reload of plist"
    killall -HUP Dock

    # Display completion message
    echo "Operation now complete."
fi

Example

$ ./update_desktop_wallpaper.sh June2012_Calendar.jpg July2012_Calendar.jpg

Note that I only used a filename in the example. This is because all of my calendar wallpapers are saved in the same directory path, making the unique part just the filename itself.

linux_apps-150x150-9143081Editor’s Note: This article is part of the Tales of A Linux Switcher series.

In my search to make the complete switch from the Mac OS (see Tales of a Linux Switcher – Part 1), the biggest research effort has been finding applications that accomplish the same tasks in Linux.  Some of these tasks are pretty obvious, e.g., web browsing or email, while others are not quite so ordinary, e.g., filesystem encryption or software development.

So, with all of that in mind, the subject of this particular post is going to be a discussion of some of the common tasks that I set out to handle and the application I chose to fit the bill.

Chapter 2 – Getting it done

When everything is said and done, the important part of using any desktop (or server really) OS is getting what you need to do accomplished.  The tasks can be office productivity or software development or just casual web surfing.

The arguments about which OS is better, more secure, more extensible, or more “free” are all great and wonderful, but in the end what matters is getting it done.  There are some people that believe that software being free is top priority, while others (like myself) are not as concerned over whether the software is free, cheap, open source, or proprietary, as long as it works to get from point a to point b.

Don’t get me wrong, I like open source software, and it’s even better when it’s FOSS (free, open source software), but when it all shakes out I want a computer setup that I can rely on from day-to-day to do what I need it to do.

Chapter 3 – It’s all about the apps

So in my quest to get to point b, I have found that there are generally any number of application choices to accomplish my tasks in Linux that I did in the Mac OS ecosystem.

Some of the application choices were easy options, like LibreOffice in place of MS Office 2011, while others required more research to replace, e.g., iTunes, 1Password, etc.  With each choice I have tried to find an alternative that gave me the closest experience in terms of usability and feature set of the application being replaced.

When looking for alternatives I used Google for basic searching, but I also found the following sites to be of use:

Using those sites in combination with various forum posts and basic searches, I have been able to find software to do most everything I was doing on Mac OS X.  Bear in mind that sometimes it’s not quite as easy to set everything up, but I took that as a challenge.  There are some instances that presented particular challenges.  I will be posting on those individually as time permits.

To see the list I have personally come up, have a gander at my Linux Switcher Software Choices spreadsheet.

code_128-2726928So here at work we are running SGHE’s Banner Student Information System.  Part of the integration with the eFollett online bookstore isn’t working quite the way we want due to a bug that will not be fixed until Banner release 8.5 which we won’t have until sometime after classes start.

Due to the desire to find the books based on a class now, we had to create a system that would allow us to build the correct URLs for the eFollett system in a programmatic fashion.

The way we did it was to include an anchor tag as custom text within the Banner module.  The href attribute of the anchor tag contains an inline Javascript function that is used to pull the querystring parameters from the current Banner URL and pass that off to a separate system that will handle the redirection to the appropriate eFollett URL.

Too bad you have to be logged into the Banner account for it to work, since the query string is only available to an authenticated user.

The inspiration for this was the blog post Read URL GET variables with JavaScript by Ashley Ford.

As some of you will no doubt have noticed over the years, I am a die-hard Macintosh fan.  I have run Windows desktops and servers, as well as Linux desktops and servers over the years, but my true love has always been the Apple Macintosh computers.  So it is with some trepidation that I have faced the situation that I no longer have any Macintosh computers of my own.

While the situation was not anticipated, I have faced it head on and am rapidly on my way to filling all my computing needs with the Linux desktop that I have.  This is the first of several posts where I will document that process and the solutions that I have come up with to achieve the same goals in my personal computing experience with Linux that I did with the Mac.

Chapter 1 – Choosing a distribution

As a long time Linux user, dating all the way back to running a specialized distribution of RedHat on the 486 PC card in my PowerPC 6100 like some other folks, I am well acquainted with the passionate arguments that can arise among Linux aficionado when the topic of choosing a distribution arises.

In the beginning many of the arguments centered around the needs of various kernel configurations and packaging systems.  Do you compile your kernel by hand?  Do you go modular or monolithic?  Is RPM a better choice than deb?  Do you go hard core and start a stage 1 Gentoo install where you have to bootstrap the kernel just to compile and install?

Some of these decisions will be familiar to you and some won’t be.  Many of the old arguments don’t apply anymore due to major improvements over the years.  Ofttimes the new arguments center around free vs. non-free, Gnome 2 vs. Gnome 3, Gnome vs. KDE, etc.

With all of this in mind, I developed a rather simple set of criteria based on my personal experience with the philosophy Apple has espoused in it’s ad campaigns of “it just works.”  Here’s the list I came up with:

  1. Community involvement
    With any OS choice, it is very important that there be a large community of users, comprised of multiple skill levels, that can provide innovative solutions and workarounds for usability problems that can be encountered.
  2. Multiple update tracks
    While having a stable only release track makes sense for a production-level environment, as a tech-enthusiast and a geek it is great to have access to testing and unstable release tracks when you want to try something on the bleeding edge.
  3. Robust driver support
    It was important that recent hardware support be available. I don’t want to have to wait until a major point release to get something as important as a network card working.
  4. Eye candy
    Yes, I know that to a lot of die-hard UNIX guys, the concept of eye candy being a major bullet item for picking a distribution is nuts, but coming from the Macintosh environment, which is arguably one of the most visually appealing, it was important.

linux-mint-logo-domed-case-badge-techiant-150x150-2544781After doing a large amount of research and testing numerous live cd’s, I settled on Linux Mint 13 with the Cinnamon desktop environment.  Linux Mint is a Ubuntu-based distribution, which means it traces it’s genealogy back to the grand old distribution of Debian.

Ubuntu is known for having a extremely active community base and it has become the distribution of choice for many hardware vendors outside of the server market that are looking to pull Linux users into their product lines.

Being a Ubuntu/Debian based distribution, there are lots of opportunities for bleeding edge development when you want to go there.  For example, Oracle’s Java 7 Update 4 is available as a package through a PPA repo.

Also, since Linux Mint 13 is a Gnome 3-base with the sleek, modern looking Cinnamon environment on top, there is plenty of eye candy to go around.

References

  1. Fischba, S. (1997, June 06). Running linux on ppc/486 card?. Retrieved from http://www.linuxmisc.com/7-freebsd/2fd450d75fd55344.htm
  2. Lagna, G. (2010, April 23). Apple’s ad campaign, a brief history… Retrieved from http://www.macgasm.net/2010/04/23/apples-ad-campaign-a-brief-history/
  3. Linux Mint – from freedom came elegance. Ubuntu-based Linux distribution. http://www.linuxmint.com/
  4. Cinnamon – Love your Linux, Feel at Home, Get things Done! Window manager for Linux. http://cinnamon.linuxmint.com/
  5. Andrei, A. (2012, January 17). Install oracle java 7 in ubuntu via ppa repository. Retrieved from http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

softwarebug-150x150-6896781Recently I ran into an issue with several websites and their functionality, or lack thereof, on Mobile Safari in iOS 4.3.3 on the iPad.

Mobile Safari doesn’t give you much in the way of native debug tools.  There is a debug console, which will display, at least in theory, any CSS, HTML or Javascript errors.

The only problem is that it won’t actually display all HTML errors.  For instance the problem I ran into was an HTML tag mismatch between an opening H2 and a closing H3.  Mobile Safari on iOS 5.1 displayed the page as designed, however on iOS 4.3.3 the bad closing tag was omitted which meant that all the children of that H2 had the CSS style “hidden” applied to them due to a class assignment.

You would think that this might trigger an error code in the debug console, however no such error occurred, and using the Safari iOS 4.3.3 – iPad user agent in desktop Safari on Mac OS X did not exhibit the error.

In searching for a tool to assist with debugging this problem natively on the iPad I ran across a great bookmarklet by Mark Perkins, called Snoopy.

This bookmarklet gives you all kinds of nifty information about the page you are looking at, including a view of the generated source.  Thanks to this tool I was able to find out exactly what was breaking the display on the iPad.

%d bloggers like this: