<?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>Do Know Evil - A Blog by Tyler Mulligan &#187; Ubuntu</title>
	<atom:link href="http://www.doknowevil.net/category/computers/software/operating-systems/linux/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doknowevil.net</link>
	<description>Tips and Tricks About Computers, Web Development, Linux, the Internet and the Like</description>
	<lastBuildDate>Thu, 29 Jul 2010 03:37:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>scp-notifications for GNOME and Ubuntu &#8211; Expanding on My Original Python Script</title>
		<link>http://www.doknowevil.net/2010/06/26/scp-notifications-for-gnome-and-ubuntu-expanding-on-my-original-python-script/</link>
		<comments>http://www.doknowevil.net/2010/06/26/scp-notifications-for-gnome-and-ubuntu-expanding-on-my-original-python-script/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 00:11:15 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Compiz]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Desktop Mods]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[The Internet]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[libnotify]]></category>
		<category><![CDATA[notification-daemon]]></category>
		<category><![CDATA[pynotify]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=698</guid>
		<description><![CDATA[I&#8217;ve only been coding Python for ~12 hours total, so don&#8217;t expect this to be perfect. Knowing what I know about creating/testing other software and doing my best to scour through very light pynotify documentation, I&#8217;ve begun to build out this script to be more useful / portable / configurable. As the Version 0.6 indicates,]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve only been coding Python for ~12 hours total, so don&#8217;t expect this to be perfect.  Knowing what I know about creating/testing other software and doing my best to scour through very light pynotify documentation, I&#8217;ve begun to build out this script to be more useful / portable / configurable.  As the Version 0.6 indicates, I&#8217;m not quite at my goal yet and there is still more to learn to bring it up to that point.</p>
<p>I&#8217;m releasing this early on my blog just in case I caught any people yesterday who&#8217;ve been experimenting with my research / code so far.  I&#8217;ll share it on github when I evolve it just a bit more.</p>
<p><a href="http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv">Video of it in Action</a></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co1">#!/usr/bin/env python</span>
<span class="co1">#</span>
<span class="co1"># Title: scp-notifications</span>
<span class="co1"># Author: Tyler Mulligan (tyler@detrition.net)</span>
<span class="co1"># Date: 06/26/2010</span>
<span class="co1"># Version: 0.6</span>
<span class="co1"># Description:</span>
<span class="co1"># Used in combination with an event, such as an action or cronjob, this script</span>
<span class="co1"># will scp the latest file from a folder to your server.</span>
<span class="co1">#</span>
<span class="co1"># Optionally, it can copy the url to your clipboard and/or show a popup with a</span>
<span class="co1"># link to the file after succesfully uploading</span>
<span class="co1">#</span>
<span class="co1"># Orginally developed to be piped to from compiz screenshot tool</span>
<span class="co1"># http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv</span>
<span class="co1">#</span>
<span class="co1"># The MIT License</span>
<span class="co1">#</span>
<span class="co1"># Copyright (c) 2010 Tyler Mulligan</span>
<span class="co1">#</span>
<span class="co1"># Permission is hereby granted, free of charge, to any person obtaining a copy</span>
<span class="co1"># of this software and associated documentation files (the &quot;Software&quot;), to deal</span>
<span class="co1"># in the Software without restriction, including without limitation the rights</span>
<span class="co1"># to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<span class="co1"># copies of the Software, and to permit persons to whom the Software is</span>
<span class="co1"># furnished to do so, subject to the following conditions:</span>
<span class="co1">#</span>
<span class="co1"># The above copyright notice and this permission notice shall be included in</span>
<span class="co1"># all copies or substantial portions of the Software.</span>
<span class="co1">#</span>
<span class="co1"># THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<span class="co1"># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<span class="co1"># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<span class="co1"># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<span class="co1"># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<span class="co1"># OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span>
<span class="co1"># THE SOFTWARE</span>
<span class="co1">#</span>
&nbsp;
<span class="kw1">import</span> pygtk
pygtk.<span class="me1">require</span><span class="br0">&#40;</span><span class="st0">'2.0'</span><span class="br0">&#41;</span>
<span class="kw1">import</span> pynotify
<span class="kw1">import</span> gtk
<span class="kw1">import</span> <span class="kw3">sys</span>
<span class="kw1">import</span> <span class="kw3">os</span>
<span class="kw1">import</span> <span class="kw3">subprocess</span>
&nbsp;
<span class="co1"># Set Variables</span>
<span class="co1">#####################################</span>
<span class="kw3">user</span> = <span class="st0">&quot;user&quot;</span>
host = <span class="st0">&quot;server.com&quot;</span>
<span class="co1"># All should have trailing slashes</span>
lfolder = <span class="st0">&quot;/home/user/screenshots/&quot;</span>
hfolder = <span class="st0">&quot;/home/remote_user/screenshots/&quot;</span>
httplink = <span class="st0">&quot;http://&quot;</span>+host+<span class="st0">&quot;/screenshots/&quot;</span>
&nbsp;
&nbsp;
<span class="co1"># Display</span>
<span class="co1">#####################################</span>
t1 = <span class="nu0">5000</span> <span class="co1"># timeout for screenshot upload dialog</span>
t2 = <span class="nu0">3000</span> <span class="co1"># timeout for screenshot preview</span>
t3 = <span class="nu0">7000</span> <span class="co1"># timeout for link dialog</span>
&nbsp;
screenshot_preview = <span class="nu0">1</span> <span class="co1"># If using with the compiz screenshot plugin, you may want this</span>
popup_link = <span class="nu0">1</span> <span class="co1"># another popup</span>
copy_to_clipboard = <span class="nu0">0</span> <span class="co1"># automatically copy text to keyboard</span>
&nbsp;
<span class="co1"># Position</span>
<span class="co1">#####################################</span>
&nbsp;
<span class="co1"># Get screensize &lt; &lt; used for relative positioning</span>
display = gtk.<span class="me1">gdk</span>.<span class="me1">display_get_default</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
screen = display.<span class="me1">get_default_screen</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
x = screen.<span class="me1">get_width</span><span class="br0">&#40;</span><span class="br0">&#41;</span> - <span class="nu0">1</span>
y = screen.<span class="me1">get_height</span><span class="br0">&#40;</span><span class="br0">&#41;</span> - <span class="nu0">1</span>
&nbsp;
<span class="co1"># 0 for Automatic Placement</span>
<span class="st0">&quot;&quot;&quot;
x1 = 0
y1 = 0
x2 = 0
y2 = 0
x3 = 0
y3 = 0
&quot;&quot;&quot;</span>
<span class="co1"># Define Relative Position (assuming top-right)</span>
x1 = x-<span class="nu0">1</span>
y1 = <span class="nu0">12</span>
x2 = x1
y2 = y1 + <span class="nu0">100</span>
x3 = x-<span class="nu0">1</span>
y3 = <span class="nu0">12</span>
<span class="co1"># Define Static (1920 puts it on my second monitor)</span>
<span class="st0">&quot;&quot;&quot;
x1 = 1919
y1 = 12
x2 = x1
y2 = y1 + 100
x3 = 1920
y3 = 12
&quot;&quot;&quot;</span>
<span class="co1">#####################################</span>
&nbsp;
<span class="kw1">def</span> upload_cb<span class="br0">&#40;</span>n, action<span class="br0">&#41;</span>:
    <span class="kw1">assert</span> action == <span class="st0">&quot;upload&quot;</span> 
&nbsp;
    <span class="kw3">subprocess</span>.<span class="me1">call</span><span class="br0">&#40;</span><span class="br0">&#91;</span><span class="st0">&quot;scp&quot;</span>, <span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">join</span><span class="br0">&#40;</span>lfolder, f<span class="br0">&#41;</span>, <span class="st0">'%s@%s:%s'</span> <span class="sy0">%</span> <span class="br0">&#40;</span><span class="kw3">user</span>, host, hfolder<span class="br0">&#41;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>
&nbsp;
    <span class="co1"># setup URL in </span>
    <span class="kw1">if</span> copy_to_clipboard:
        clipboard = gtk.<span class="me1">clipboard_get</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
        clipboard.<span class="me1">set_text</span><span class="br0">&#40;</span>httplink + f<span class="br0">&#41;</span>
        <span class="co1"># make our data available to other applications</span>
        clipboard.<span class="me1">store</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
    <span class="co1"># Notification: Link for the clicking</span>
    <span class="kw1">if</span> popup_link:
        n3 = pynotify.<span class="me1">Notification</span><span class="br0">&#40;</span><span class="st0">&quot;Here is your link&quot;</span>,<span class="st0">&quot;&lt;a href='&quot;</span> + httplink + f + <span class="st0">&quot;'&gt;&quot;</span> + httplink + f + <span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>
&nbsp;
        helper = gtk.<span class="me1">Button</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
        icon = helper.<span class="me1">render_icon</span><span class="br0">&#40;</span>gtk.<span class="me1">STOCK_DIALOG_INFO</span>, gtk.<span class="me1">ICON_SIZE_DIALOG</span><span class="br0">&#41;</span>
        n3.<span class="me1">set_icon_from_pixbuf</span><span class="br0">&#40;</span>icon<span class="br0">&#41;</span>
&nbsp;
        n3.<span class="me1">set_urgency</span><span class="br0">&#40;</span>pynotify.<span class="me1">URGENCY_NORMAL</span><span class="br0">&#41;</span>
        <span class="kw1">if</span> x3:
            n3.<span class="me1">set_hint</span><span class="br0">&#40;</span><span class="st0">&quot;x&quot;</span>, x3<span class="br0">&#41;</span>
        <span class="kw1">if</span> y3:
            n3.<span class="me1">set_hint</span><span class="br0">&#40;</span><span class="st0">&quot;y&quot;</span>, y3<span class="br0">&#41;</span>
        n3.<span class="me1">set_timeout</span><span class="br0">&#40;</span>t3<span class="br0">&#41;</span>
        n3.<span class="me1">connect</span><span class="br0">&#40;</span><span class="st0">&quot;closed&quot;</span>,closen3_cb<span class="br0">&#41;</span>
&nbsp;
        <span class="kw1">if</span> <span class="kw1">not</span> n3.<span class="me1">show</span><span class="br0">&#40;</span><span class="br0">&#41;</span>:
            <span class="kw1">print</span> <span class="st0">&quot;Failed to send notification&quot;</span>
            <span class="kw3">sys</span>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>
&nbsp;
        closen1_cb<span class="br0">&#40;</span>n1<span class="br0">&#41;</span>
        closen2_cb<span class="br0">&#40;</span>n2<span class="br0">&#41;</span>
&nbsp;
    gtk.<span class="me1">main_quit</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    <span class="kw3">sys</span>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>
&nbsp;
<span class="co1"># Notification 1 was closed</span>
<span class="kw1">def</span> closen1_cb<span class="br0">&#40;</span>n<span class="br0">&#41;</span>:
    n1.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    <span class="kw1">if</span> screenshot_preview:
        n2.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    gtk.<span class="me1">main_quit</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="co1"># Notification 2 was closed</span>
<span class="kw1">def</span> closen2_cb<span class="br0">&#40;</span>n<span class="br0">&#41;</span>:
    n2.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    gtk.<span class="me1">main_quit</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="co1"># Notification 2 was closed</span>
<span class="kw1">def</span> closen3_cb<span class="br0">&#40;</span>n<span class="br0">&#41;</span>:
    n3.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    gtk.<span class="me1">main_quit</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="co1"># The Ignore button was clicked</span>
<span class="kw1">def</span> ignore_cb<span class="br0">&#40;</span>n, action<span class="br0">&#41;</span>:
    <span class="kw1">assert</span> action == <span class="st0">&quot;ignore&quot;</span>
&nbsp;
    closen1_cb<span class="br0">&#40;</span>n1<span class="br0">&#41;</span>
    closen2_cb<span class="br0">&#40;</span>n2<span class="br0">&#41;</span>
    gtk.<span class="me1">main_quit</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="co1"># Main</span>
<span class="kw1">def</span> main<span class="br0">&#40;</span><span class="br0">&#41;</span>:
    gtk.<span class="me1">main</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="co1"># Init</span>
<span class="kw1">if</span> __name__ == <span class="st0">'__main__'</span>:
    <span class="kw1">if</span> <span class="kw1">not</span> pynotify.<span class="me1">init</span><span class="br0">&#40;</span><span class="st0">&quot;Notifier 'scp' Option&quot;</span><span class="br0">&#41;</span>:
        <span class="kw3">sys</span>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>
&nbsp;
    <span class="co1"># Get latest file and build uri</span>
    start = <span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">abspath</span><span class="br0">&#40;</span>lfolder<span class="br0">&#41;</span>
    f = <span class="kw2">max</span><span class="br0">&#40;</span><span class="br0">&#91;</span><span class="br0">&#40;</span><span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">getmtime</span><span class="br0">&#40;</span><span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">join</span><span class="br0">&#40;</span>start,p<span class="br0">&#41;</span><span class="br0">&#41;</span>,p<span class="br0">&#41;</span>
         <span class="kw1">for</span> p <span class="kw1">in</span> <span class="kw3">os</span>.<span class="me1">listdir</span><span class="br0">&#40;</span>start<span class="br0">&#41;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>
    uri = lfolder + f
&nbsp;
    <span class="co1"># Notification: Upload to Server</span>
    n1 = pynotify.<span class="me1">Notification</span><span class="br0">&#40;</span><span class="st0">&quot;Upload to Server?&quot;</span>,<span class="st0">&quot;Copy the file '&quot;</span> + f + <span class="st0">&quot;' to the server?&quot;</span><span class="br0">&#41;</span>
&nbsp;
    helper = gtk.<span class="me1">Button</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    icon = helper.<span class="me1">render_icon</span><span class="br0">&#40;</span>gtk.<span class="me1">STOCK_DIALOG_QUESTION</span>, gtk.<span class="me1">ICON_SIZE_DIALOG</span><span class="br0">&#41;</span>
    n1.<span class="me1">set_icon_from_pixbuf</span><span class="br0">&#40;</span>icon<span class="br0">&#41;</span>
&nbsp;
    n1.<span class="me1">set_urgency</span><span class="br0">&#40;</span>pynotify.<span class="me1">URGENCY_NORMAL</span><span class="br0">&#41;</span>
    <span class="kw1">if</span> x1:
        n1.<span class="me1">set_hint</span><span class="br0">&#40;</span><span class="st0">&quot;x&quot;</span>, x1<span class="br0">&#41;</span>
    <span class="kw1">if</span> y1:
        n1.<span class="me1">set_hint</span><span class="br0">&#40;</span><span class="st0">&quot;y&quot;</span>, y1<span class="br0">&#41;</span>
    n1.<span class="me1">set_timeout</span><span class="br0">&#40;</span>t1<span class="br0">&#41;</span>
    n1.<span class="me1">add_action</span><span class="br0">&#40;</span><span class="st0">&quot;upload&quot;</span>, <span class="st0">&quot;Yes, Upload&quot;</span>, upload_cb<span class="br0">&#41;</span>
    n1.<span class="me1">add_action</span><span class="br0">&#40;</span><span class="st0">&quot;ignore&quot;</span>, <span class="st0">&quot;Ignore&quot;</span>, ignore_cb<span class="br0">&#41;</span>
    n1.<span class="me1">connect</span><span class="br0">&#40;</span><span class="st0">&quot;closed&quot;</span>,closen1_cb<span class="br0">&#41;</span>
&nbsp;
    <span class="kw1">if</span> <span class="kw1">not</span> n1.<span class="me1">show</span><span class="br0">&#40;</span><span class="br0">&#41;</span>:
        <span class="kw1">print</span> <span class="st0">&quot;Failed to send notification&quot;</span>
        <span class="kw3">sys</span>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>
&nbsp;
    <span class="co1"># Notification: Screenshot Preview</span>
    <span class="kw1">if</span> screenshot_preview:
        n2 = pynotify.<span class="me1">Notification</span><span class="br0">&#40;</span><span class="st0">&quot;Screenshot Preview&quot;</span>, <span class="st0">&quot;&quot;</span>, uri<span class="br0">&#41;</span>
        n2.<span class="me1">set_urgency</span><span class="br0">&#40;</span>pynotify.<span class="me1">URGENCY_LOW</span><span class="br0">&#41;</span>
        <span class="kw1">if</span> x2:
            n2.<span class="me1">set_hint</span><span class="br0">&#40;</span><span class="st0">&quot;x&quot;</span>, x2<span class="br0">&#41;</span>
        <span class="kw1">if</span> y2:
            n2.<span class="me1">set_hint</span><span class="br0">&#40;</span><span class="st0">&quot;y&quot;</span>, y2<span class="br0">&#41;</span>
        n2.<span class="me1">set_timeout</span><span class="br0">&#40;</span>t2<span class="br0">&#41;</span>
        n2.<span class="me1">connect</span><span class="br0">&#40;</span><span class="st0">&quot;closed&quot;</span>,closen2_cb<span class="br0">&#41;</span>
&nbsp;
        <span class="kw1">if</span> <span class="kw1">not</span> n2.<span class="me1">show</span><span class="br0">&#40;</span><span class="br0">&#41;</span>:
            <span class="kw1">print</span> <span class="st0">&quot;Failed to send notification&quot;</span>
            <span class="kw3">sys</span>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>
&nbsp;
    main<span class="br0">&#40;</span><span class="br0">&#41;</span></pre></div></div>

<p>I also rigged up a quick gallery script to parse the incoming images http://interwebninja.com/screenshots/ &#8212; I used <a href="http://scriptandstyle.com/automatically-generate-a-photo-gallery-from-a-directory-of-images">AutoGeneratingGallery</a> for this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/06/26/scp-notifications-for-gnome-and-ubuntu-expanding-on-my-original-python-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv" length="2797703" type="video/ogg" />
		</item>
		<item>
		<title>Ubuntu Notifications (osd-notify) Sucks, notifications-daemon Rocks &#8211; Exploiting the Goodness with Compiz</title>
		<link>http://www.doknowevil.net/2010/06/25/ubuntu-notifications-osd-notify-sucks-notifications-daemon-rocks-exploiting-the-goodness-with-compiz/</link>
		<comments>http://www.doknowevil.net/2010/06/25/ubuntu-notifications-osd-notify-sucks-notifications-daemon-rocks-exploiting-the-goodness-with-compiz/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 04:47:40 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Compiz]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[markedwontfix]]></category>
		<category><![CDATA[notifications]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=677</guid>
		<description><![CDATA[Introduction The long name for this blog used to be &#8220;Tyler Mulligan&#8217;s Tips and Tricks for Increasing your Efficiency&#8220;. I love finding ways to increase my efficiency and let computers do the work while I focus on more interests aspects of what the computer is providing me with. When I recognize an issue, I find]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>The long name for this blog used to be &#8220;<a href="http://www.doknowevil.net" target="_blank">Tyler Mulligan&#8217;s Tips and Tricks for Increasing your Efficiency</a>&#8220;.  I love finding ways to increase my efficiency and let computers do the work while I focus on more interests aspects of what the computer is providing me with.  When I recognize an issue, I find a way to cut out time by streamlining the process for the most accurate repetition, like any programmer would/should/could.</p>
<p>I noticed myself taking a lot of screenshots with compiz&#8217; built in screenshot tool (I can hold a hotkey and drag a box to take newspaper style clippings).  This is very fast and simple, I highly recommend enabling this option and getting used to it.  However, I don&#8217;t care much for clicking around on clunky websites to upload images.</p>
<p>This is where my adventure starts&#8230; when I find out <a href="http://ubuntuforums.org/showthread.php?t=1517950" title="notify-osd doesn't display popup balloons">a very useful feature was deprecated and not replaced in Ubuntu</a>.  I don&#8217;t use the new notification area, it has too much I don&#8217;t need, I never liked the behavior of these new osd-notify notifications which I found out now are even more worthless (sorry team).</p>
<h2>Using Sane Notifications in Ubuntu</h2>
<p>After <a href="http://ubuntuforums.org/showpost.php?p=8559795&#038;postcount=8">reinstalling the GNOME default notifications system in Ubuntu</a> I was able to use SANE notifications that actually&#8230; KICK ASS!  I don&#8217;t understand how osd-notify is better than these which even comes with it&#8217;s own notification properties panel.  Maybe it&#8217;s an under the hood thing&#8230;</p>
<p>Regardless, there is no doubt in my mind that notifications that you hover, can still slightly see but click through but cannot perform any actions, even a close, are just plan stupid and annoying..</p>
<p><img src="http://interwebninja.com/compiz-screenshots/screenshot5.png" title="Screenshot taken with Tyler Mulligan's Notification 'scp' Option python script for ubuntu and other Linux based operating systems" /><br />
Screenshot of the script I ended up writing using the &#8220;better&#8221; notification system to ask me if I want to upload the screenshot I just took to the server.</p>
<h2>Linking the notifications</h2>
<p>I linked the notifications the following way:</p>
<p><img src="http://interwebninja.com/compiz-screenshots/screenshot3.png" title="Screenshot taken with Tyler Mulligan's Notification 'scp' Option python script for ubuntu and other Linux based operating systems" /></p>
<h2>Python Script for Notification that Prompts for File Upload to Server</h2>
<p>Knowing diddly squat about Python, I chugged forward with my classic notification popups that allow for interaction as it had the most activity around it and some examples available in /usr/share/doc/python-notify/examples/</p>
<p>I ended coming up with the following script thanks to some help from a few people in #python on irc.freenode.org</p>
<p>This is outside of the scope of this blogpost but this script assumes you have setup passwordless ssh to your server.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co1">#!/usr/bin/env python</span>
<span class="co1">#</span>
<span class="co1"># Title: Notification 'scp' Option</span>
<span class="co1"># Author: Tyler Mulligan (tyler@detrition.net)</span>
<span class="co1"># Date: 06/25/2010</span>
<span class="co1"># Description:</span>
<span class="co1"># Used in combination with an event, such as an action or cron</span>
<span class="co1"># the latest file from a folder will be scped to your server and will copy</span>
<span class="co1"># the http location of the that file to your clipboard</span>
<span class="co1">#</span>
<span class="co1"># Orginally developed to be piped to from compiz screenshot tool</span>
<span class="co1">#</span>
<span class="co1">#</span>
<span class="co1"># The MIT License</span>
<span class="co1">#</span>
<span class="co1"># Copyright (c) 2010 Tyler Mulligan</span>
<span class="co1">#</span>
<span class="co1"># Permission is hereby granted, free of charge, to any person obtaining a copy</span>
<span class="co1"># of this software and associated documentation files (the &quot;Software&quot;), to deal</span>
<span class="co1"># in the Software without restriction, including without limitation the rights</span>
<span class="co1"># to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<span class="co1"># copies of the Software, and to permit persons to whom the Software is</span>
<span class="co1"># furnished to do so, subject to the following conditions:</span>
<span class="co1">#</span>
<span class="co1"># The above copyright notice and this permission notice shall be included in</span>
<span class="co1"># all copies or substantial portions of the Software.</span>
<span class="co1">#</span>
<span class="co1"># THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<span class="co1"># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<span class="co1"># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<span class="co1"># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<span class="co1"># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<span class="co1"># OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span>
<span class="co1"># THE SOFTWARE</span>
<span class="co1">#</span>
&nbsp;
<span class="kw1">import</span> pygtk
pygtk.<span class="me1">require</span><span class="br0">&#40;</span><span class="st0">'2.0'</span><span class="br0">&#41;</span>
<span class="kw1">import</span> gtk
<span class="kw1">import</span> pynotify
<span class="kw1">import</span> <span class="kw3">sys</span>
<span class="kw1">import</span> <span class="kw3">os</span>
<span class="kw1">import</span> <span class="kw3">subprocess</span>
&nbsp;
<span class="kw3">user</span> = <span class="st0">&quot;user&quot;</span>
host = <span class="st0">&quot;server.com&quot;</span>
lfolder = <span class="st0">&quot;/home/user/screenshots/&quot;</span>
hfolder = <span class="st0">&quot;/home/remote_user/screenshots/&quot;</span>
httplink = <span class="st0">&quot;http://&quot;</span>+host+<span class="st0">&quot;/screenshots/&quot;</span>
timeout = <span class="nu0">5000</span>
&nbsp;
<span class="co1"># Set position</span>
display = gtk.<span class="me1">gdk</span>.<span class="me1">display_get_default</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
screen = display.<span class="me1">get_default_screen</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
x = screen.<span class="me1">get_width</span><span class="br0">&#40;</span><span class="br0">&#41;</span> - <span class="nu0">1</span>
y = screen.<span class="me1">get_height</span><span class="br0">&#40;</span><span class="br0">&#41;</span> - <span class="nu0">1</span>
<span class="co1">#x = 1919</span>
<span class="co1">#y = 12</span>
&nbsp;
<span class="kw1">def</span> upload_cb<span class="br0">&#40;</span>n, action<span class="br0">&#41;</span>:
    <span class="kw1">assert</span> action == <span class="st0">&quot;upload&quot;</span>
&nbsp;
    start = <span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">abspath</span><span class="br0">&#40;</span>lfolder<span class="br0">&#41;</span>
    f = <span class="kw2">max</span><span class="br0">&#40;</span><span class="br0">&#91;</span><span class="br0">&#40;</span><span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">getmtime</span><span class="br0">&#40;</span><span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">join</span><span class="br0">&#40;</span>start,x<span class="br0">&#41;</span><span class="br0">&#41;</span>,x<span class="br0">&#41;</span>
          <span class="kw1">for</span> x <span class="kw1">in</span> <span class="kw3">os</span>.<span class="me1">listdir</span><span class="br0">&#40;</span>start<span class="br0">&#41;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>
&nbsp;
	<span class="co1"># setup URL in clipboard</span>
    clipboard = gtk.<span class="me1">clipboard_get</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    clipboard.<span class="me1">set_text</span><span class="br0">&#40;</span>httplink + f<span class="br0">&#41;</span>
    <span class="co1"># make our data available to other applications</span>
    clipboard.<span class="me1">store</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
    <span class="kw3">os</span>.<span class="me1">system</span><span class="br0">&#40;</span><span class="st0">'scp &quot;%s&quot; &quot;%s@%s:%s&quot;'</span> <span class="sy0">%</span> <span class="br0">&#40;</span>lfolder + f, <span class="kw3">user</span>, host, hfolder<span class="br0">&#41;</span> <span class="br0">&#41;</span>.<span class="me1">wait</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
    n.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    gtk.<span class="me1">main_quit</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="kw1">def</span> ignore_cb<span class="br0">&#40;</span>n, action<span class="br0">&#41;</span>:
    <span class="kw1">assert</span> action == <span class="st0">&quot;ignore&quot;</span>
    n.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
    gtk.<span class="me1">main_quit</span><span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="kw1">if</span> __name__ == <span class="st0">'__main__'</span>:
    <span class="kw1">if</span> <span class="kw1">not</span> pynotify.<span class="me1">init</span><span class="br0">&#40;</span><span class="st0">&quot;Notifier 'scp' Option&quot;</span><span class="br0">&#41;</span>:
        <span class="kw3">sys</span>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>
&nbsp;
	<span class="co1"># Setup Popup</span>
    n = pynotify.<span class="me1">Notification</span><span class="br0">&#40;</span><span class="st0">&quot;Upload to Server?&quot;</span><span class="br0">&#41;</span>
    n.<span class="me1">set_urgency</span><span class="br0">&#40;</span>pynotify.<span class="me1">URGENCY_NORMAL</span><span class="br0">&#41;</span>
    n.<span class="me1">set_timeout</span><span class="br0">&#40;</span>timeout<span class="br0">&#41;</span>                          
    n.<span class="me1">set_category</span><span class="br0">&#40;</span><span class="st0">&quot;device&quot;</span><span class="br0">&#41;</span>
    n.<span class="me1">add_action</span><span class="br0">&#40;</span><span class="st0">&quot;upload&quot;</span>, <span class="st0">&quot;Yes, Upload&quot;</span>, upload_cb<span class="br0">&#41;</span>
    n.<span class="me1">add_action</span><span class="br0">&#40;</span><span class="st0">&quot;ignore&quot;</span>, <span class="st0">&quot;Ignore&quot;</span>, ignore_cb<span class="br0">&#41;</span>
&nbsp;
    <span class="co1"># Set position</span>
    n.<span class="me1">set_hint</span><span class="br0">&#40;</span><span class="st0">&quot;x&quot;</span>, x<span class="br0">&#41;</span>
    n.<span class="me1">set_hint</span><span class="br0">&#40;</span><span class="st0">&quot;y&quot;</span>, y<span class="br0">&#41;</span>
&nbsp;
    <span class="kw1">if</span> <span class="kw1">not</span> n.<span class="me1">show</span><span class="br0">&#40;</span><span class="br0">&#41;</span>:
        <span class="kw1">print</span> <span class="st0">&quot;Failed to send notification&quot;</span>
        <span class="kw3">sys</span>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>
&nbsp;
    gtk.<span class="me1">main</span><span class="br0">&#40;</span><span class="br0">&#41;</span></pre></div></div>

<p>edit: I updated the script with some position information &#8212; I love that I can put the notifications ANYWHERE on my screen.  I also variablized the timeout.</p>
<p>edit 2: Here is a video of my improved script in action &#8212; I&#8217;ll post the source later</p>
<p>http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv</p>
<h2>Going Beyond</h2>
<p>The Compiz example is just something that server my immediate needs.  The possibilities are however endless.  You can for example, link this script to a cron job asking you if you want to sync some other sort of file.  Or perhaps you&#8217;d like to add multiple buttons to give yourself a folder / server choice.</p>
<p>Happy hacking</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/06/25/ubuntu-notifications-osd-notify-sucks-notifications-daemon-rocks-exploiting-the-goodness-with-compiz/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://cankill.us/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv" length="687321" type="video/ogg" />
<enclosure url="http://interwebninja.com/videos/compiz-screenshot-piped-to-notification-daemon-for-upload.ogv" length="687321" type="video/ogg" />
		</item>
		<item>
		<title>Reseting your system wide cursor theme in ubuntu</title>
		<link>http://www.doknowevil.net/2010/05/11/reseting-your-system-wide-cursor-theme-in-ubuntu/</link>
		<comments>http://www.doknowevil.net/2010/05/11/reseting-your-system-wide-cursor-theme-in-ubuntu/#comments</comments>
		<pubDate>Wed, 12 May 2010 03:26:46 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[mouse]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=607</guid>
		<description><![CDATA[If you installed KDE in ubuntu (GNOME based), you may have noticed that when you log back into GNOME, you keep the KDE cursor theme. To fix this, use update-alternatives like so: 0025&#124;z@zentury ~$ sudo update-alternatives --config x-cursor-theme There are 7 choices for the alternative x-cursor-theme &#40;providing /usr/share/icons/default/index.theme&#41;. &#160; Selection Path Priority Status ------------------------------------------------------------ *]]></description>
			<content:encoded><![CDATA[<p>If you installed KDE in ubuntu (GNOME based), you may have noticed that when you log back into GNOME, you keep the KDE cursor theme.  To fix this, use update-alternatives like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">0025<span class="sy0">|</span>z<span class="sy0">@</span>zentury ~$ <span class="kw2">sudo</span> update-alternatives <span class="re5">--config</span> x-cursor-theme
There are <span class="nu0">7</span> choices <span class="kw1">for</span> the alternative x-cursor-theme <span class="br0">&#40;</span>providing <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>icons<span class="sy0">/</span>default<span class="sy0">/</span>index.theme<span class="br0">&#41;</span>.
&nbsp;
  Selection    Path                                     Priority   Status
<span class="re5">------------------------------------------------------------</span>
<span class="sy0">*</span> <span class="nu0">0</span>            <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>cursors<span class="sy0">/</span>oxy-white.theme          <span class="nu0">50</span>        auto mode
  <span class="nu0">1</span>            <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>cursors<span class="sy0">/</span>core.theme               <span class="nu0">30</span>        manual mode
  <span class="nu0">2</span>            <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>cursors<span class="sy0">/</span>handhelds.theme          <span class="nu0">20</span>        manual mode
  <span class="nu0">3</span>            <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>cursors<span class="sy0">/</span>oxy-white.theme          <span class="nu0">50</span>        manual mode
  <span class="nu0">4</span>            <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>cursors<span class="sy0">/</span>redglass.theme           <span class="nu0">20</span>        manual mode
  <span class="nu0">5</span>            <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>cursors<span class="sy0">/</span>whiteglass.theme         <span class="nu0">20</span>        manual mode
  <span class="nu0">6</span>            <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>icons<span class="sy0">/</span>DMZ-Black<span class="sy0">/</span>cursor.theme   <span class="nu0">30</span>        manual mode
  <span class="nu0">7</span>            <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>icons<span class="sy0">/</span>DMZ-White<span class="sy0">/</span>cursor.theme   <span class="nu0">50</span>        manual mode
&nbsp;
Press enter to keep the current choice<span class="br0">&#91;</span><span class="sy0">*</span><span class="br0">&#93;</span>, or <span class="kw3">type</span> selection number:</pre></div></div>

<p>press &#8220;7&#8243; for the default</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/05/11/reseting-your-system-wide-cursor-theme-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fastest way to install the media essentials in ubuntu</title>
		<link>http://www.doknowevil.net/2010/05/07/fastest-way-to-install-the-media-essentials-in-ubuntu/</link>
		<comments>http://www.doknowevil.net/2010/05/07/fastest-way-to-install-the-media-essentials-in-ubuntu/#comments</comments>
		<pubDate>Sat, 08 May 2010 02:37:13 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=593</guid>
		<description><![CDATA[If you&#8217;re coming from Windows, or like me, find yourself living in a live CD while you figure out which step went wrong; you&#8217;ll be interested in the essential media codecs, flash, java, Microsoft fonts, etc. I thought I&#8217;d share the way I did this as quickly as possible in in Ubuntu 10.04 using the]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re coming from Windows, or like me, find yourself living in a live CD while you figure out which step went wrong; you&#8217;ll be interested in the essential media codecs, flash, java, Microsoft fonts, etc.</p>
<p>I thought I&#8217;d share the way I did this as quickly as possible in in <a href="http://www.ubuntu.com" target="_blank">Ubuntu 10.04</a> using the command line.</p>
<p>Open up terminal, using ctrl+alt+t (Which I&#8217;m very happy about as this has been my default since 8.04). Alternativelty from the main menu -> Applications > Accessories > Terminal</p>
<p>Make a backup in case you&#8217;re scared, then remove the comments from repositories you need to unlock to access the restricted (proprietary) packages.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">ubuntu<span class="sy0">@</span>ubuntu:~$ <span class="kw2">sudo</span> <span class="kw2">cp</span> <span class="sy0">/</span>etc<span class="sy0">/</span>apt<span class="sy0">/</span>sources.list .
ubuntu<span class="sy0">@</span>ubuntu:~$ <span class="kw2">sudo</span> <span class="kw2">sed</span> <span class="re5">-i</span> <span class="st_h">'s/^# deb/deb/'</span> <span class="sy0">/</span>etc<span class="sy0">/</span>apt<span class="sy0">/</span>sources.list</pre></div></div>

<p>We do this be matching the first 2 characters with &#8216;# &#8216; and replacing them with &#8221; (nothing).  See the diff below (> indicate original lines, < are changed).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">&nbsp;
ubuntu<span class="sy0">@</span>ubuntu:~$ <span class="kw2">diff</span> sources.list <span class="sy0">/</span>etc<span class="sy0">/</span>apt<span class="sy0">/</span>sources.list
<span class="nu0">18</span>,23c18,<span class="nu0">23</span>
<span class="sy0">&lt;</span> <span class="co0"># deb http://archive.ubuntu.com/ubuntu lucid universe</span>
<span class="sy0">&lt;</span> <span class="co0"># deb-src http://archive.ubuntu.com/ubuntu lucid universe</span>
<span class="sy0">&lt;</span> <span class="co0"># deb http://archive.ubuntu.com/ubuntu lucid-updates universe</span>
<span class="sy0">&lt;</span> <span class="co0"># deb-src http://archive.ubuntu.com/ubuntu lucid-updates universe</span>
<span class="sy0">&lt;</span> <span class="co0"># deb http://security.ubuntu.com/ubuntu lucid-security universe</span>
<span class="sy0">&lt;</span> <span class="co0"># deb-src http://security.ubuntu.com/ubuntu lucid-security universe</span>
<span class="re5">---</span>
<span class="sy0">&gt;</span> deb http:<span class="sy0">//</span>archive.ubuntu.com<span class="sy0">/</span>ubuntu lucid universe
<span class="sy0">&gt;</span> deb-src http:<span class="sy0">//</span>archive.ubuntu.com<span class="sy0">/</span>ubuntu lucid universe
<span class="sy0">&gt;</span> deb http:<span class="sy0">//</span>archive.ubuntu.com<span class="sy0">/</span>ubuntu lucid-updates universe
<span class="sy0">&gt;</span> deb-src http:<span class="sy0">//</span>archive.ubuntu.com<span class="sy0">/</span>ubuntu lucid-updates universe
<span class="sy0">&gt;</span> deb http:<span class="sy0">//</span>security.ubuntu.com<span class="sy0">/</span>ubuntu lucid-security universe
<span class="sy0">&gt;</span> deb-src http:<span class="sy0">//</span>security.ubuntu.com<span class="sy0">/</span>ubuntu lucid-security universe
<span class="nu0">30</span>,35c30,<span class="nu0">35</span>
<span class="sy0">&lt;</span> <span class="co0"># deb http://archive.ubuntu.com/ubuntu lucid multiverse</span>
<span class="sy0">&lt;</span> <span class="co0"># deb-src http://archive.ubuntu.com/ubuntu lucid multiverse</span>
<span class="sy0">&lt;</span> <span class="co0"># deb http://archive.ubuntu.com/ubuntu lucid-updates multiverse</span>
<span class="sy0">&lt;</span> <span class="co0"># deb-src http://archive.ubuntu.com/ubuntu lucid-updates multiverse</span>
<span class="sy0">&lt;</span> <span class="co0"># deb http://security.ubuntu.com/ubuntu lucid-security multiverse</span>
<span class="sy0">&lt;</span> <span class="co0"># deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse</span>
<span class="re5">---</span>
<span class="sy0">&gt;</span> deb http:<span class="sy0">//</span>archive.ubuntu.com<span class="sy0">/</span>ubuntu lucid multiverse
<span class="sy0">&gt;</span> deb-src http:<span class="sy0">//</span>archive.ubuntu.com<span class="sy0">/</span>ubuntu lucid multiverse
<span class="sy0">&gt;</span> deb http:<span class="sy0">//</span>archive.ubuntu.com<span class="sy0">/</span>ubuntu lucid-updates multiverse
<span class="sy0">&gt;</span> deb-src http:<span class="sy0">//</span>archive.ubuntu.com<span class="sy0">/</span>ubuntu lucid-updates multiverse
<span class="sy0">&gt;</span> deb http:<span class="sy0">//</span>security.ubuntu.com<span class="sy0">/</span>ubuntu lucid-security multiverse
<span class="sy0">&gt;</span> deb-src http:<span class="sy0">//</span>security.ubuntu.com<span class="sy0">/</span>ubuntu lucid-security multiverse
<span class="sy0">&gt;</span>
&nbsp;
&nbsp;
<span class="sy0">&lt;</span>pre <span class="re2">lang</span>=<span class="st0">&quot;bash&quot;</span><span class="sy0">&gt;</span></pre></div></div>

<p>Now that we uncommented these lines, they will be read next time we update, so lets go ahead and do that now.  Once that is done, we can install the extras.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">ubuntu<span class="sy0">@</span>ubuntu:~$ <span class="kw2">sudo</span> <span class="kw2">apt-get</span> update
ubuntu<span class="sy0">@</span>ubuntu:~$ <span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> ubuntu-restricted-extras</pre></div></div>

<p>Rock and roll.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/05/07/fastest-way-to-install-the-media-essentials-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RabbitVCS is the new Nautilus SVN</title>
		<link>http://www.doknowevil.net/2010/05/04/rabbitvcs-is-the-new-nautilus-svn/</link>
		<comments>http://www.doknowevil.net/2010/05/04/rabbitvcs-is-the-new-nautilus-svn/#comments</comments>
		<pubDate>Wed, 05 May 2010 01:59:14 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[nautilus]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=579</guid>
		<description><![CDATA[I should have written about this months ago. Readers have replied to my previous post about nautilus svn, which I claimed to be the first that didn&#8217;t suck. This is the evolution of it, RabbitVCS (Version Control System), which aims to use the same intuitive, integrated gui for other version control systems, such as git]]></description>
			<content:encoded><![CDATA[<p>I should have written about this months ago.  Readers have <a href="http://www.doknowevil.net/2009/04/28/nautilussvn-finally-an-svn-gui-for-linux-that-doesnt-totally-suck/">replied to my previous post about nautilus svn</a>, which I claimed to be the first that didn&#8217;t suck.  This is the evolution of it, <a href="http://www.rabbitvcs.org">RabbitVCS (Version Control System)</a>, which aims to use the same intuitive, integrated gui for other version control systems, such as <a href="http://en.wikipedia.org/wiki/Git_%28software%29" target="_blank">git</a> (check the <a href="http://wiki.rabbitvcs.org/wiki/about/roadmap">rabbitvcs roadmap</a> for details on expected support for different versioning system.</p>
<p><a href="http://www.doknowevil.net/wp-content/uploads/2010/05/context_menu.png" rel="shadowbox[post-579];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2010/05/context_menu.png" alt="" title="context_menu" width="827" height="559" class="alignnone size-full wp-image-580" /></a><br />
credit to rabbitvcs for the screenshot</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/05/04/rabbitvcs-is-the-new-nautilus-svn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Packages for nautilus you wish were installed by default in ubuntu</title>
		<link>http://www.doknowevil.net/2010/05/04/packages-for-nautilus-you-wish-were-installed-by-default-in-ubuntu/</link>
		<comments>http://www.doknowevil.net/2010/05/04/packages-for-nautilus-you-wish-were-installed-by-default-in-ubuntu/#comments</comments>
		<pubDate>Wed, 05 May 2010 01:46:27 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Application Management]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Freeware]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=550</guid>
		<description><![CDATA[Intro Thanks to a tip I picked up at Tombuntu about nautilus, after following up on a trick to add files to mocp through nautilus scripts trackback link from Hilltop Yodler (great article), when doing a google search for GiS for nautilus-actions (apt-get install nautilus-actions). I learned about 3 kick ass additions to the nautilus]]></description>
			<content:encoded><![CDATA[<h2>Intro</h2>
<p>Thanks to <a href="http://tombuntu.com/index.php/2007/07/12/install-useful-nautilus-menu-items/" title="See code block below" target="_blank">a tip I picked up at Tombuntu about nautilus</a>, after following up on a <a href="http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp/">trick to add files to mocp through nautilus scripts</a> <a href="http://www.hilltopyodeler.com/blog/?p=279" title="more tricks to add files to with nautilus">trackback link from Hilltop Yodler (great article)</a>, when doing a google search for <a href="http://images.google.com/imgres?imgurl=http://linux.softpedia.com/screenshots/Nautilus-actions_2.png&#038;imgrefurl=http://linux.softpedia.com/progScreenshots/Nautilus-actions-Screenshot-4311.html&#038;usg=__HIOtTlLu0P59ZnwHEDslrgllk-Y=&#038;h=478&#038;w=610&#038;sz=166&#038;hl=en&#038;start=1&#038;sig2=To1WEzfgc0FLl-hS6ZIqjQ&#038;um=1&#038;itbs=1&#038;tbnid=jucsR2NLXFKcuM:&#038;tbnh=107&#038;tbnw=136&#038;prev=/images%3Fq%3Dnautilus%2Bactions%26um%3D1%26hl%3Den%26client%3Dfirefox-a%26sa%3DN%26rls%3Dcom.ubuntu:en-US:official%26tbs%3Disch:1&#038;ei=tLrgS-bUNcL98Ab0hPmlBw" title="LOL, this url _ What's a GiS for?">GiS for</a> <a href="http://www.grumz.net/?q=node/387" title="Nautilus Actions _ nautilus-actions">nautilus-actions</a> (apt-get install nautilus-actions).  I learned about 3 kick ass additions to the nautilus menu.  I realized <a href="http://fedoraproject.org/" target="_blank">Fedora Linux</a> and <a href="http://www.linuxmint.com/" target="_blank">Linux Mint</a> had some of these in their context menus but didn&#8217;t make the connection to <a href="http://www.ubuntu.com" target="_blank">ubuntu</a> until now.</p>
<h2>On with the Show</h2>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> nautilus-open-terminal nautilus-image-converter nautilus-gksu</pre></div></div>

<p>for some kick ass options in the context (right click) menu of nautilus (your default file manager in ubuntu). For more information, check out the tombuntu article I linked above.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">pkill nautilus</pre></div></div>

<p>to restart nautilus and have the new packages in your context menu</p>
<h2>More</h2>
<p>If you&#8217;re interested in this, you&#8217;ll probably also like <a href="http://www.doknowevil.net/2010/05/04/adding-context-right-click-menu-options-to-nautilus-ubuntus-default-file-manager-with-nautilus-actions">my article about nautilus-actions</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/05/04/packages-for-nautilus-you-wish-were-installed-by-default-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding context (right click) menu options to nautilus (Ubuntu&#8217;s default file manager) with nautilus-actions</title>
		<link>http://www.doknowevil.net/2010/05/04/adding-context-right-click-menu-options-to-nautilus-ubuntus-default-file-manager-with-nautilus-actions/</link>
		<comments>http://www.doknowevil.net/2010/05/04/adding-context-right-click-menu-options-to-nautilus-ubuntus-default-file-manager-with-nautilus-actions/#comments</comments>
		<pubDate>Wed, 05 May 2010 01:46:22 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Application Management]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[nautilus]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=562</guid>
		<description><![CDATA[Intro Previously, I had written about enqueuing files with nautilus scripts. Since then, I have learned (and forgotten about) nautilus-actions. Which is a similar way to attack the issue but it using a more intuitive and decoration approach, as well as having the ability to be on the first level of the context menu hierarchy.]]></description>
			<content:encoded><![CDATA[<h2>Intro</h2>
<p>Previously, I had <a href="http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp">written about enqueuing files with nautilus scripts</a>.  Since then, I have learned (and forgotten about) nautilus-actions.  Which is a similar way to attack the issue but it using a more intuitive and decoration approach, as well as having the ability to be on the first level of the context menu hierarchy.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> nautilus-actions
nautilus-actions-config</pre></div></div>

<p>The approach to getting the example of enqueuing files to mocp accomplished is a bit different using this approach as you don&#8217;t need to go through the script as you did before (though you can if you want, it&#8217;s an unnecessary step).  Here, as my screenshot shows, I directly call mocp from /usr/bin with the -a flag and use the $M variable the legend provided me with to pass a list of files and their full paths to mocp.</p>
<p><a href="http://www.doknowevil.net/wp-content/uploads/2010/05/enqueue-to-moc-with-nautilus-actions.png" rel="shadowbox[post-562];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2010/05/enqueue-to-moc-with-nautilus-actions-1024x640.png" alt="" title="enqueue-to-moc-with-nautilus-actions" width="1024" height="640" class="alignnone size-large wp-image-570" /></a></p>
<p>You&#8217;ll also want to change the conditions on the Conditions tab.  I set it to allow multiple files from both folders and files.  The default is to allow only a single file.</p>
<p><a href="http://www.doknowevil.net/wp-content/uploads/2010/05/nautilus-actions_conditions.png" rel="shadowbox[post-562];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2010/05/nautilus-actions_conditions.png" alt="" title="nautilus-actions_conditions" width="460" height="430" class="alignnone size-full wp-image-571" /></a></p>
<h2>More</h2>
<p>This article was inspired by <a href="http://www.hilltopyodeler.com/blog/?p=279">Making Life Easier With Scripts For Nautilus</a>. If you&#8217;re interested in this article, you&#8217;ll probably also like <a href="http://www.doknowevil.net/2010/05/04/apackages-for-nautilus-you-wish-were-installed-by-default-in-ubuntu">my article about nautilus packages you wish were installed by default in ubuntu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/05/04/adding-context-right-click-menu-options-to-nautilus-ubuntus-default-file-manager-with-nautilus-actions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>If nvidia-settings cannot save to xorg.conf, do this</title>
		<link>http://www.doknowevil.net/2010/02/11/if-nvidia-settings-cannot-save-to-xorgconf-do-this/</link>
		<comments>http://www.doknowevil.net/2010/02/11/if-nvidia-settings-cannot-save-to-xorgconf-do-this/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 00:12:47 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Freeware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=513</guid>
		<description><![CDATA[If you&#8217;re using ubuntu and having trouble with nvidia-settings saving to the /etc/X11/xorg.conf file, you may find the following tip helpful in relieving that annoyance. Looking for something interesting when I login to one of my servers, I decided to whip up the following script I appended to my ~/.bashrc file. close nvidia-settings in terminal:]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using ubuntu and having trouble with nvidia-settings saving to the /etc/X11/xorg.conf file, you may find the following tip helpful in relieving that annoyance.<br />
Looking for something interesting when I login to one of my servers, I decided to whip up the following script I appended to my ~/.bashrc file.</p>
<p>close nvidia-settings</p>
<p>in terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> <span class="kw2">mv</span> <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>xorg.conf <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>xorg.conf.backup
<span class="kw2">sudo</span> gedit <span class="sy0">/</span>etc<span class="sy0">/</span>X11<span class="sy0">/</span>xorg.conf</pre></div></div>

<p>paste the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">Section <span class="st0">&quot;Device&quot;</span>
    Identifier     <span class="st0">&quot;Configured Video Device&quot;</span>
    Driver         <span class="st0">&quot;nvidia&quot;</span>
EndSection</pre></div></div>

<p>save and close.</p>
<p>back to terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="kw2">sudo</span> nvidia-settings</pre></div></div>

<p>and save the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/02/11/if-nvidia-settings-cannot-save-to-xorgconf-do-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random cow(ish) animals preaching quotes on Ubuntu 9.10</title>
		<link>http://www.doknowevil.net/2010/02/03/random-cowish-animals-preaching-quotes-on-ubuntu-910/</link>
		<comments>http://www.doknowevil.net/2010/02/03/random-cowish-animals-preaching-quotes-on-ubuntu-910/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 01:02:01 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cowsay]]></category>
		<category><![CDATA[fortune]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=521</guid>
		<description><![CDATA[Looking for something interesting when I login to one of my servers, I decided to whip up the following script I appended to my ~/.bashrc file. # fortune and cowsay are needed for the snippet to work, I had to install these first sudo apt-get install fortune cowsay COWDIR=/usr/share/cowsay/cows/; COWNUM=$&#40;&#40;$RANDOM%$&#40;ls $COWDIR &#124; wc -l&#41;&#41;&#41;; COWFILE=$&#40;ls]]></description>
			<content:encoded><![CDATA[<p>Looking for something interesting when I login to one of my servers, I decided to whip up the following script I appended to my ~/.bashrc file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co0"># fortune and cowsay are needed for the snippet to work, I had to install these first</span>
<span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> fortune cowsay</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="re2">COWDIR</span>=<span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>cowsay<span class="sy0">/</span>cows<span class="sy0">/</span>; <span class="re2">COWNUM</span>=$<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re1">$RANDOM</span><span class="sy0">%</span>$<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$COWDIR</span> <span class="sy0">|</span> <span class="kw2">wc</span> -l<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="re2">COWFILE</span>=$<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$COWDIR</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-n</span> <span class="st_h">''</span><span class="re1">$COWNUM</span><span class="st_h">'p'</span><span class="br0">&#41;</span>; fortune <span class="sy0">|</span> cowsay <span class="re5">-f</span> <span class="re1">$COWFILE</span></pre></div></div>

<p>UPDATE:</p>
<p>Suggested by MrBougo, a shorter but perhaps more process intensive method:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;">fortune <span class="sy0">|</span> cowsay <span class="re5">-f</span> $<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>cowsay<span class="sy0">/</span>cows<span class="sy0">/</span> <span class="sy0">|</span> shuf <span class="sy0">|</span> <span class="kw2">head</span> -n1<span class="br0">&#41;</span></pre></div></div>

<div id="attachment_523" class="wp-caption alignnone" style="width: 1342px"><a href="http://www.doknowevil.net/wp-content/uploads/2010/02/screenshot1.png" rel="shadowbox[post-521];player=img;"><img src="http://www.doknowevil.net/wp-content/uploads/2010/02/screenshot1.png" alt="random cowsay fortune" title="random cowsay fortune" width="1332" height="850" class="size-full wp-image-523" /></a><p class="wp-caption-text">random cowsay fortune</p></div>
<p>Breaking down the script, the first 3 parts create variables and the last command executes the cowsay and quote.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co0"># defines the directory of the cow files</span>
<span class="re2">COWDIR</span>=<span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>cowsay<span class="sy0">/</span>cows<span class="sy0">/</span>;
&nbsp;
<span class="co0"># Get a random number limited to the number of files in the directory, making clever use of % (mod) and adding 1 to make sure it doesn't return 0</span>
<span class="re2">COWNUM</span>=$<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re1">$RANDOM</span><span class="sy0">%</span>$<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$COWDIR</span> <span class="sy0">|</span> <span class="kw2">wc</span> -l<span class="br0">&#41;</span><span class="br0">&#41;</span>+<span class="nu0">1</span><span class="br0">&#41;</span>;
&nbsp;
<span class="co0"># list the contents of the cow dir again, pipe to sed and use the number as a random line to get the name of a file</span>
<span class="re2">COWFILE</span>=$<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$COWDIR</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-n</span> <span class="st_h">''</span><span class="re1">$COWNUM</span><span class="st_h">'p'</span><span class="br0">&#41;</span>;
&nbsp;
<span class="co0"># use fortune to get a quote, pipe to cowsay and use the file as defined above</span>
fortune <span class="sy0">|</span> cowsay <span class="re5">-f</span> <span class="re1">$COWFILE</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2010/02/03/random-cowish-animals-preaching-quotes-on-ubuntu-910/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Nautilus Scripting Abilities to Integrate Right Click File Enqueues with mocp</title>
		<link>http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp/</link>
		<comments>http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 15:09:20 +0000</pubDate>
		<dc:creator>Tyler Mulligan</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.doknowevil.net/?p=508</guid>
		<description><![CDATA[Using moc player can prove to be both beneficial and challenging. I&#8217;ve found myself going back to exaile for a few hours on random days for the simplicity in file management via a GUI. Since I prefer to use a single media player and mocp is light weight and helpful in so many other ways]]></description>
			<content:encoded><![CDATA[<p>Using <a href="http://www.doknowevil.net/2009/07/15/the-easy-way-to-listen-to-internt-radio-in-ubuntu/">moc player</a> can prove to be both beneficial and challenging.  I&#8217;ve found myself going back to exaile for a few hours on random days for the simplicity in file management via a GUI.  Since I prefer to use a single media player and mocp is light weight and helpful in so many other ways to me&#8230; I knew I needed a solution.  It dawned on me just today how simple that solution could be with nautilus scripts.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #ccc; font: 12px Consolas, Lucida Console, Monaco, monospace;"><span class="co0">#!/bin/bash</span>
<span class="co0"># Enqueue with mocp</span>
<span class="co0"># by Tyler &quot;-z-&quot; Mulligan</span>
<span class="co0">#</span>
<span class="co0"># This is a nautilus script.  When placed in ~/.gnome2/nautilus-scripts</span>
<span class="co0"># and chmod +x you will have the ability to right click &gt;&gt; enqueue files</span>
<span class="co0"># or directories in mocp.</span>
<span class="co0">#</span>
&nbsp;
mocp <span class="re5">-a</span> <span class="st0">&quot;$@&quot;</span></pre></div></div>

<p>Some other tips&#8230; [ and ] silently skip back and forward respectively at a rate of 5sec per second held&#8230; this beats the left and arrows which work interactively at 1sec per sec.</p>
<p>? and h bring up the help, don&#8217;t forget this.  Use this, learn the commands that work for you and happy listening.</p>
<p>Thanks to MrBougo again for helping me simplify the script further&#8230; I was originally using a for loop which is unnecessary as the quotes will help the variable expansion and mocp -a can accept multiple files/folders.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doknowevil.net/2009/11/08/using-nautilus-scripting-abilities-to-integrate-right-click-file-enqueues-with-mocp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
