aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2008-05-07 05:11:27 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2008-05-07 05:11:27 +0200
commit3d010652685bd3d3cdf724772f8dd5a75369b044 (patch)
tree92d2855f9d08ddcfdd11ffb1908d16d42ab1d79f
parentb7fd3571fde2f8ffc94ab39239e08fd50d5d6a65 (diff)
downloadXMonadContrib-3d010652685bd3d3cdf724772f8dd5a75369b044.tar.gz
XMonadContrib-3d010652685bd3d3cdf724772f8dd5a75369b044.tar.xz
XMonadContrib-3d010652685bd3d3cdf724772f8dd5a75369b044.zip
Add a binding for Gnome's "Run Application" dialog
darcs-hash:20080507031127-a5988-990b0b72dba7cfc24cd0789baf9867db42af0719.gz
-rw-r--r--XMonad/Config/Gnome.hs26
1 files changed, 24 insertions, 2 deletions
diff --git a/XMonad/Config/Gnome.hs b/XMonad/Config/Gnome.hs
index 5aa2f3e..2b7105e 100644
--- a/XMonad/Config/Gnome.hs
+++ b/XMonad/Config/Gnome.hs
@@ -14,12 +14,15 @@
module XMonad.Config.Gnome (
-- * Usage
-- -- $usage
- gnomeConfig
+ gnomeConfig,
+ gnomeRun
) where
import XMonad
import XMonad.Config.Desktop
+import qualified Data.Map as M
+
-- $usage
-- To use this module, start with the following @~\/.xmonad\/xmonad.hs@:
--
@@ -29,4 +32,23 @@ import XMonad.Config.Desktop
-- > main = xmonad gnomeConfig
--
-gnomeConfig = desktopConfig { terminal = "gnome-terminal" }
+gnomeConfig = desktopConfig
+ { terminal = "gnome-terminal"
+ , keys = \c -> gnomeKeys c `M.union` keys desktopConfig c }
+
+gnomeKeys (XConfig {modMask = modm}) = M.fromList $
+ [ ((modm, xK_p), gnomeRun) ]
+
+-- | Launch the "Run Application" dialog. gnome-panel must be running for this
+-- to work.
+gnomeRun :: X ()
+gnomeRun = withDisplay $ \dpy -> do
+ rw <- asks theRoot
+ gnome_panel <- getAtom "_GNOME_PANEL_ACTION"
+ panel_run <- getAtom "_GNOME_PANEL_ACTION_RUN_DIALOG"
+
+ io $ allocaXEvent $ \e -> do
+ setEventType e clientMessage
+ setClientMessageEvent e rw gnome_panel 32 panel_run 0
+ sendEvent dpy rw False structureNotifyMask e
+ sync dpy False