1#
2# Default user menus for  xbmbrowser  (version 5.0)
3#
4# For more information please look at the tutorial version of this
5# file which should be located at  "==LIBRARY_RC==.tut".
6#
7# Dated:    9 July 1995
8#
9# Original Programmer:  Ashly Roll         ash@cit.gu.edu.au
10# Current Programmer:   Anthony Thyssen    anthony@cit.gu.edu.au
11#
12
13# ------------------------
14menu "main"
15
16item "CD .."         chdir("..")
17item "CD Start"      chdir("%D")
18item "CD Home"       chdir("~/")
19item "CD X Bitmaps"  chdir("==X_BITMAPS==")
20line
21item "New Browser.."   input("New Browser","%d") exec("xbmbrowser '%i' &")
22item "Text Editor.."   input("File to Edit","") \
23                         exec("xterm -g 80x40 -name Vi -T Vi -n Vi -e vi %i &")
24item "Make Dir.."      input("Make Directory","") exec("mkdir '%i'")
25item "Execute Cmd.."   input("Command to Execute","") exec('%i')
26line
27item "Quit Browser.."  confirm("Really Quit?") quit()
28
29# -------------------------
30menu "global" "Global Menu"
31
32item "Rename"        selected() input("Rename File", '%f') \
33				exec("mv '%f' '%i'") rescan()
34item "Copy"          selected() input("Copy File",'%f') \
35				exec("cp '%f' '%i'") rescan()
36item "Duplicate"     selected() exec("cp '%f' '%b.%s'") rescan()
37item "Delete"        selected() confirm("Really Delete `%f' ?") \
38				exec("rm '%f'") rescan()
39line
40item "Execute"       input("Command to Execute","  %f") exec("%i")
41item "Text Editor"   exec("xterm -e ${VISUAL:-${EDITOR:-vi}} %f &")
42
43# -------------------------
44menu "bitmap" "Bitmap Menu"
45
46item "Bitmap Edit"   exec("bitmap '%f' &")
47item "XV Edit"       exec("xv '%f' &")
48item "SetRoot"       exec("xsetroot -fg Black -bg PaleGreen -bitmap '%f'")
49item "SetRoot Inv"   exec("xsetroot -rv -fg Black -bg PaleGreen -bitmap '%f'")
50
51line    # PbmPlus Filters
52line
53item "Invert"  \
54  exec("xbmtopbm '%f'|pnminvert|pbmtoxbm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
55  rescan()
56item "Crop" \
57  exec("xbmtopbm '%f'|pnmcrop|pbmtoxbm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
58  rescan()
59item "Add Margin" \
60  exec("xbmtopbm '%f'|pnmmargin 5|pbmtoxbm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
61  rescan()
62item "Flip Horz" \
63  exec("xbmtopbm '%f'|pnmflip -lr|pbmtoxbm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
64  rescan()
65item "Flip Vert" \
66  exec("xbmtopbm '%f'|pnmflip -tb|pbmtoxbm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
67  rescan()
68item "Create Mask" \
69  exec("xbmtopbm '%f' | pbmmask | pbmtoxbm > '%b_mask%s'")\
70  rescan()
71item "`' Mask Ext" \
72  exec("xbmtopbm '%f' | pbmmask -expand | pbmtoxbm > '%b_mask%s'")\
73  rescan()
74
75line  # PbmPlus Converters
76line
77item ">Pixmap"      exec("xbmtopbm '%f' | ppmtoxpm > '%b.xpm'" )  rescan()
78
79# -------------------------
80menu "pixmap" "Pixmap Menu"
81
82item "Pixmap Edit" exec("pixmap -f '%f' &")
83item "XPaint Edit" exec("xpaint '%f' &")
84item "SetRoot"     exec("xloadimage -quiet -onroot '%f' &")
85item "SetRoot xv"  exec("xv -root -noresetroot '%f' -quit &")
86# Use this version if xv does not understand X pixmaps (v3.01 and up)
87#item "SetRoot xv"  exec("xpmtoppm '%f' | xv -root -noresetroot - -quit &")
88
89line  # PbmPlus Filters
90line
91item "Crop" \
92  exec("xpmtoppm '%f'| pnmcrop |ppmtoxpm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
93  rescan()
94item "Add Margin" \
95  exec("xpmtoppm '%f'|pnmmargin 5|ppmtoxpm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
96  rescan()
97item "Flip Horz" \
98  exec("xpmtoppm '%f'|pnmflip -lr|ppmtoxpm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
99  rescan()
100item "Flip Vert" \
101  exec("xpmtoppm '%f'|pnmflip -tb|ppmtoxpm>'%b.t'&&mv '%b.t' '%f'||rm '%b.t'")\
102  rescan()
103
104line # PbmPlus Converters
105line
106item ">Xbm Thr" exec("xpmtoppm '%f' | ppmtopgm |
107		pgmtopbm -threshold | pbmtoxbm > '%b.xbm'" )  rescan()
108item ">Xbm Dth" exec("xpmtoppm '%f' | ppmtopgm | pgmnorm 2>/dev/null |
109		pgmtopbm -fs | pbmtoxbm > '%b.xbm'" )         rescan()
110item ">Gif"     exec("xpmtoppm '%f' | ppmtogif > '%b.gif'" )  rescan()
111
112# -------------------------
113menu "directory" "Dir Menu"
114
115item "Goto.."      chdir('%f')
116item "New Browser" exec("xbmbrowser '%f' &")
117line
118item "Rename Dir"   input("Rename Dir","%f")  exec("mv '%f' '%i'")
119item "Make Dir"     input("Make Directory","") exec("mkdir '%i'")
120item "Delete"       exec("rmdir '%f'")   # this is fairly safe
121#item "Delete Dir"  confirm("DANGER -- Really Delete ALL of `%f' -- DANGER")\
122#		    exec("rm -fr '%f'")   # this is very dangerous!
123
124# -----------------------
125menu "other" "Other Menu"
126
127item "Text Edit"  exec("xterm -e ${VISUAL:-${EDITOR:-vi}} '%f' &")
128item "XV Image"   exec("xv '%f' &")
129
130line  # PbmPlus Convertors
131line
132item "Icon -> Xbm" \
133  exec("icontopbm '%f' | pbmtoxbm > '%b.xbm' ")     rescan()
134item "Gif -> Xpm" \
135  exec("giftopnm '%f' | ppmquant 256 2>/dev/null |
136	ppmtoxpm 2>/dev/null > '%b.xpm' ")  rescan()
137
138# -----------------------
139
140