Umm.  So I've written a neato little perl script.  It's kind of hard to 
visualize the utter magic that this fine piece of software does, so I've 
posted a screenshot of its work to 
http://movingparts.net/images/background_menu_pl.jpg (those of you who are 
frame-challenged, go to 
http://movingparts.thelinuxcommunity.org/images/background_menu_pl.jpg

Here's what it does....

(gideon@tobias:~) background_menu.pl -heLP          (05:37pm/5001/ttypts/2)

# /home/gideon/bin/background_menu.pl 

# A perl script to generate and maintain a blackbox "backgrounds menu" 
# based on user-definable settings.  It automagically updates its
# file list every run-time, and marks for you which image it last set as
# your root X image with ">> filename <<".  The intent of this program is
# that you install it (see below), run it once to generate a blackbox menu
# list for your images, and then forget about it.  

# AUTHOR: Jason Kasper (vanRijn) <[EMAIL PROTECTED]>

# LICENSE: Umm.  I'm not a lawyer and most probably neither are you.  So
# let's keep this simple.  I like to code.  I give you permission to use my
# code. I give you permission to change my code.  I give you permission to 
# distribute my code.  I give you permission to sneeze on my code (if you
# wipe it off quickly thereafter). If you'd like to make a change, have at it.
# Please give me credit for my code, and don't distribute my code with your
# changes unless you give me credit and indicate that you've made changes
# to my code, AND let me know what you've changed so that I can take
# advantage of you smart guys out there and add your improvements to my
# code base.  That's about it, I believe.

# WHAT DOES IT DO?:
# This program will recurse through any subdirectories that exist below the
# top-level $image_dir directory and do 2 things...
#
# 1) it will figure out whether each image it comes across falls into the
#   "themed" or "non-themed" broad category.  Basically, is this image being 
#   used in any theme found in the user's styles directory?  If it is, then a 
#   submenu is created and maintained differentiating these images as "images 
#   used in themes".
#
# 2) If the image file is not being used in a theme, then it will create
#   sub-menus as necessary to list all your image files broken down by
#   what directory they're in.  Thus, if you have a
#   ~/.blackbox/backgrounds/artwiz directory and a
#   ~/.blackbox/backgrounds/deaddreamer directory and a
#   ~/.blackbox/backgrounds/TDF directory, etc., it will put these images
#   into nice little submenus for you.
#
# INSTALLATION INSTRUCTIONS
# ------------------------------------------------------------------------
# Step 1)... assuming you have a ~/.blackbox and a
# ~/.blackbox/backgrounds and a ~/.blackbox/styles, all you need to do is
# put this script somewhere handy (~/.blackbox works for me), and do
# "./background_menu.pl".  This will generate a file (configurable below)
# called ~/.blackbox/backgrounds.menu".  
#
# Step 2)... put this line in your blackbox menu file (mine's 
# ~/.blackboxmenu)... "[include] (~/.blackbox/backgrounds.menu)" (without
# the quotes, of course.
#
# That's about it.  This perl script uses bsetbg as its default root-image
# setter, but if you want to use something else, just change $imagesetter
# below....

# feel free to change the below settings. They're set by default to
# blackbox .61.x settings, so these should be okay for you....

I posted a shell script that had very limited functionality kind of like this 
one a while ago and several people were interested.  Here's the newest 
version, with much better functionality and not to mention faster than the 
shell version.  Go get it at http://movingparts.net/background_menu.pl (or 
for those of you who might be frame-challenged, go to 
http://movingparts.thelinuxcommunity.org/background_menu.pl). 

Please let me know what you think....

-- 
----%<----------%<----
Jason Kasper (vanRijn)
bash$ :(){ :|:&};:
Numbers 6:24-26

Reply via email to