diff options
-rw-r--r-- | XMonad/Actions/Search.hs | 67 |
1 files changed, 32 insertions, 35 deletions
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 <https://secure.wikimedia.org/wikipedia/en/wiki/Surfraw>. 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! -} |