(defgroup ysession "Menus") (defcustom ysession-commands nil "List of commands to execute at startup of Sawfish." :type (list string "Command") :group (misc ysession) :require ysession :after-set (lambda (ignore) (ysession-startup))) (defun ysession-startup () ;; Record the started commands on the root window. ;; They wont get run again if this file is re-run (eg. sawfish restarted) (let ((x (get-x-text-property 'root '_WM_YSESSION_STARTED)) (started)) (when x (do ((i 0 (1+ i))) ((>= i (length x))) (setq started (cons (aref x i) started)))) (mapc (lambda (command) (unless (member command started) (system (concat command " &")) (setq started (cons command started)))) ysession-commands) (set-x-text-property 'root '_WM_YSESSION_STARTED (apply vector started)))) (provide 'ysession) (ysession-startup) #| (defun read-menu (filename) "dynamic menu" (setq src-file (open-file filename 'read)) (setq res '()) (while (setq line (read-line src-file)) (if (string-match "^([a-zA-Z0-9\_]+):([a-zA-Z0-9\_\.\"\ \/-]+)\n$" line) (let ((entry (substring line (match-start 1) (match-end 1))) (prog (substring line (match-start 2) (match-end 2)))) (setq res (cons `(,entry (system ,(concat prog " &"))) res))))) (reverse res)) |#