Icepipes - my pipe menus collection for icewm

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

Icepipes - my pipe menus collection for icewm

#1 Post by Nathan F »

Four cool pipe menus for icewm, all using sh rather than python or perl. These add some extra functionality and access to your root menu.

iceplaces.sh - Mimics the gnome places menu, complete with gtk bookmarks and a recent files list.

icedate.sh - Shows a calendar and the current date/time. Works best with a monospace font. The least useful one of the bunch but still cool.

icempd.sh - Control music player daemon from the menu. Requires a running mpd and the mpc command line client.

icefb.sh - Walk the directory tree from a menu. I use it on the toolbar. Open a filemanager or terminal in a given directory, or open any file that "xdg-open" understands. The terminal must understand the --working-directory= option (gnome-terminal, xfce4-terminal, lxterminal, maybe others). This could be hacked a bit for better portability.

These are WIP ports of my own openbox pipe menus. The scripts all have a user configuration section to set things like your favored external programs. To install, edit the configuration section with a text editor and place in your $PATH. Then add something similar to the following to your icewm menu:

Code: Select all

menuprogreload Places user-bookmarks 0 iceplaces.sh
Where menuprogreload tells icewm to create a menu using this script, Places is the label you want the menu to have, user-bookmarks is the icon, 0 means "refresh this menu every time it's opened", and the name of the script is the command to execute.

Feedback welcome. These are also available in a similar form for pekwm and openbox.


=======================================
UPDATE - version 0.3 uploaded
=======================================


Version 0.3
iceplaces.sh
* ROX-Filer bookmark support
* Bugfix for better rox support (removal of 'file://' from uri's)
* Now catches removable media mounted in /media or the new /run/media via udev
* Bugfixes for various path mangling corner cases (spaces and special chars in pathnames)

Version 0.2
* Support for a browsable home directory in iceplaces.sh (calls icefb.sh).
* Supports opening urxvt from icefb.sh and can now scroll upwards in icefb.sh
Attachments
icepipes-0.3.tar.bz2
(4.21 KiB) Downloaded 496 times
icepipes-0.2.tar.bz2
(3.84 KiB) Downloaded 494 times
icepipes-0.1.tar.bz2
(3.65 KiB) Downloaded 465 times
Last edited by Nathan F on Thu 25 Jul 2013, 23:53, edited 2 times in total.
Bring on the locusts ...

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hi, Nathan F.

Various reactions come rushing to the surface: :)
* It's about time!
* That should put icewm back in the wm race.
* Many thanks!
* Only four pipemenu scripts? :)

Best regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#3 Post by Nathan F »

* Many thanks!
Quite welcome.
* Only four pipemenu scripts?
Got a specific request? I might be game :D

Icewm's menu framework is about the easiest to work with of any wm IMO. It's even smart enough to ignore entries, and in fact entire submenus, if the corresponding programs aren't in your $PATH.

To get the same functionality out of openbox required quite a bit more code and some strange workarounds. The directory browser gagged on any file or directory names containing the '&' character, for instance (which is quite common in my music collection dammit).

I've always though icewm was overlooked. It's fast as hell, had pipe menus for quite some time, can be controlled completely from the keyboard if you desire, etc. What I think is missing are nice themes that don't look like Motif or Win95, particularly in the default install.
Bring on the locusts ...

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#4 Post by Nathan F »

Minor updates.

icefb.sh - can now browse to a parent directory, and supports using urxvt
iceplaces - supports making $HOME browsable by calling icefb

As before, set options by editing the configuration block in the scripts.

I also have a wallpaper setting pipe menu for pekwm and openbox, that I could port to icewm. Any takers?
Bring on the locusts ...

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

Nathan F wrote:What I think is missing are nice themes that don't look like Motif or Win95, particularly in the default install.
Wrong! http://box-look.org/index.php?xcontentm ... 3bd2cc2c06 8) :lol:
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#6 Post by Nathan F »

Yeah, I've snagged a few from there. I was thinking if a few more attractive themes were included with the release tarball, or if they put together a collection of extra themes, people might not so easily get scared off when they install it and start thinking "this looks too retro..."
Bring on the locusts ...

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#7 Post by musher0 »

Nathan F wrote: I also have a wallpaper setting pipe menu for pekwm and openbox, that I could port to icewm. Any takers?
Not me... That's quite a surprising offer from the author of an excellent wallpaper setter, isn't it?! :o Unless of course you can outdo yourself in the form of a new icewm pipe-script? :twisted: Or maybe you're trying to do away with ROX?

On a tangent subject, the latest pekwm offers a snapshot utility. But with SFR's "Take-a-shot", and probably a dozen more snapshot utilities that have been generated on/for Puppy, it falls short. Maybe on other distros, though. Or for the fun of it! But as I implied, that particular need has already been catered to.

Keep 'em coming, though!

I believe that a pipe-script within the icewm menu which could reach the most obscure parts of the Puppy hierarchy (sub-sub-sub-folders, for ex.) in a somewhat thematic fashion would be most useful for beginners and developers alike. It would speed up access tremendously.

TWYL.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

Nathan F wrote:Yeah, I've snagged a few from there. I was thinking if a few more attractive themes were included with the release tarball, or if they put together a collection of extra themes, people might not so easily get scared off when they install it and start thinking "this looks too retro..."
True. But AntiX has nice icewm themes by default.
Who's "they"? Why not "we"? :)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#9 Post by Nathan F »

Not me... That's quite a surprising offer from the author of an excellent wallpaper setter, isn't it?! Unless of course you can outdo yourself in the form of a new icewm pipe-script? Or maybe you're trying to do away with ROX?
I don't use Puppy exclusively anymore, actually not for quite some time. I alternate between FreeBSD and Arch, and mess with Puppy out of habit and fun. So I like to program with portability in mind. Not to mention the fact that Barry has talked about making Puppy a little less dependent on Rox-Filer in his blog. Plus the fact that Rox hasn't been updated in quite some time, which is getting a bit scary.
I believe that a pipe-script within the icewm menu which could reach the most obscure parts of the Puppy hierarchy (sub-sub-sub-folders, for ex.) in a somewhat thematic fashion would be most useful for beginners and developers alike. It would speed up access tremendously.
Something like the "places" script, but customized for Puppy? Or maybe add in support for Rox-Filer bookmarks to the iceplaces.sh script? Either of those would be reasonably easy. Or maybe a configuration variable in the iceplaces script where you could add custom directories?
On a tangent subject, the latest pekwm offers a snapshot utility. But with SFR's "Take-a-shot", and probably a dozen more snapshot utilities that have been generated on/for Puppy, it falls short. Maybe on other distros, though. Or for the fun of it! But as I implied, that particular need has already been catered to.
The wallpaper setter pipe-menu works particularly well in pekwm, incidentally. Pekwm can configure the size of icons on a per-submenu basis, so you can display a 64x40 thumbnail preview (for instance) and actually see what it is you're setting. The downside is in it's current form it opens slow the first time, as it's working hard to scale all the images into preview size.
Keep 'em coming, though!
I posted the openbox scripts earlier today, and the pekwm varients are almost finished. Just got the file browser working right under pekwm. I'll try to post those tommorrow.

My other thoughts are as follows.

If this grows any more, it would be worthwhile to move the configuration to a separate file (maybe ~/.config/pipemenusrc or the like) and think of them as a suite of programs. That way any customizations would apply to all of the scripts, and also accross all supported WM's.

That strategy means less editing of the scripts, and it can be done on a per-user basis meaning that the scripts can be in /usr/bin and each user can choose they'ds own preferred apps for integration with their own desktop (thinking again of portability to other distros/os's).

That strategy also opens the possibility of creating a gui tool to set prefs, although I don't want to promise something that I may not have the time or inclination to write.
Bring on the locusts ...

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#10 Post by Nathan F »

For amusement, and to show the wallpaper menu in pekwm...

The screenshot shows my development model. I'm running openbox on my desktop and have another window with pekwm running via Xephyr (nested X server) so I can catch any error messages easily while testing things out.

Kinda crazy I know. But it works for me. This kind of flexibility is what I love about *nix.
Attachments
insanity.jpg
(103.02 KiB) Downloaded 691 times
Bring on the locusts ...

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#11 Post by musher0 »

Hello again, Nathan.

Can you give more detail as to how to hook the iceplaces.sh script properly in the regular menu?

I added this line to the icewm menu and nothing happens :

Code: Select all

prog "iceplaces" - /root/.icewm/iceplaces.sh
Thanks in advance.

Also line 2 of the iceplaces script should read:

Code: Select all

# Simple places script for your icewm menu
in the icewm version, should it not?
(And not refer to pekwm, obviously...)

Best regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#12 Post by Nathan F »

For the latest versions of icewm -

Code: Select all

menuprogreload "iceplaces" - 0 /root/.icewm/iceplaces.sh
And yes, I missed that when I ported it over from pekplaces.sh.
Bring on the locusts ...

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#13 Post by musher0 »

Code:
menuprogreload Places user-bookmarks 0 iceplaces.sh

Where menuprogreload tells icewm to create a menu using this script, Places is the label you want the menu to have, user-bookmarks is the icon, 0 means "refresh this menu every time it's opened", and the name of the script is the command to execute.
I'll be getting new reading glasses shortly... :? Sorry for having missed that.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#14 Post by musher0 »

Hello, again, Nathan.

iceplaces.sh displays the entries when introduced with the menuprogreload command in the menu.

However, here are a few suggested edits to make it work with ROX-Filer in Puppy :

Code: Select all

#!/bin/sh
# Simple places script for your pekwm menu
# 06.20.2013 by Nathan Fisher (nfisher dot sr at gmail)
# Edits by Christian L'Écuyer (aka musher0), July 23, 2013,
# for use with ROX-Filer on PuppyLinux.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#
#####################################################
# User configuration section

# What file manager are we using...
# Affects display of network:// and trash:// uri's
# filemanager="nautilus"
# filemanager="thunar"
# filemanager="pcmanfm"
filemanager="rox"
# Edited by m0

# End config
####################################################

# Static places menu
cat << EOF
prog "Filesystem" "drive-harddisk.png" $filemanager / 
# file:/// # Edited by m0
prog "Home" "user-home.png" $filemanager $HOME 
# file://$HOME # Edited by m0
# prog "Network" "network-workgroup.png" $filemanager network:///
# Edited by m0 # Where is that network folder on a Puppy ?
prog "Trash" "user-trash.png" $filemanager ~/.Trash
# trash:/// # Edited by m0

separator

EOF

while read bookmark
do
  SETNAME="$(echo $bookmark | cut -s -f 2- -d ' ')"
  if [ ! "$SETNAME" = "" ] ; then
    LABEL="$SETNAME"
    bookmark=$(echo $bookmark | cut -f 1 -d ' ')
  else
    LABEL="$(basename $bookmark)"
  fi
  echo "prog $LABEL folder.png $filemanager ${bookmark}"
done<$HOME/.gtk-bookmarks
cat << EOF
separator
menu Recent document-open.png {
EOF

for uri in $(grep "href=\"file" ${HOME}/.local/share/recently-used.xbel \
    | tail -n 10 | cut -f 2 -d '"' | sed 's%file://%%') ; do
# This grep and cut, etc. should be redone with ROX in mind. # Edited by m0
# Consider: # grep file:/// | tail -n15 | cut -d "\"" -f 2  # Suggested by m0
 if [ -f "${uri}" ]; then
  echo -n "prog \"$(basename ${uri})\" - "
 else
  echo -n "prog \"* $(basename ${uri})\" - "
 fi
 echo "defaulthandler ${uri}"
# xdg-open # works so-so if at all on Puppy. Prefer defaulthandler.
done
cat << EOF
separator
prog "Clear Recent Documents" edit-clear.png echo > ${HOME}/.local/share/recently-used.xbel
}
EOF
Suggestions are based on my own take on the openbox "Recent files" pipemenu, adapted to aemenu (from aewm).

Now if I can remember where I put it on this board... I'll reference it! :?

Bye for now.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#15 Post by musher0 »

Just an idea:
on first run of iceplaces.sh perhaps ask the user which file manager (s)he is using, make that into a flag file in /tmp. Then provide variants of the building part as
case "`cat /tmp/fm`" in
rox) blabla ;;
x) bleble ;;
y) blibli ;;
and so on
esac
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#16 Post by Nathan F »

OK, good ideas. This is supposed to be fairly distro-agnostic, but I can add in support for the ~/.trash location if the directory exists...and the user is using Rox-Filer to open directories.

The network:// uri is available in Nautilus and in Thunar when gvfs support is enabled. If you set the filemanager to rox or pcmanfm it's not supposed to display.

I'm seriously considering moving the preferences out of the script and into a separate config file, that all of these pipe menu scripts would source. That makes setup easier. I could also add in some logic, I suppose, to enable only existing programs. Maybe as part of an installation script or Makefile.

Anyway, even if I keep it distro-agnostic that doesn't mean there couldn't be a puppy-specific package at some point, with all of the appropriate configurations for Puppy already selected.
Bring on the locusts ...

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#17 Post by Nathan F »

Just realized I never implemented the code to hide the network:// uri in rox. Anyway, here's the relevent section of the new implementation.

Code: Select all

case $filemanager in
rox)
  if [ -d "$HOME/.trash" ] ; then
    TRASH="prog "Trash" "user-trash.png" $filemanager $HOME/.trash"
  fi
;;
nautilus|thunar)
  TRASH="prog \"Trash\" \"user-trash.png\" $filemanager trash:///"
  NETWORK="prog \"Network\" \"network-workgroup.png\" $filemanager network:///"
;;
pcmanfm)
  TRASH="prog \"Trash\" \"user-trash.png\" $filemanager trash:///"
;;
esac


# Static places menu
echo "prog \"Filesystem\" \"drive-harddisk.png\" $filemanager file:///"
if [ "$BROWSE_HOME" = "true" ] ; then
  echo "menuprogreload Home user-home 0 icefb.sh $HOME"
else
  echo "prog \"Home\" \"user-home.png\" $filemanager file://$HOME"
fi
cat << EOF
$NETWORK
$TRASH

separator

EOF
That should hide the "trash:///" and "network:///" uri's in rox but display and entry for ~/.trash, and use the appropriate entries in Nautilus, Thunar, and Pcmanfm. I'll post an update sometime in the next couple days. Work is keeping me busy.

I have another project going that adds networking support via sshfs and/or curlftpfs. Once it reaches a higher state of maturity I may make it available in the places pipemenu as an alternative to "network://", which is based on gvfs and has to be compiled into a program.
Bring on the locusts ...

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#18 Post by Nathan F »

Caught another bug just now. Rox doesn't handle file:/// or file://$HOME. That's fine, the other filemanagers do just fine without the "file://" portion. It's only there to distinguish between local and remote files in the pathbar.

I updated the pekwm and openbox versions of the places menu. I'll add in support for rox bookmarks soon and move the config for all the menus out into a separate file.

Incidentally, are you getting icons in the menus? I chose the icon names based on the gnome/tango naming scheme which is supposed to be standard now but don't know what Puppy actually has available. I'd like to make it all work on Puppy without any loss of function.
Bring on the locusts ...

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#19 Post by musher0 »

Found it!

My own take on openbox's "Recent Documents" pipemenu is at http://murga-linux.com/puppy/viewtopic. ... 484#662351
To work properly, it needs aemenu, replaceit and an activated /root/.recently-used.xbel (now at ~/.local/.recently-used.xbel, in newer Puppies).

Care to comment? (Or not is ok too!) :)

You'll see that the script has an international section, both to translate in utf8 code the XML characters present in the .xbel file AND to be able to use correct language strings as much as possible for a wide range of European Union languages in the menu. (No discrimination implied, I can only do so much.)

Currently finding translations for new "erase" line/function -- which your own script made me think of adding. Thanks for that.

Bye for now.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#20 Post by musher0 »

Nathan F wrote:Caught another bug just now. Rox doesn't handle file:/// or file://$HOME. That's fine, the other filemanagers do just fine without the "file://" portion. It's only there to distinguish between local and remote files in the pathbar.
Yeah, I tried to tell you in one of my edits.
Nathan F wrote:I updated the pekwm and openbox versions of the places menu. I'll add in support for rox bookmarks soon and move the config for all the menus out into a separate file.
ROX bookmarks support would be great, because 1) they can greatly speed up access to any point of the Linux hierarchy; 2) most users don't know / don't care that they exist.
Killing two birds with one stone, maybe you could make it reversible, like from the pipemenu to the ROX bookmars?
Nathan F wrote:Incidentally, are you getting icons in the menus? I chose the icon names based on the gnome/tango naming scheme which is supposed to be standard now but don't know what Puppy actually has available. I'd like to make it all work on Puppy without any loss of function.
Didn't notice first time around. I'll double-check.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply