<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[CrunchBang Linux Forums - Dynamic places (pipe menu)]]></title>
		<link>http://crunchbanglinux.org/forums/topic/373/dynamic-places-pipe-menu/</link>
		<description><![CDATA[The most recent posts in Dynamic places (pipe menu).]]></description>
		<lastBuildDate>Thu, 23 Sep 2010 20:09:48 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/86886/#p86886</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>@vsbladz</p><p><a href="http://crunchbanglinux.org/wiki/howto/set_thunar_as_default_filemanager?s">http://crunchbanglinux.org/wiki/howto/s &#133; emanager?s</a>[]=places#editing_the_places_pipe_menu</p>]]></description>
			<author><![CDATA[dummy@example.com (anonymous)]]></author>
			<pubDate>Thu, 23 Sep 2010 20:09:48 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/86886/#p86886</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/86864/#p86864</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>im guessing youre using 9.04 as thunar is already default in statler, in that case its in /usr/bin/crunchbang I believe (could be wrong but its one of very few directories in /usr/bin so not too hard to find)</p><p>there should be a filemanager variable in the script the probably specifies pcmanfm currently, change that to thunar to get it working.</p><p>note: im on statler and using a non standard places menu, so sorry for not being more specific.</p>]]></description>
			<author><![CDATA[dummy@example.com (benj1)]]></author>
			<pubDate>Thu, 23 Sep 2010 18:39:25 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/86864/#p86864</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/86777/#p86777</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>MY &quot;Places&quot; menu was working fine until I replaced my FileManager with Thunar. Then I noticed my &quot;Places&quot; menu was not working. Where would I go to fix this. Thanks</p>]]></description>
			<author><![CDATA[dummy@example.com (vsbladz)]]></author>
			<pubDate>Wed, 22 Sep 2010 23:06:53 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/86777/#p86777</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/22289/#p22289</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>Hi</p><p>i&#039;ve tweaked this script a little to be used for any folder (my datas are not in my home). I wanted to list all my video sub-folder.<br />Hey it&#039;s the 1st time i use python !<br /></p><div class="codebox"><pre><code>#!/usr/bin/env python
# Dynamic places menu generator for openbox
# Uses a list of parent directories to provide a menu of subdirectories
# After removing any entries found in an ignore list
#
#
# Originally created by: Kev at http://crunchbanglinux.org/forums/topic/373/dynamic-places-pipe-menu/
#
#
# 1. Save this script to a place you prefer (mine is in ~/.config/openbox/scripts/)
# 2. Make it executable
# 3. Insert a line into your ~/.config/openbox/menu.xml like:
#    &lt;menu execute=&quot;perl ~/.config/openbox/scripts/places.py menu&quot; id=&quot;pipe-places&quot; label=&quot;Places&quot;/&gt;
# 4. Call the pipe-menu in your menu by adding the following line to the same file:
#    &lt;menu id=&quot;pipe-places&quot;/&gt;
# 5. Reconfigure OpenBox
# 6. You&#039;re done
#
# Important variables if you want to customise the generated menu:
#    manager - File manager which you want to use (nautilus, thunar, pcmanfm, rox-filer, konqueror, dolphin, etc).
#    dirs - The script lists and displays the subdirectories of these directories
#    ignore - Any item exactly matching an entry in this list will not be displayed
#    items - If you want to add a single directory entry to the menu you can do it here 
#

import glob
import fnmatch
#from os.path import expanduser

# File manager you want to use to open directories
manager = &quot;thunar&quot;

# User home directory. If you hard code this location instead of relying on
# expanduser() then you can remove its import above
# home = expanduser(&#039;~&#039;)
# the folder **you** want (in this cas my videos folder) 
folder = &#039;/mnt/data/data/Videos&#039; 

# List of directories whose subdirectories we want to display (change Home to folder , for easier reading)
dirs = [folder]

# List of directories to ignore
# Shell-style wildcards as used by fnmatch are supported
ignore = [&#039;/media/cdrom0&#039;]

# Our list of menu items
# If you want to add single directories to the menu without including 
# all of their subdirs then put them in here
items = []

# Iterate through dirs 
for dir in dirs:
    # Get a list of subdirectories for each dir
    subdirs = glob.glob(dir + &#039;/*/&#039;)
    # Alphabetise subdirs. Sorting here is less efficient but preserves 
    # directory order specified above. If this doesn&#039;t matter to you then
    # remove this line and uncomment &quot;items.sort(key=str.lower)&quot; below
    subdirs.sort(key=str.lower)
    # Append each subdir to the items list
    for sub in subdirs:
        # Replace full path to your folder to what you want , here : nothing
        sub = sub.replace(folder, &#039;&#039;)
        # Strip trailing / characters
        sub = sub.rstrip(&#039;/&#039;)    
        sub = sub.replace(&#039;/&#039;, &#039;&#039;)
        items.append(sub)

# Iterate through ignore list and remove matches from items
for i in ignore:
    matches = fnmatch.filter(items, i)
    for m in matches:
        try:
            items.remove(m)
        except ValueError:
            pass

# Alphabetise directory list. Read comment for sort() above before uncommenting
#items.sort(key=str.lower)

# Output xml for the openbox menu
print &#039;&lt;openbox_pipe_menu&gt;&#039;
# Each item becomes a menu entry
for i in items:
    print &#039;&lt;item label=&quot;&#039; + i + &#039;&quot;&gt;&#039;
    print &#039;&lt;action name=&quot;Execute&quot;&gt;&#039;
    print &#039;&lt;execute&gt;&#039;
    print manager + &quot; &quot; + folder +&quot;/&quot;+ i
    print &#039;&lt;/execute&gt;&#039;
    print &#039;&lt;/action&gt;&#039;
    print &#039;&lt;/item&gt;&#039;
print &#039;&lt;/openbox_pipe_menu&gt;&#039;</code></pre></div><p>By the way my 1st sub-folder doesn&#039;t load with thunar, any idea ?</p>]]></description>
			<author><![CDATA[dummy@example.com (leolana)]]></author>
			<pubDate>Mon, 18 May 2009 17:28:11 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/22289/#p22289</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/12403/#p12403</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>Sorry about the lack of updates everyone. I&#039;ve made a few small changes to the script, updated the first post with details and fixed the download links. As always, comments and extra fixes are welcome.</p><p>The perl script is nice. It&#039;s pretty much how I&#039;ve been planning to implement a tree view, and now that I have time again I&#039;ll have a go at something similar. Not because I want to displace the current default, just because there are a few tweaks I&#039;d like to make, and it&#039;s easier for me to do in python than perl.</p>]]></description>
			<author><![CDATA[dummy@example.com (kev)]]></author>
			<pubDate>Thu, 26 Feb 2009 02:44:52 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/12403/#p12403</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/12055/#p12055</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>The 8.10.02 releases all come with a pre-installed &quot;places&quot; pipemenu. It is not the same menu which was originally posted here, but a popular alternative written in Perl. I have <a href="http://crunchbanglinux.org/pastebin/193">pasted it here</a> for anyone who is interested. :)</p>]]></description>
			<author><![CDATA[dummy@example.com (corenominal)]]></author>
			<pubDate>Mon, 23 Feb 2009 00:11:47 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/12055/#p12055</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/12051/#p12051</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>Hi, I have reinstalled CrunchBang on my Eee 900 with the latest CrunchEee and I was wondering if this hack is enabled by default on this edition?</p><p>I ask this because I have noticed several enchantments already enabled by default already.</p>]]></description>
			<author><![CDATA[dummy@example.com (kimme)]]></author>
			<pubDate>Sun, 22 Feb 2009 23:50:52 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/12051/#p12051</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/8284/#p8284</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>It is due to the loss of a lot of pastebin material. Corenominal got it fixed where &#039;forever&#039; really means forever, but we still lost a good bit of material.</p><p>I think that is included by default in the 02 release. Maybe someone could link it up in the pastebin.</p><p>Michael</p>]]></description>
			<author><![CDATA[dummy@example.com (michaelramm)]]></author>
			<pubDate>Fri, 30 Jan 2009 17:47:53 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/8284/#p8284</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/8283/#p8283</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<div class="quotebox"><cite>cmccullough wrote:</cite><blockquote><p>Hello all,</p><p>Is this script still available?&nbsp; I&#039;ve tried both links but received errors.&nbsp; Pastebin entry 33 is not available and Pastebin entry 41 is not available.&nbsp; Did I miss something?</p><p>Thanks!</p></blockquote></div><p>What he said.</p>]]></description>
			<author><![CDATA[dummy@example.com (Maukel)]]></author>
			<pubDate>Fri, 30 Jan 2009 17:14:09 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/8283/#p8283</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/8275/#p8275</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>Hello all,</p><p>Is this script still available?&nbsp; I&#039;ve tried both links but received errors.&nbsp; Pastebin entry 33 is not available and Pastebin entry 41 is not available.&nbsp; Did I miss something?</p><p>Thanks!</p>]]></description>
			<author><![CDATA[dummy@example.com (cmccullough)]]></author>
			<pubDate>Fri, 30 Jan 2009 16:34:18 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/8275/#p8275</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/3219/#p3219</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>Kev, great job. I just noticed you updates to places.py. Thanks. Is it possible to get the menu to sort alphabetically? </p><p>Also for those of us using PCMan we can change line 54</p><div class="codebox"><pre><code>    print &#039;thunar &#039; + i</code></pre></div><p>to</p><div class="codebox"><pre><code>    print &#039;pcmanfm &#039; + i</code></pre></div><p>Maybe this could be handled with a variable at the head of the script.</p>]]></description>
			<author><![CDATA[dummy@example.com (kestrel)]]></author>
			<pubDate>Fri, 26 Dec 2008 17:00:46 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/3219/#p3219</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/3167/#p3167</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<div class="quotebox"><cite>omns wrote:</cite><blockquote><div class="quotebox"><cite>Foomandoonian wrote:</cite><blockquote><p>I like the look of greenmanspirit&#039;s method, but sadly it just doesn&#039;t work for me. I just get a small, blank submenu.</p></blockquote></div><p>Make sure the file is executable. You can do this in thunar by right clicking on the file and choosing Properties-&gt;Permissions Tab, then check &#039;Allow this file to run as a program&#039;</p></blockquote></div><p>Same errors for me I&#039;m afraid... :(</p>]]></description>
			<author><![CDATA[dummy@example.com (Zwopper)]]></author>
			<pubDate>Thu, 25 Dec 2008 21:59:40 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/3167/#p3167</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/2870/#p2870</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>@corenominal: just get it with pastebin, no problem at all, seem like you solve the issue :)<br />@kev: very good script, thanks for sharing ;)</p><p>+1 for add this script by default</p>]]></description>
			<author><![CDATA[arpbook@mac.com (arpbook)]]></author>
			<pubDate>Sun, 21 Dec 2008 11:21:41 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/2870/#p2870</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/2867/#p2867</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<div class="quotebox"><cite>Foomandoonian wrote:</cite><blockquote><p>Thanks omns. I did that, but it didn&#039;t fix it, so I decided to copy the code from the first post, and this time it worked perfectly. Originally I used the code from the pastebin, so either there is an error in there or (more likely) my cut and paste skills need work!</p></blockquote></div><p>Actually, I think there maybe an issue with the pastebin. I am not sure at the moment if the issue only affects Python, needs further investigation, but the download file offered by the pastebin is DOS formatted, doh! This can be fixed by running this command:</p><div class="codebox"><pre><code>cat 40.txt | tr -d &#039;\r&#039; &gt;40.txt.fixed</code></pre></div><p>Where 40.txt is the downloaded file containing the source. Sorry for the inconvenience, I will try and get this fixed.</p><p><strong>Update:</strong> I am pretty sure I have now fixed this. I think it is a fair assumption that the majority of people using the pastebin are going to be using Linux, so I have created a filter to remove all DOS style end of line carriage returns. Hopefully this should solve the issue. :/</p>]]></description>
			<author><![CDATA[dummy@example.com (corenominal)]]></author>
			<pubDate>Sun, 21 Dec 2008 08:44:11 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/2867/#p2867</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic places (pipe menu)]]></title>
			<link>http://crunchbanglinux.org/forums/post/2865/#p2865</link>
<br />
<b>Warning</b>:  Missing argument 2 for parse_message(), called in /home/corenominal/www/crunchbanglinux.org/forums/extern.php on line 131 and defined in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>784</b><br />
<br />
<b>Notice</b>:  Undefined variable: hide_smilies in <b>/home/corenominal/www/crunchbanglinux.org/forums/include/parser.php</b> on line <b>820</b><br />
			<description><![CDATA[<p>Thanks for the responses everyone. I&#039;ve made two small changes to the script, and updated the first post to include new download links and a quick guide (courtesy of omns and greenmanspirit) to using this in your openbox menu.</p><p>Sub-sub directories would be nice. So would pattern matching for ignored items. I&#039;ll see what I can think up, and if anyone else can think of a good way to do it then hack away.</p>]]></description>
			<author><![CDATA[dummy@example.com (kev)]]></author>
			<pubDate>Sun, 21 Dec 2008 08:15:50 +0000</pubDate>
			<guid>http://crunchbanglinux.org/forums/post/2865/#p2865</guid>
		</item>
	</channel>
</rss>

