<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tweak Blog</title>
	<atom:link href="http://www.brettjmarshall.com/wp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.brettjmarshall.com/wp</link>
	<description>Adventures in Code</description>
	<lastBuildDate>Wed, 28 Mar 2012 04:03:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>The worst part about censorship is ************</title>
		<link>http://www.brettjmarshall.com/wp/2012/03/the-worst-part-about-censorship-is.html</link>
		<comments>http://www.brettjmarshall.com/wp/2012/03/the-worst-part-about-censorship-is.html#comments</comments>
		<pubDate>Wed, 28 Mar 2012 03:37:00 +0000</pubDate>
		<dc:creator>tweaksource</dc:creator>
				<category><![CDATA[censorship]]></category>
		<category><![CDATA[freedom]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[pipa]]></category>
		<category><![CDATA[sopa]]></category>

		<guid isPermaLink="false">http://www.brettjmarshall.com/wp/?p=128</guid>
		<description><![CDATA[What does a bill like PIPA/SOPA mean to our shareable world? At the TED offices, Clay Shirky delivers a proper manifesto &#8212; a call to defend our freedom to create, discuss, link and share, rather than passively consume. Download video. This is the most compelling and well-presented treatise I have yet seen on the subject. <a href='http://www.brettjmarshall.com/wp/2012/03/the-worst-part-about-censorship-is.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>What does a bill like PIPA/SOPA mean to our shareable world? At the TED offices, Clay Shirky delivers a proper manifesto &#8212; a call to defend our freedom to create, discuss, link and share, rather than passively consume.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/GsxvGL5hJgE" frameborder="0" allowfullscreen></iframe></p>
<p><a href="http://www.ted.com/talks/defend_our_freedom_to_share_or_why_sopa_is_a_bad_idea.html?awesm=on.ted.com_B8Fn&#038;utm_campaign=&#038;utm_medium=on.ted.com-android-share&#038;utm_source=facebook.com&#038;utm_content=ted-androidapp" title="This" target="_blank" align="center">Download video</a>. This is the most compelling and well-presented treatise I have yet seen on the subject.</p>
<p>If you have a website I encourage you to add <a href="http://www.hellobar.com/pipa/" title="hellobar" target="_blank">the Hello Bar</a> to your site to help raise awareness and show your opposition to PIPA.</p>
<div class="gpo_bottomcontainer">
						<div class="gpo_buttons">
						        <g:plusone href="http://www.brettjmarshall.com/wp/2012/03/the-worst-part-about-censorship-is.html" size="standard" count="true"></g:plusone>
						</div>
			   </div>
			   <div style="clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.brettjmarshall.com/wp/2012/03/the-worst-part-about-censorship-is.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac Attack &#8211; Episode 1: (Un)Locking the Dock</title>
		<link>http://www.brettjmarshall.com/wp/2011/11/mac-attack-episode-1-unlocking-the-dock.html</link>
		<comments>http://www.brettjmarshall.com/wp/2011/11/mac-attack-episode-1-unlocking-the-dock.html#comments</comments>
		<pubDate>Fri, 11 Nov 2011 02:06:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Dock]]></category>

		<guid isPermaLink="false">http://www.brettjmarshall.com/wp/?p=98</guid>
		<description><![CDATA[Mac OSX 10.7: (Un)Locking the Dock The Dock in Mac OSX is attractive, functional, and fun. I have used similar docking/launching systems for years in Linux (Docky, WBar, Cairo, AWN) and found them to enhance my productivity while providing a bit of eye-candy. Thus, I have looked forward to the Dock in OSX, but have <a href='http://www.brettjmarshall.com/wp/2011/11/mac-attack-episode-1-unlocking-the-dock.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/MacAttack.jpg"><img class="size-full wp-image-101 aligncenter" title="MacAttack" src="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/MacAttack.jpg" alt="" width="335" height="383" /></a></p>
<div>
<div>
<div>
<p style="text-align: center;"><strong>Mac OSX 10.7: (Un)Locking the Dock</strong></p>
</div>
</div>
<div>
<div>
<p>The Dock in Mac OSX is attractive, functional, and fun. I have used similar docking/launching systems for years in Linux (Docky, WBar, Cairo, AWN) and found them to enhance my productivity while providing a bit of eye-candy. Thus, I have looked forward to the Dock in OSX, but have been disappointed to find a lack of configuration options.</p>
<p>Enter AppleScript.</p>
<p>I won’t go into explaining AppleScript in detail or even touch on more than the basics of how to work with it in OSX. There are <a href="https://www.google.com/search?q=AppleScript+tutorial&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a">plenty of good tutorials for that</a>. What I will do is share six scripts I have put together to provide a decent enhancement to the existing options. The following scripts will allow you to:</p>
</div>
</div>
<div>
<div>
<p>Add “Spacers” to the Applications section (left side) of the Dock to aid in organization.<br />
Add “Spacers” to the Documents section (right side) of the Dock to aid in organization.<br />
Save a backup of the current Dock configuration.<br />
Restore the Dock configuration to the saved state using the Save from script<br />
Lock the Dock to prevent accidental removal or shifting of Icons.<br />
Unlock the Dock to allow modification.</p>
</div>
</div>
<div>
<div>
<p>The scripts are very simple, but illustrate the power of scripting on *nix systems. AppleScript can execute shell commands via do shell script, and AppleScripts can be executed from the shell and much more. These scripts focus on executing shell commands from easily executable scripts.</p>
<p>DockAppSpace</p>
<pre>do shell script "defaults write com.apple.dock persistent-apps -array-add
      '{tile-data={}; tile-type=\"spacer-tile\";}' &amp;&amp; killall Dock"</pre>
<p>DockOtherSpace</p>
<pre>do shell script "defaults write com.apple.dock persistent-others -array-add
      '{tile-data={}; tile-type=\"spacer-tile\";}' &amp;&amp; killall Dock"</pre>
<p>DockSave</p>
<pre>do shell script "cp $HOME/Library/Preferences/com.apple.dock.plist $HOME/
      Library/Preferences/com.apple.dock_.plist"</pre>
<p>DockRestore</p>
<pre>do shell script "cp $HOME/Library/Preferences/com.apple.dock_.plist $HOME/
      Library/Preferences/com.apple.dock.plist; killall Dock"</pre>
<p>DockLock</p>
<pre>do shell script "defaults write com.apple.dock contents-immutable -bool Yes;
      killall Dock"</pre>
<p>DockUnlock</p>
<pre>do shell script "defaults write com.apple.dock contents-immutable -bool No;
      killall Dock"</pre>
</div>
</div>
</div>
<div>
<div>
<div>
<p>You will notice that the first two scripts end with ‘&amp;&amp; killall Dock’ and the last four end with ‘; killall Dock’. I have provided two examples of legal syntaxes for chaining commands in the bash shell. Both the double-ampersand (&amp;&amp;) and the semicolon (;) essentially mean “and then do.”</p>
<p>Command1 &amp;&amp; Command2 and Command1; Command2</p>
<p>are equivalent and both mean execute Command1 and then execute Command2.</p>
<p>To use these scripts, open the AppleScript Editor. You can launch it from Applications/Utilities, or use Command + Space to open Spotlight and type Apple and it should be the Top Hit.</p>
<p>First, let’s save your current Dock configuration so you can restore it if you need to. Copy and Paste the DockSave script into the Editor. Save the file (Cmd + S) as DockSave.scpt and then Run (Cmd + R) the script. I made a Scripts folder in my home directory. Save it wherever you like.</p>
<p>Copy and Paste the DockAppSpace script into the Editor. Save the file as DockAppSpace and then Run the script. You should now have a space or gap between two icons on your Dock. This Spacer can be manipulated the same as the other icons. You can move it around, drag it off of the Dock to remove it, or whatever. Running the script multiple times creates multiple spacers.</p>
<p>The DockOtherSpace script does the same thing for the Documents (right) side of the Dock.</p>
<p style="text-align: center;"><a href="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/DockSpacer.png"><img class="aligncenter size-full wp-image-103" title="DockSpacer" src="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/DockSpacer.png" alt="" width="896" height="560" /></a></p>
<div>
<p>As you can see in the screenshot above, I have my icons organized into what I consider logical groups. At the far left are administration utilities such as Finder, System Preferences, Terminal, and Disk Utility client. Next are Internet apps like web browsers, mail, and FTP client. Then productivity apps like iWork, Text Editor, XCode, and Grab. Fourth are multimedia apps. At the far right are virtualization and remote access apps.</p>
<p>I find that this goes a long way towards helping me organize and make better use of the Dock. The DockRestore script will (surprise&#8230;) restore your Dock to whatever state it was in when you last ran the DockSave script.</p>
<p>The DockLock and DockUnlock scripts lock and unlock the Dock respectively to deny or allow changes in the Dock state. This is what really got me started because I kept accidentally dragging Icons off of the Dock and “poofing” them away.</p>
<p>Now comes the fun part. You saved the scripts as .scpt files. This is fine, but by changing the File Format in the drop-down box you can save the script as an Application with a .app extension.</p>
<p style="text-align: center;"><a href="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/SaveAsApp.png"><img class="aligncenter size-full wp-image-105" title="SaveAsApp" src="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/SaveAsApp.png" alt="" width="424" height="255" /></a></p>
<p>Now the App can be added to your Applications Folder and run like any other app. This means you can, if you want, add it to the dock or desktop and execute is as an application. Double-clicking an .scpt file will open it in the AppleScript Editor, which is probably not what you want. Using the .app is likely preferred.</p>
<p>If you’d like to change the icon for your app from the script icon to something else, you can. The file format for icons in OSX is .icns. There is a nifty little free app called <a href="http://www.img2icnsapp.com/">img2icns</a> which lets you drag-and- drop images to the window and convert them to .icns in a snap by clicking the .icns icon.</p>
<p style="text-align: center;"><a href="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/ReplaceIcon.png"><img class="aligncenter size-full wp-image-106" title="ReplaceIcon" src="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/ReplaceIcon.png" alt="" width="896" height="560" /></a></p>
<div>
<p>Once you have created an .icns, go to where you saved your .app file and Ctrl + click it. From the context menu select “Show Package Contents”. Inside the resulting Contents folder are a.plist file (preferences), PkgInfo file, a MacOSX folder, and a Resources folder. Inside the Resource folder is an applet.icns. Replace this with your own .icns file. I renamed my icon applet.icns. It may not be needed.</p>
<p>It appears that Finder is notoriously bad at refreshing icons, so you have a couple of options if your new icon doesn’t show up.<br />
1. Open Terminal and execute ‘killall Finder’ (no quotes). Finder will die and immediately resurrect</p>
<p>itself, at which point the icon cache will be reloaded.<br />
2. Install or reproduce the tiny AppleScript app by Samuel Svensson called <a href="http://www.soderhavet.com/refresh/">Refresh Finder</a> which is discussed <a href="http://www.tuaw.com/2007/04/16/refresh-the-finder/">here</a>.</p>
<p>While it is nice to be able to have some control over my own machine, the clear importance to administrators is a ‘window’ into managing the Mac OSX environment with AppleScripts. A script like DockLock, when run as root, would prevent unprivileged users from removing icons from the Dock. Similarly, the .plist files found in /Library/Preferences afford control over System preferences, but that is for another time.</p>
</div>
</div>
</div>
</div>
</div>
<p style="text-align: left;">Download PDF: <a href="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/11/MacAttack-UnLocking-the-Dock.pdf">MacAttack &#8211; (Un)Locking the Dock</a></p>
<div class="gpo_bottomcontainer">
						<div class="gpo_buttons">
						        <g:plusone href="http://www.brettjmarshall.com/wp/2011/11/mac-attack-episode-1-unlocking-the-dock.html" size="standard" count="true"></g:plusone>
						</div>
			   </div>
			   <div style="clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.brettjmarshall.com/wp/2011/11/mac-attack-episode-1-unlocking-the-dock.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control Your Desktop From Your Android Using TeamViewer</title>
		<link>http://www.brettjmarshall.com/wp/2011/09/control-your-desktop-from-your-android.html</link>
		<comments>http://www.brettjmarshall.com/wp/2011/09/control-your-desktop-from-your-android.html#comments</comments>
		<pubDate>Wed, 28 Sep 2011 21:14:49 +0000</pubDate>
		<dc:creator>tweaksource</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Remote Access]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[TeamViewer]]></category>

		<guid isPermaLink="false">http://www.brettjmarshall.com/wp/?p=80</guid>
		<description><![CDATA[TeamViewer is a great desktop sharing and remote control solution. Available for Linux, Mac, and Windows, TeamViewer offers two-way sharing, unattended access, file transfer, chat, voip and more. Setup is simple and it works great. I have used the free version for simple operations like remotely helping a friend configure or install something on their <a href='http://www.brettjmarshall.com/wp/2011/09/control-your-desktop-from-your-android.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.teamviewer.com/" title="TeamViewer">TeamViewer</a> is a great desktop sharing and remote control solution. Available for Linux, Mac, and Windows, TeamViewer offers two-way sharing, unattended access, file transfer, chat, voip and more. Setup is simple and it works great. </p>
<p>I have used the free version for simple operations like remotely helping a friend configure or install something on their computer Linux to Linux, Windows to Windows, and cross-platform. Now the usefulness of TeamViewer increases with the release of the free TeamViewer App for Android. </p>
<div id="links">
<img src="http://www.teamviewer.com/images/mobile/teamviewer_qrcode.gif" alt="TeamViewer QR code for Android Market" /><br />
<a href="http://www.teamviewer.com/download/TeamViewer.apk" title="Download APK" target="_blank">Download APK</a><br />
or<br />
<a href="http://www.teamviewer.com/link/?url=630763" title="Android Market" target="_blank">Android Market</a></div>
<p><a href="http://www.teamviewer.com/download/teamviewer_manual.pdf" title="User Manual" target="_blank"></a><!-- end links div --><br />
<span id="more-80"></span></p>
<p>Of course i like it because it&#8217;s free. Of course i like it because it&#8217;s cross-platform. What i really like the most is that it works really well. I expected the graphics to be choppy or the response to be slow, but it wasn&#8217;t so. One thing that does take a bit to get used to is the fact that the cursor is the focal point and, therefore, moving it to the edge of the screen advances the display in that direction. This as opposed to the typical smartphone thinking where you flick the page up to get to the bottom. With the TeamViewer app you move to the bottom to scroll down. Makes perfect sense. The zoom slider helps here as well.</p>
<p>The mouse control is excellent. You move the cursor with one finger and it works nicely. Tapping with one finger emulates a single left-click, while a two-finger tap emulates a right-click. I found it to be quite intuitive and very responsive.</p>
<p>TeamViewer and the TeamViewer App are free for personal use. Check it out.</p>
<div class="gpo_bottomcontainer">
						<div class="gpo_buttons">
						        <g:plusone href="http://www.brettjmarshall.com/wp/2011/09/control-your-desktop-from-your-android.html" size="standard" count="true"></g:plusone>
						</div>
			   </div>
			   <div style="clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.brettjmarshall.com/wp/2011/09/control-your-desktop-from-your-android.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 11.04 &#8211; How to Add Firefox Bookmarks Shortcuts to the Unity Launcher</title>
		<link>http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-firefox-bookmark-to-the-unity-launcher.html</link>
		<comments>http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-firefox-bookmark-to-the-unity-launcher.html#comments</comments>
		<pubDate>Fri, 16 Sep 2011 16:25:00 +0000</pubDate>
		<dc:creator>tweaksource</dc:creator>
				<category><![CDATA[Launcher]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Natty Narwhal]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://www.brettjmarshall.com/wp/2011/09/16/ubuntu-11-04-how-to-add-firefox-shortcuts-to-the-unity-launcher/</guid>
		<description><![CDATA[Following up on my previous post about adding a Computer item to the nautilus Home launcher in Unity, let&#8217;s look at adding shortcuts to web pages in the Firefox launcher. First, copy the firefox.desktop file from /usr/share/applications: cp /usr/share/applications/firefox.desktop ~/.local/share/applications Now open the file in a text editor, such as gedit: gedit ~/.local/share/applications/firefox.desktop You should <a href='http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-firefox-bookmark-to-the-unity-launcher.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Following up on my <a href="http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-computer-place-to-unity-launcher.html"> previous post </a> about adding a Computer item to the nautilus Home launcher in Unity, let&#8217;s look at adding shortcuts to web pages in the Firefox launcher.</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-jIzqved1kEg/TnOAYgv9LMI/AAAAAAAAAEI/6dLItaH4JIU/s1600/FirefoxShortcuts.png"><img id="BLOGGER_PHOTO_ID_5653003115876396226" style="display: block; margin: 0px auto 10px; text-align: center; cursor: hand; width: 320px; height: 180px;" src="http://1.bp.blogspot.com/-jIzqved1kEg/TnOAYgv9LMI/AAAAAAAAAEI/6dLItaH4JIU/s320/FirefoxShortcuts.png" alt="" border="0" /></a></p>
<p>First, copy the firefox.desktop file from /usr/share/applications:</p>
<pre>cp /usr/share/applications/firefox.desktop ~/.local/share/applications</pre>
<p>Now open the file in a text editor, such as gedit:</p>
<pre>gedit ~/.local/share/applications/firefox.desktop</pre>
<p>You should see something like this (I edited out the long list of languages):</p>
<pre>[Desktop Entry]
Version=1.0
Name=Firefox Web Browser
Comment=Browse the World Wide Web
GenericName=Web Browser
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;
StartupWMClass=Firefox
StartupNotify=true
X-Ayatana-Desktop-Shortcuts=NewWindow;

[NewWindow Shortcut Group]
Name=Open a New Window
Exec=firefox -new-window about:blank
TargetEnvironment=Unity</pre>
<p>Add names for the shortcuts to the end of this line:</p>
<pre>X-Ayatana-Desktop-Shortcuts=NewWindow;</pre>
<p>Such as:</p>
<pre>X-Ayatana-Desktop-Shortcuts=NewWindow;TweakBlog;</pre>
<p><span id="more-15"></span></p>
<p>Now add the block for the shortcut to the end of the file:</p>
<pre>[TweakBlog Shortcut Group]
Name=Tweak Blog
Exec=firefox -new-window 'http://brett-marshall.blogspot.com/'
TargetEnvironment=Unity</pre>
<p>Append whatever shortcut names you like to the end of the &#8220;X-Ayatana-Desktop-Shortcuts&#8221; line and add the relevant blocks to the end of the file.</p>
<p>That&#8217;s it. Log out and back in to use your new shortcuts.</p>
<div class="gpo_bottomcontainer">
						<div class="gpo_buttons">
						        <g:plusone href="http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-firefox-bookmark-to-the-unity-launcher.html" size="standard" count="true"></g:plusone>
						</div>
			   </div>
			   <div style="clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-firefox-bookmark-to-the-unity-launcher.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 11.04 &#8211; How to Add Computer Place to Unity Launcher</title>
		<link>http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-computer-place-to-unity-launcher.html</link>
		<comments>http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-computer-place-to-unity-launcher.html#comments</comments>
		<pubDate>Fri, 16 Sep 2011 15:40:00 +0000</pubDate>
		<dc:creator>tweaksource</dc:creator>
				<category><![CDATA[Launcher]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Natty Narwhal]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://www.brettjmarshall.com/wp/2011/09/16/ubuntu-11-04-how-to-add-computer-place-to-unity-launcher/</guid>
		<description><![CDATA[I recently upraded to Ubuntu 11.04. I wanted to hate the Unity interface&#8230;really I did. I tried, but I actually find it pretty cool&#8230;now that I can customize it. First, a screenshot of my desktop: The wallpaper can be found here:Wallpaper and the icon set here:Icons What can I say? i like monochrome&#8230;it matches everything! <a href='http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-computer-place-to-unity-launcher.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I recently upraded to Ubuntu 11.04. I wanted to hate the Unity interface&#8230;really I did. I tried, but I actually find it pretty cool&#8230;now that I can customize it.</p>
<p style="text-align: center;">First, a screenshot of my desktop:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-ENKDO2zkKoI/TnNu-NjuuFI/AAAAAAAAADw/PRKOG4kwDL4/s1600/MonoChromeUnity.png"><img id="BLOGGER_PHOTO_ID_5652983972350572626" style="display: block; margin: 0px auto 10px; text-align: center; cursor: hand; width: 320px; height: 180px;" src="http://4.bp.blogspot.com/-ENKDO2zkKoI/TnNu-NjuuFI/AAAAAAAAADw/PRKOG4kwDL4/s320/MonoChromeUnity.png" alt="" border="0" /></a></p>
<p style="text-align: center;">The wallpaper can be found here:<a href="http://freewallpaper2010.blogspot.com/2011/06/ubuntu-logo-wallpaper.html">Wallpaper</a><br />
and the icon set here:<a href="http://pobtott.deviantart.com/art/Any-Color-You-Like-175624910">Icons</a></p>
<p>What can I say? i like monochrome&#8230;it matches everything!</p>
<p>I wanted to add an entry to the Unity Launcher Home / File Browser icon which would give me this:</p>
<p><a href="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/09/Computer.png"><img class="aligncenter size-medium wp-image-63" title="Computer" src="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/09/Computer-300x199.png" alt="Computer" width="300" height="199" /></a></p>
<p>The Unity Launcher items are configured through standard .desktop files. These files originate in /usr/share/applications. The customize them, copy the file you want, such as nautilus-computer.desktop, to ~/.local/share/applications with this command:</p>
<pre>cp /usr/share/applications/nautilus-computer.desktop ~/.local/share/applications/</pre>
<p>Now open the file at ~/.local/share/applications/nautilus-computer.desktop with an editor like gedit:</p>
<pre>gedit ~/.local/share/applications/nautilus-computer.desktop</pre>
<p>You should see something like this:</p>
<pre>[Desktop Entry]
Name=Computer
Comment=Browse all local and remote disks and folders accessible from this computer
TryExec=nautilus
Exec=nautilus --no-desktop computer:
Icon=computer
Terminal=false
StartupNotify=true
Type=Application
Categories=GNOME;GTK;Core;
OnlyShowIn=GNOME;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=nautilus
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=2.32.2
X-Ubuntu-Gettext-Domain=nautilus</pre>
<p><span id="more-14"></span></p>
<p>What I did was to add an entry for this to my nautilus.desktop file to create a Shortcut Group sub-item in the Home launcher:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-Oq8jNFVIf-U/TnNygD32kLI/AAAAAAAAAD4/ZnJLzRL6TwY/s1600/NautilusComputer.png"><img id="BLOGGER_PHOTO_ID_5652987852401053874" style="display: block; margin: 0px auto 10px; text-align: center; cursor: hand; width: 320px; height: 180px;" src="http://4.bp.blogspot.com/-Oq8jNFVIf-U/TnNygD32kLI/AAAAAAAAAD4/ZnJLzRL6TwY/s320/NautilusComputer.png" alt="" border="0" /></a></p>
<p>There is a good list of <a href="http://askubuntu.com/questions/35488/list-of-custom-launchers-quicklists-for-unity">Custom Unity launchers and Quicklists</a> at <a href="http://askubuntu.com">AskUbuntu.com</a>. Building on instructions I found there, I added the nautilus-computer entry to my nautilus.desktop file, which now looks like this:</p>
<pre>[Desktop Entry]
Name=Folders
Comment=Open your folders
TryExec=nautilus
Exec=nautilus --no-desktop
Icon=user-home
Terminal=false
StartupNotify=true
Type=Application
Categories=GNOME;GTK;Core;
OnlyShowIn=GNOME;Unity;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=nautilus
X-GNOME-Bugzilla-Component=general
X-Ubuntu-Gettext-Domain=nautilus

X-Ayatana-Desktop-Shortcuts=Computer;Videos;Documents;Music;Pictures;Downloads;Root
Name[en_US]=Folders

[Computer Shortcut Group]
Name=Computer
Exec=nautilus --no-desktop computer:
TargetEnvironment=Unity

[Videos Shortcut Group]
Name=Videos
Exec=nautilus Videos
TargetEnvironment=Unity

[Documents Shortcut Group]
Name=Documents
Exec=nautilus Documents
TargetEnvironment=Unity

[Music Shortcut Group]
Name=Music
Exec=nautilus Music
TargetEnvironment=Unity

[Pictures Shortcut Group]
Name=Pictures
Exec=nautilus Pictures
TargetEnvironment=Unity

[Downloads Shortcut Group]
Name=Downloads
Exec=nautilus Downloads
TargetEnvironment=Unity

[Root Shortcut Group]
Name=Root Browser
Exec=gksu nautilus
TargetEnvironment=Unity</pre>
<p>&#8230;and that&#8217;s pretty much it.</p>
<p>Additionally, a quick way to add an icon to the launcher is to open an application (by using Alt+F2 and typing the command, or hitting the Super key and searching for it, or hitting Super and then clicking &#8220;More Apps &#8211;&gt; Installed&#8221;), and then right-clicking the icon when it appears in the launcher. You will get a menu like this:</p>
<p><a href="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/09/KeepLauncher.png"><img class="aligncenter size-full wp-image-59" title="KeepLauncher" src="http://www.brettjmarshall.com/wp/wp-content/uploads/2011/09/KeepLauncher.png" alt="KeepLauncher" width="210" height="277" /></a></p>
<p>&#8230;which adds a check mark and makes it stick.</p>
<p>Enjoy Unity!</p>
<p>P.S. In case you&#8217;re interested, here&#8217;s my <a href="http://brettjmarshall.com/Files/conkyrc"> conkyrc</a> file. Right-click and Save Link As&#8230;</p>
<p>I&#8217;ll do a proper post on conky soon.</p>
<div class="gpo_bottomcontainer">
						<div class="gpo_buttons">
						        <g:plusone href="http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-computer-place-to-unity-launcher.html" size="standard" count="true"></g:plusone>
						</div>
			   </div>
			   <div style="clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.brettjmarshall.com/wp/2011/09/ubuntu-11-04-how-to-add-computer-place-to-unity-launcher.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Android Apps with HTML, CSS, and JavaScript</title>
		<link>http://www.brettjmarshall.com/wp/2011/06/building-android-apps-with-html-css-and-javascript.html</link>
		<comments>http://www.brettjmarshall.com/wp/2011/06/building-android-apps-with-html-css-and-javascript.html#comments</comments>
		<pubDate>Tue, 07 Jun 2011 20:47:00 +0000</pubDate>
		<dc:creator>tweaksource</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.brettjmarshall.com/wp/2011/06/07/building-android-apps-with-html-css-and-javascript/</guid>
		<description><![CDATA[I recently got a book written by Johnathan Stark called, &#8220;Building Android Apps with HTML, CSS, and JavaScript.&#8221; This nifty little book goes through the process of creating &#8220;Android Apps&#8221; using only web scripting skills. The basic idea is to use javascript and css to provide functionality and style to make your web site/ web <a href='http://www.brettjmarshall.com/wp/2011/06/building-android-apps-with-html-css-and-javascript.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p style="text-indent: 3em;"> I recently got a book written by Johnathan Stark called, <a href="http://oreilly.com/catalog/0636920010067">&#8220;Building Android Apps with HTML, CSS, and JavaScript.&#8221;</a> This nifty little book goes through the process of creating &#8220;Android Apps&#8221; using only web scripting skills.</p>
<p style="text-indent: 3em;"> The basic idea is to use javascript and css to provide functionality and style to make your web site/ web app emulate the typical Android behavior and tailor the display to the mobile device. While this may (or may not) seem very useful, there&#8217;s more to the story. </p>
<p style="text-indent: 3em;"> The book also goes into detail describing how to launch your &#8220;app&#8221; from the home screen, store data locally on the phone, and operate in offline mode. Further, the author demonstrates the use of an open source project called <a href="http://www.nitobi.com/products/phonegap/">PhoneGap</a> to allow your web app to access the device hardware and features such as geolocation, accelerometer, sound, and vibration. </p>
<p style="text-indent: 3em;"> In a nutshell, PhoneGap works as a &#8220;wrapper&#8221; by abstracting the relevant API&#8217;s for iPhone, Android, BlackBerry, Palm, Symbian, and Windows Mobile, and  producing an native-compatible app for the target platform&#8230;without writing platform-specific code.</p>
<p style="text-indent: 3em;"> It&#8217;s a pretty neat concept that allows for a great deal of flexibility and &#8220;cross-platform&#8221; exposure for a web app. </p>
<h3>Description</h3>
<p style="display: block; background-color: rgb(223, 223, 223); color: rgb(0, 0, 0); padding: 10px;">If you know HTML, CSS, and JavaScript, you already have the tools you need to develop Android applications. This hands-on book shows you how to use these open source web standards to design and build apps that can be adapted for any Android device &#8212; without having to use Java.</p>
<p>You&#8217;ll learn how to create an Android-friendly web app on the platform of your choice, and then convert it to a native Android app with the free PhoneGap framework. Discover why device-agnostic mobile apps are the wave of the future, and start building apps that offer greater flexibility and a broader reach.</p>
<p>    * Learn the basics for making a web page look great on the Android web browser<br />
    * Convert a website into a web application, complete with progress indicators and more<br />
    * Add animation with jQTouch to make your web app look and feel like a native Android app<br />
    * Take advantage of client-side data storage with apps that run even when the Android device is offline<br />
    * Use PhoneGap to hook into advanced Android features &#8212; including the accelerometer, geolocation, and alerts<br />
    * Test and debug your app on the Web under load with real users, and then submit the finished product to the Android Market </p>
<div class="gpo_bottomcontainer">
						<div class="gpo_buttons">
						        <g:plusone href="http://www.brettjmarshall.com/wp/2011/06/building-android-apps-with-html-css-and-javascript.html" size="standard" count="true"></g:plusone>
						</div>
			   </div>
			   <div style="clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.brettjmarshall.com/wp/2011/06/building-android-apps-with-html-css-and-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2 Ways to Assign Colors in Android</title>
		<link>http://www.brettjmarshall.com/wp/2011/05/2-ways-to-assign-colors-in-android.html</link>
		<comments>http://www.brettjmarshall.com/wp/2011/05/2-ways-to-assign-colors-in-android.html#comments</comments>
		<pubDate>Tue, 24 May 2011 21:04:00 +0000</pubDate>
		<dc:creator>tweaksource</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Colors]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.brettjmarshall.com/wp/2011/05/24/2-ways-to-assign-colors-in-android/</guid>
		<description><![CDATA[Instantiating Colors in Android A recent Android project for my Mobile Application Development class required us to draw 2d shapes and make a design. Android provides 12 Color constants for general use. The constructor for the Color object takes an int as a parameter. I wanted to draw some shapes in the appropriate &#8220;Android Green&#8221; <a href='http://www.brettjmarshall.com/wp/2011/05/2-ways-to-assign-colors-in-android.html'>[...]</a>]]></description>
			<content:encoded><![CDATA[<div id="lens_intro_title_value">
<h2 class="module_title">Instantiating Colors in Android</h2>
</div>
<p><img class="postPhoto" style="float: left; margin: 10px;" src="http://i3.squidoocdn.com/resize/squidoo_images/250/draft_lens17980116_1306220489tweakDroid.png" alt="this posts's photo" /><br />
A recent Android project for my Mobile Application Development class required us to draw 2d shapes and make a design. Android provides 12 Color constants for general use. The constructor for the Color object takes an int as a parameter. I wanted to draw some shapes in the appropriate <strong style="color: #a4c639;">&#8220;Android Green&#8221; (#a4c639)</strong>, but the solution was not instantly obvious to me.</p>
<div id="module150388655" class="module textmodule">
<div class="editor_title"><span style="color: #333333; font-size: 180%;"><span style="font-weight: bold;">Method #1: Create an Instance of android.graphics.Color</span></span></p>
<h3 id="module_id150388655_subtitle" class="module_subtitle"><span style="color: #666666;">the interesting, yet less flexible way&#8230; </span></h3>
</div>
<div class="boxbody">
<div id="module150388655Body">
<div id="module_id150388655_results" class="viewing">
<div class="module">
<div class="write_module">From the <a href="http://developer.android.com/reference/android/graphics/Color.html">Android reference</a>:</p>
<p style="display: block; background-color: #dfdfdf; color: #000000; padding: 10px;">The Color class defines methods for creating and converting color ints. Colors are represented as packed ints, made up of 4 bytes: alpha, red, green, blue. The values are unpremultiplied, meaning any transparency is stored solely in the alpha component, and not in the color components. The components are stored as follows (alpha &lt;&lt; 24) | (red &lt;&lt; 16) | (green &lt;&lt; <img src='http://www.brettjmarshall.com/wp/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> | blue. Each component ranges between 0..255 with 0 meaning no contribution for that component, and 255 meaning 100% contribution. Thus opaque-black would be 0xFF000000 (100% opaque but no contributions from red, green, or blue), and opaque-white would be 0xFFFFFFFF</p>
<p><em>So what exactly does that techno-babble mean? </em>I finally deciphered it&#8230;</p>
<p style="text-indent: 3em;">Basically you start with the hex code for the color you want such as #a4c639. Prefix your integer with 0x, add 2 characters for transparenecy (00 for full transparency up to FF for full opacity), then add your 6 character hex color.</p>
<p>For example:</p>
<p style="display: block; background-color: #dfdfdf; color: #000000; padding: 10px;">#a4c639 would become 0xFFA4C639.</p>
<p><span id="more-10"></span></p>
<p>Now instantiate the object in the onDraw() method:</p>
<pre class="brush: java; title: Code:; notranslate">int droidGreen = 0xFFA4C639;
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(AndroidGreen);
canvas.drawCircle(130, 90, 30, paint);</pre>
<p style="text-indent: 3em;">This will draw a circle in Android Green 130px from the left and 90px from the top with a radius of 30 (60 pixels wide)!</p>
<p><a title="ImageShack - Image And Video Hosting" href="http://imageshack.us/photo/my-images/535/droidcircle.png/" target="_blank"><img src="http://img535.imageshack.us/img535/267/droidcircle.png" alt="" border="0" /></a></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="editor_title" style="font-family: arial;">
<h2 id="module_id150389643_title" class="module_title" style="color: #333333;"><span style="font-size: 180%;">Method #2: Add a Color Resource in XML</span></h2>
<h3 id="module_id150389643_subtitle" class="module_subtitle"><span style="color: #666666;">the recommended way&#8230; </span></h3>
</div>
<p style="text-indent: 3em;">The first method will certainly work, but it is not the most flexible. What if you do that to draw 56 shapes and then want to change the color to HoneyDew or something? A better solution would be to add a central resource and access that resource each time you want to use that color. Then if you want a different color on those shapes you simply change the color value one time in the resource file and you&#8217;re done. Android makes this very easy.</p>
<p style="display: block; background-color: #dfdfdf; color: #000000; padding: 10px;">Create a new XML file in your project&#8217;s /res folder. The wizard in Eclipse can help you with this:</p>
<p>EDIT: resource files cannot have upper-case letters in the name. The filename in the screenshot should be colors.xml.<br />
<a title="ImageShack - Image And Video Hosting" href="http://img14.imageshack.us/i/newxmlwizard.png/" target="_blank"><img src="http://img14.imageshack.us/img14/7184/newxmlwizard.png" alt="" width="670px" height="708px" border="0" /></a></p>
<p style="text-indent: 3em; font-family: arial;"><strong>The syntax for the file should be something like:</strong></p>
<pre class="brush: xml; title: Code:; notranslate">&lt;resources&gt;
   &lt;color name=&quot;AndroidGreen&quot;&gt;#a4c639&lt;/color&gt;
&lt;/resources&gt;</pre>
<p style="text-indent: 3em;"><strong>Now you can access that color resource and draw your circle like this:</strong></p>
<pre class="brush: java; title: Code:; notranslate">Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(R.color.AndroidGreen);
canvas.drawCircle(130, 90, 30, paint);</pre>
<p><span> More resources:</span><br />
<a style="font-family: arial;" href="http://developer.android.com/reference/android/graphics/Color.html">http://developer.android.com/reference/android/graphics/Color.html</a><br />
<a style="font-family: arial;" href="http://developer.android.com/guide/topics/resources/available-resources.html">http://developer.android.com/guide/topics/resources/available-resources.html</a></p>
<div class="gpo_bottomcontainer">
						<div class="gpo_buttons">
						        <g:plusone href="http://www.brettjmarshall.com/wp/2011/05/2-ways-to-assign-colors-in-android.html" size="standard" count="true"></g:plusone>
						</div>
			   </div>
			   <div style="clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.brettjmarshall.com/wp/2011/05/2-ways-to-assign-colors-in-android.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

