From 1fb7bc5eeeb14107abc57e50b33096f4758f5909 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Thu, 31 Jan 2008 17:19:48 +0100 Subject: Search.hs: haddock cleanup darcs-hash:20080131161948-bd4d7-2b3b51f5698ee4755402db7984406fa3c585fe76.gz --- XMonad/Actions/Search.hs | 67 +++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 35 deletions(-) (limited to 'XMonad/Actions/Search.hs') diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs index caae13c..9b8eb3a 100644 --- a/XMonad/Actions/Search.hs +++ b/XMonad/Actions/Search.hs @@ -8,13 +8,13 @@ Portability : unportable A module for easily running Internet searches on web sites through xmonad. - Modeled after the handy Surfraw CLI search tools + Modeled after the handy Surfraw CLI search tools at . Additional sites welcomed. -} module XMonad.Actions.Search ( -- * Usage - -- $usage + -- $usage search, simpleEngine, promptSearch, @@ -28,7 +28,8 @@ module XMonad.Actions.Search ( -- * Usage scholar, wayback, wikipedia - -- * Tip + + -- * Use case: searching with a submap -- $tip ) where @@ -86,44 +87,40 @@ Feel free to add more! {- $tip -In combination with "XMonad.Actions.Submap" you can create a powerfull -and easy way to search without adding a whole bunch of bindings: +In combination with "XMonad.Actions.Submap" you can create a powerful +and easy way to search without adding a whole bunch of bindings. First import the necessary modules: -@ -import qualified XMonad.Prompt as P -import qualified XMonad.Actions.Submap as SM -import qualified XMonad.Actions.Search as S -@ +> import qualified XMonad.Prompt as P +> import qualified XMonad.Actions.Submap as SM +> import qualified XMonad.Actions.Search as S Then add the following to your key bindings: -@ - -- Search commands - , ((modm, xK_s), SM.submap $ searchEngineMap $ S.promptSearch P.defaultXPConfig) - , ((modm .|. shiftMask, xK_s), SM.submap $ searchEngineMap $ S.selectSearch) -@ - -where: - -@ - searchEngineMap method = M.fromList $ - [ ((0, xK_g), method \"firefox\" S.google) - , ((0, xK_h), method \"firefox\" S.hoogle) - , ((0, xK_w), method \"firefox\" S.wikipedia) - ] -@ - -Make sure to set firefox to open new pages in a new window instead of in a new tab: -Firefox -> Edit -> Preferences -> Tabs -> New pages should be opened in... - -Now /modm-s g/ \/ /h/ \/ /w/ prompts you for a search string, then opens a new -firefox window that performs the search on Google, Hoogle or -Wikipedia respectively. - -If you select something in whatever application and hit /modm-shift-s g/ \/ /h/ \/ /w/ -it will search the selected string with the specified engine. +> -- Search commands +> , ((modm, xK_s), SM.submap $ searchEngineMap $ S.promptSearch P.defaultXPConfig) +> , ((modm .|. shiftMask, xK_s), SM.submap $ searchEngineMap $ S.selectSearch) +> +> ... +> +> searchEngineMap method = M.fromList $ +> [ ((0, xK_g), method \"firefox\" S.google) +> , ((0, xK_h), method \"firefox\" S.hoogle) +> , ((0, xK_w), method \"firefox\" S.wikipedia) +> ] + +Make sure to set firefox to open new pages in a new window instead of +in a new tab: @Firefox -> Edit -> Preferences -> Tabs -> New pages +should be opened in...@ + +Now /mod-s/ + /g/\//h/\//w/ prompts you for a search string, then +opens a new firefox window that performs the search on Google, Hoogle +or Wikipedia respectively. + +If you select something in whatever application and hit /mod-shift-s/ + +/g/\//h/\//w/ it will search the selected string with the specified +engine. Happy searching! -} -- cgit v1.2.3