aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Creighton <jcreigh@gmail.com>2007-04-01 03:27:12 +0200
committerJason Creighton <jcreigh@gmail.com>2007-04-01 03:27:12 +0200
commita28e13dedfa16234314f4a4c8efe98f3cf5cf914 (patch)
tree7849e95d82cc33686228930d4074561bc859587b
parent571a1d698395ddc12ba849af4303696f00d17e94 (diff)
downloadxmonad-a28e13dedfa16234314f4a4c8efe98f3cf5cf914.tar.gz
xmonad-a28e13dedfa16234314f4a4c8efe98f3cf5cf914.tar.xz
xmonad-a28e13dedfa16234314f4a4c8efe98f3cf5cf914.zip
"dmenu" operation to spawn dmenu only on the current screen (for Xinerama)
This requires a dmenu that will accept -x and -w. Currently, This means applying this patch: http://www.jcreigh.com/dmenu/position-options.patch (I'm trying to see if I can get this into dmenu upstream; haven't heard anything back yet.) darcs-hash:20070401012712-b9aa7-00f28388a705814f8e542e8b25b1b41922e3cc6c.gz
-rw-r--r--Operations.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Operations.hs b/Operations.hs
index 4e2ae49..bd73fc4 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -343,3 +343,14 @@ restart = do
prog <- getProgName
args <- getArgs
executeFile prog True args Nothing
+
+-- | Starts dmenu on the current screen. (Requires patches to dmenu for the -x
+-- and -w options.)
+dmenu :: X ()
+dmenu = do
+ xinesc <- gets xineScreens
+ ws <- gets workspace
+ ws2sc <- gets wsOnScreen
+ let curscreen = fromMaybe 0 (M.lookup (W.current ws) ws2sc)
+ sc = xinesc !! curscreen
+ spawn $ "exe=`dmenu_path | dmenu -x " ++ (show $ rect_x sc) ++ " -w " ++ (show $ rect_width sc) ++ "` && exec $exe"