Re: Sawfish and gnome-panel action menu



Andrea Vettorello <dnc thctribe net> writes:
>
> sawfish-client -e "(send-client-message (get-window-by-name \"Top Panel\")
> '_GNOME_PANEL_ACTION (vector (x-atom '_GNOME_PANEL_ACTION_RUN_DIALOG) 0) 32)"
>
> This works binded to a key shorcut and executed as a shell script, maybe someone
> with more in depth Sawfish knowlege can suggest how to use it directly...

try this:

First, i had to change it, b/c the window title is localized/translated, so unsuitable:

(define (get-window-by-class-re re)
    "Get a window by matching against its class"
    (catch 'found
      (map-windows
       (lambda (w)
         (if (string-match re (window-class w))
             (throw 'found w))))))



(define-command 'invoke-gnome-run-dialog
  (lambda ()
    (let ((window (get-window-by-class-re "Gnome-panel")))
      (if (and (windowp window)
                 (window-id window))       ;window could be gone
        (send-client-message
         window
         '_GNOME_PANEL_ACTION
         (vector (x-atom '_GNOME_PANEL_ACTION_RUN_DIALOG) 0)
         32)
        (display-message (_ "no gnome panel found"))))))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]