Re: Dynamic places (pipe menu)

It is due to the loss of a lot of pastebin material. Corenominal got it fixed where 'forever' really means forever, but we still lost a good bit of material.

I think that is included by default in the 02 release. Maybe someone could link it up in the pastebin.

Michael

The 1-Man IT Department | Ubuntu User #16666 | Linux User #451972
My Social Nets: Identi.ca | twitter | friendfeed
Crunchbangin' and Loving Every Minute of IT!

Re: Dynamic places (pipe menu)

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?

I ask this because I have noticed several enchantments already enabled by default already.

Re: Dynamic places (pipe menu)

The 8.10.02 releases all come with a pre-installed "places" pipemenu. It is not the same menu which was originally posted here, but a popular alternative written in Perl. I have pasted it here for anyone who is interested. smile

29

Re: Dynamic places (pipe menu)

Sorry about the lack of updates everyone. I'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.

The perl script is nice. It's pretty much how I've been planning to implement a tree view, and now that I have time again I'll have a go at something similar. Not because I want to displace the current default, just because there are a few tweaks I'd like to make, and it's easier for me to do in python than perl.

Re: Dynamic places (pipe menu)

Hi

i'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.
Hey it's the 1st time i use python !

#!/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:
#    <menu execute="perl ~/.config/openbox/scripts/places.py menu" id="pipe-places" label="Places"/>
# 4. Call the pipe-menu in your menu by adding the following line to the same file:
#    <menu id="pipe-places"/>
# 5. Reconfigure OpenBox
# 6. You'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 = "thunar"

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

# 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 = ['/media/cdrom0']

# 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 + '/*/')
    # Alphabetise subdirs. Sorting here is less efficient but preserves 
    # directory order specified above. If this doesn't matter to you then
    # remove this line and uncomment "items.sort(key=str.lower)" 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, '')
        # Strip trailing / characters
        sub = sub.rstrip('/')    
        sub = sub.replace('/', '')
        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 '<openbox_pipe_menu>'
# Each item becomes a menu entry
for i in items:
    print '<item label="' + i + '">'
    print '<action name="Execute">'
    print '<execute>'
    print manager + " " + folder +"/"+ i
    print '</execute>'
    print '</action>'
    print '</item>'
print '</openbox_pipe_menu>'

By the way my 1st sub-folder doesn't load with thunar, any idea ?

Re: Dynamic places (pipe menu)

MY "Places" menu was working fine until I replaced my FileManager with Thunar. Then I noticed my "Places" menu was not working. Where would I go to fix this. Thanks

You cannot put a price tag on "#!Cool"

Re: Dynamic places (pipe menu)

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)

there should be a filemanager variable in the script the probably specifies pcmanfm currently, change that to thunar to get it working.

note: im on statler and using a non standard places menu, so sorry for not being more specific.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Dynamic places (pipe menu)

@vsbladz

http://crunchbanglinux.org/wiki/howto/s … emanager?s[]=places#editing_the_places_pipe_menu

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.