mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 04:01:51 -07:00
Search.hs: haddock cleanup
This commit is contained in:
@@ -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)
|
||||
@
|
||||
> -- 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)
|
||||
> ]
|
||||
|
||||
where:
|
||||
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...@
|
||||
|
||||
@
|
||||
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)
|
||||
]
|
||||
@
|
||||
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.
|
||||
|
||||
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.
|
||||
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!
|
||||
-}
|
||||
|
Reference in New Issue
Block a user