Skip to Content.
Sympa Menu

sm-discuss - [SM-Discuss] sawfish not giving root menu

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Rohan NIcholls <rohan.nicholls AT pareto.nl>
  • To: sm-discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: [SM-Discuss] sawfish not giving root menu
  • Date: Thu, 2 Sep 2004 11:56:03 +0200

Does anyone have a problem with the root menu in sawfish not
displacying? I also have this on my home system, however I also have
to use redhat here at work and there are no problems.

The apps menu and my generated background image menu work perfectly
which is what is so confusing.

Here are the bits and pieces that are relevant in my .sawfishrc

(require 'sawmill-defaults)
(require 'sawfish.wm.menus)
....
(setq term "aterm -tr -trsb -sh 50 -fg green -bg black -geometry 80x60")

(defvar my-apps-menu
'(("aterm" (system (concat term " &")))
("Firefox" (system "firefox &"))
("Xemacs" (system "xemacs &"))
("XMMS" (system "xmms &"))
("Ayttm" (system "ayttm &"))
("Sylpheed" (system "sylpheed &"))
("OO.o" (system "soffice &"))
("Grip" (system "grip &"))
("Top" (system (concat term " -e top &")))
("GV" (system "gv &"))
("xcalc" (system "xcalc &"))
("Mozilla" (system "mozilla &"))
("The Gimp" (system "gimp &"))
("Mutt" (system (concat term " -e mutt &")))
("Aumix" (system (concat term " -e aumix &")))))

(setq menu-program-stays-running nil)

(defvar default-apps-menu apps-menu)

(setq apps-menu
(append '(("My Apps" . my-apps-menu))
default-apps-menu))

;; allow setting the background from the root menu
;; nice little hack
;; TODO:
;; 1. Recursive menu generator, allowing submenus in desktop to be given
their
;; own submenus with listings in them, will be nice to allow for organizing
;; the images according to theme ie. surf, winter-scenes, fractal-images etc.
;; 2. allow more than one directory to be used

(defvar desktop-image-dir "~/share/desktops/")



(defun make-menu-list (image-list base-dir)
"make-menu-list: list string -> list
returns a menu-list of all the files in base-dir, with their name and
the action to be performed on them"
(mapcar (lambda (file-name)
`(,file-name (change-background ,(concat base-dir file-name))))
image-list))

(defun background-menu-changer (image-dir)
"background-menu-changer: image-dir -> list
gets the file list to use and passes it to make-menu-list which generates the
menu list"
(let ((lst (remove "." (remove ".." (directory-files image-dir)))))
(make-menu-list lst image-dir)))

(defun background-update-file (file)
"write the present background path to a file to be loaded on restart"
(let ((loader "~/share/desktops/last-desktop"))
(let ((of (open-file loader 'write)))
(write of file)
(close-file of))))

(defun get-last-loaded-image ()
"get the value for the last loaded background"
(let ((loader "~/share/desktops/last-desktop"))
(let ((infile (open-file loader 'read)))
(let ((backg (read-line infile)))
(close-file infile)
backg))))

(defun change-background (file)
"change-background: string -> nil
the call to the setbackground program, takes the full pathname"
(system (concat "setbackground " file)))

(defvar background-menu (lambda () (popup-menu (background-menu-changer
desktop-image-dir))))

;right mouse button shows backgrounds
(bind-keys root-window-keymap "Button2-Click" popup-apps-menu)
(bind-keys root-window-keymap "Button3-Click" background-menu)
;; left mouse button shows root menu,
(bind-keys root-window-keymap '(keymap (popup-root-menu . "Button1-Click")))

If I try poping up the menus from within the sawfish-client it works
perfectly for everything except for the root, here is the output.

user> (popup-root-menu)
#<process running: /usr/libexec/sawfish/1.3/i686-pc-linux-gnu/sawfish-menu>
user>

If I then try and get at the configuration menu I get the menu and the
root-menu gives me this:

(("_Windows" . window-menu) ("Work_spaces" . workspace-menu) ("_Programs" .
apps-menu) ("_Customize" . custom-menu) ("_Help" ("_FAQ..." help:show-faq)
("_News..." help:show-news) ("_WWW page..." help:show-homepage) ("_Manual..."
help:show-programmer-manual) ("_About Sawfish..." help:about)) () ("_Restart"
restart) ("_Quit" quit))

so it is there, and
user> (popup-menu custom-menu)
#<process running: /usr/libexec/sawfish/1.3/i686-pc-linux-gnu/sawfish-menu>
but this works and up pops the menu.

I am not sure where to go from here as I don't seem to be getting
anything from the output from sawfish.

Any help would be most appreciated as this is a bit of a pain, I don't
use the main menu all that much but when I do I really need it.

Thanks in advance,

Rohan




  • [SM-Discuss] sawfish not giving root menu, Rohan NIcholls, 09/02/2004

Archive powered by MHonArc 2.6.24.

Top of Page