Click to See Complete Forum and Search --> : Sawfish menu
GaryJones32
11-07-2002, 01:11 AM
Has anyone figured out how to customize the Sawfish root menu.???
The docs say to look at an info file i don't have and can't find on the web.
Thanks in advance
AdaHacker
11-07-2002, 07:25 PM
Well, there's no user interface for editing the menus, so I believe you have to do it the same way you change anything else in Sawfish - through a Lisp script. For somehting like the menus, this is not as difficult as it sounds. You can add the appropriate Lisp code to either ~/.sawfishrc, or you can copy the appropriate default config script into the correct directory under ~/.sawfish and edit that.
An example will help clarify things. Sawfish comes with a collection of Lisp scripts that are used to set up the default environment. The menus are built by a script called menus.jl. On my system, the default for this file is /usr/share/sawfish/1.0.1/lisp/sawfish/wm/menus.jl. The default root and apps menus, among other things, are defined here. Now, let's say I want to change the apps menu, since I've done that and I can just copy and past the code. (The same technique should work for the root menu, just use the variable root-menu instead of apps-menu. You'll also be calling different functions, but that's another story.) If you look at the default menus.jl, you'll notice something like this:
(defvar apps-menu
`(("xterm" (system "xterm &"))
("Emacs" (system "emacs &"))
("Netscape" (system "netscape &"))
("The GIMP" (system "gimp &"))
("XFIG" (system "xfig &"))
("GV" (system "gv &"))
("xcalc" (system "xcalc &"))))
This code defines the apps menu. If I want to change the menu, I have two options. First, I can set the apps-menu variable to a new value in ~/.sawfishrc. My ~/.sawfishrc looks like this:
(setq apps-menu
`(("Apps Menu" (system ""))
()
("Aterm" (system "aterm &"))
("Opera" (system "opera &"))
("ROX-Filer" (system "rox"))
("GVim" (system "gvim &"))
("XMMS" (system "xmms &"))
("Wallpaper" (system "~/Apps/Wallpaper/AppRun --random &"))
))
Notice that I can just use the same syntax but substitute "setq" for "defvar". You can only define a variable once, so using setq is important. Note that the "Apps Menu" line does not do anything, and the line after that, with the empty () is simply a spacer.
The second option is to make a menus.jl file in the right subdirectory of ~/.sawfish. If you do this, then that file will override the system default. So, since I have the default in /usr/share/sawfish/1.0.1/lisp/sawfish/wm/menus.jl, I can simply copy that file to ~/.sawfish/lisp/sawfish/wm/menus.jl. Once I've done that, I can simply edit the file to make whatever changes I require.
Restart sawfish and, if all goes well, you should be all set.
GaryJones32
11-08-2002, 03:17 AM
thanks
will try
i started off hacking a ~/.sawfishrc file
but it didn't seem to have any effect ?
i probubly just got some syntax wrong
i'll try things in the .sawfish folder
Vlad902
11-08-2002, 03:18 AM
just remember to back up ;)
GaryJones32
11-08-2002, 04:36 AM
Me again
I ended up having to hack the menus.jl file in usr/share...
not a big deal because i'm the only user but it still doesn't feel quite right.
as best as i can tell the files i put in ~./ arent getting evaluated
the script generated by the gui customizations is getting evaluated however.
Question:
why are there three executables in usr/bin ?
(i use a very old version)
sawmill
sawmill -client
sawmill -capplet
sawmill -ui
perhaps i should be calling one of these others besides just sawmill ?
i will experament tomorrow and hope nothing explodes
:)
AdaHacker
11-08-2002, 06:53 PM
Wow, I guess you do use an old version. The name was changed from sawmill to sawfish way back in version 0.27. The current version is 1.1, and I'm using 1.0.1. It's possible (read: "likely") that things have changed since version <= 0.26 and that everything I wrote does not apply to your version. Or maybe it does. Who knows? At any rate, you might want to think seriously about upgrading.
As for all those executables...
You could deffinitely use sawfish-client if you want to. It can be used to execute an arbitrary Lisp script in the current instance of sawfish. I'm not entirely sure what sawfish-capplet does, but I have the feeling it's related to GNOME. I don't know about sawfish-ui either, but it looks like it's for grouping windows, or some such thing. Go ahead and play with them. Let me know if you figure anything out.
knute
01-07-2004, 04:35 PM
Ok.. I use sawfish myself, and have been wanting to customize the menu.
When I do the menu.jl file is over-ridden.
How can I set that menu as a submenu in my customizations?
I'm constantly installing and removing software because I like to play, and having that dynamic menu available is extremely nice, yet I also want such things as Firebird, and aterm available with out having to dig for them, when I'm being lazy and don't want to use the keyboard short cuts that I have set up for them. :D
Second, is there a way to customize the look of the pop-up menus???
I've seen WM's that have translucent pop-ups, and various colors and all the bells and whistles, and it would be nice.
I use sawfish because of the keyboard shortcuts. If there's something out there that can meet or exceed the keyboard shortcuts of sawfish (and yes, I've tried ion and didn't like it), I'll try it.
AdaHacker
01-07-2004, 11:33 PM
Originally posted by knute
When I do the menu.jl file is over-ridden.
How can I set that menu as a submenu in my customizations?
I'm not sure what you mean. Which menu do you want as a submenu of what?
Second, is there a way to customize the look of the pop-up menus???
I've seen WM's that have translucent pop-ups, and various colors and all the bells and whistles, and it would be nice.
I don't think this is possible. The Sawfish root menu is just a plain old GTK+ popup menu. I'm pretty sure GTK+ menus don't do transparency.
knute
01-08-2004, 02:31 AM
What I mean is that currently when I left click I have it set up to bring up the apps-menu.
It has it's submenus of Apps, Games, etc....
what I would like to do is to add my frequently used programs to it, yet I haven't figured out how to do that yet. I'm not a lisp programmer, so I don't quite know where to begin even.
(I know -- learning lisp would be a good place to start! :rolleyes:)
I've actually played with it a little bit, but was unsatisfied with my results. I used one that was there as a template. I took it out for some reason, and got curious about it again.
Here's what I'm looking for, sorta:
Aterm
Firebird
OpenOffice
-------------
Apps >
Games >
Help > etc
I want both the customized portion AND the dynamic menu. Can I have the best of both or is that asking for too much? :D
AdaHacker
01-08-2004, 06:06 PM
OK, I see what you're saying. I'm pretty sure you can do that Unfortunately, it will require more knowledge of Lisp than I have. Sorry.