mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 20:51:52 -07:00
Search.hs: haddock cleanup
This commit is contained in:
@@ -8,13 +8,13 @@
|
|||||||
Portability : unportable
|
Portability : unportable
|
||||||
|
|
||||||
A module for easily running Internet searches on web sites through xmonad.
|
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>.
|
<https://secure.wikimedia.org/wikipedia/en/wiki/Surfraw>.
|
||||||
|
|
||||||
Additional sites welcomed.
|
Additional sites welcomed.
|
||||||
-}
|
-}
|
||||||
module XMonad.Actions.Search ( -- * Usage
|
module XMonad.Actions.Search ( -- * Usage
|
||||||
-- $usage
|
-- $usage
|
||||||
search,
|
search,
|
||||||
simpleEngine,
|
simpleEngine,
|
||||||
promptSearch,
|
promptSearch,
|
||||||
@@ -28,7 +28,8 @@ module XMonad.Actions.Search ( -- * Usage
|
|||||||
scholar,
|
scholar,
|
||||||
wayback,
|
wayback,
|
||||||
wikipedia
|
wikipedia
|
||||||
-- * Tip
|
|
||||||
|
-- * Use case: searching with a submap
|
||||||
-- $tip
|
-- $tip
|
||||||
|
|
||||||
) where
|
) where
|
||||||
@@ -86,44 +87,40 @@ Feel free to add more!
|
|||||||
|
|
||||||
{- $tip
|
{- $tip
|
||||||
|
|
||||||
In combination with "XMonad.Actions.Submap" you can create a powerfull
|
In combination with "XMonad.Actions.Submap" you can create a powerful
|
||||||
and easy way to search without adding a whole bunch of bindings:
|
and easy way to search without adding a whole bunch of bindings.
|
||||||
|
|
||||||
First import the necessary modules:
|
First import the necessary modules:
|
||||||
|
|
||||||
@
|
> import qualified XMonad.Prompt as P
|
||||||
import qualified XMonad.Prompt as P
|
> import qualified XMonad.Actions.Submap as SM
|
||||||
import qualified XMonad.Actions.Submap as SM
|
> import qualified XMonad.Actions.Search as S
|
||||||
import qualified XMonad.Actions.Search as S
|
|
||||||
@
|
|
||||||
|
|
||||||
Then add the following to your key bindings:
|
Then add the following to your key bindings:
|
||||||
|
|
||||||
@
|
> -- Search commands
|
||||||
-- Search commands
|
> , ((modm, xK_s), SM.submap $ searchEngineMap $ S.promptSearch P.defaultXPConfig)
|
||||||
, ((modm, xK_s), SM.submap $ searchEngineMap $ S.promptSearch P.defaultXPConfig)
|
> , ((modm .|. shiftMask, xK_s), SM.submap $ searchEngineMap $ S.selectSearch)
|
||||||
, ((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...@
|
||||||
|
|
||||||
@
|
Now /mod-s/ + /g/\//h/\//w/ prompts you for a search string, then
|
||||||
searchEngineMap method = M.fromList $
|
opens a new firefox window that performs the search on Google, Hoogle
|
||||||
[ ((0, xK_g), method \"firefox\" S.google)
|
or Wikipedia respectively.
|
||||||
, ((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:
|
If you select something in whatever application and hit /mod-shift-s/ +
|
||||||
Firefox -> Edit -> Preferences -> Tabs -> New pages should be opened in...
|
/g/\//h/\//w/ it will search the selected string with the specified
|
||||||
|
engine.
|
||||||
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.
|
|
||||||
|
|
||||||
Happy searching!
|
Happy searching!
|
||||||
-}
|
-}
|
||||||
|
Reference in New Issue
Block a user