aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ResizableTile.hs2
-rw-r--r--SetWMName.hs6
-rw-r--r--SwapWorkspaces.hs6
-rw-r--r--WindowBringer.hs5
-rw-r--r--XPrompt.hs8
-rw-r--r--XPropManage.hs3
-rw-r--r--XSelection.hs51
7 files changed, 49 insertions, 32 deletions
diff --git a/ResizableTile.hs b/ResizableTile.hs
index 9179136..24a1fea 100644
--- a/ResizableTile.hs
+++ b/ResizableTile.hs
@@ -11,7 +11,7 @@
-- Stability : unstable
-- Portability : unportable
--
--- More useful tiled layout that allows you to change a width/height of window.
+-- More useful tiled layout that allows you to change a width\/height of window.
--
-----------------------------------------------------------------------------
diff --git a/SetWMName.hs b/SetWMName.hs
index da7af3d..6eddda6 100644
--- a/SetWMName.hs
+++ b/SetWMName.hs
@@ -17,18 +17,18 @@
-- Remember that you need to call the setWMName action yourself (at least until
-- we have startup hooks). E.g., you can bind it in your Config.hs:
--
--- ((modMask .|. controlMask .|. shiftMask, xK_z), setWMName "LG3D") -- @@ Java hack
+-- > ((modMask .|. controlMask .|. shiftMask, xK_z), setWMName "LG3D") -- @@ Java hack
--
-- and press the key combination before running the Java programs (you only
-- need to do it once per XMonad execution)
--
-- For details on the problems with running Java GUI programs in non-reparenting
--- WMs, see <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6429775> and
+-- WMs, see "http:\/\/bugs.sun.com\/bugdatabase\/view_bug.do?bug_id=6429775" and
-- related bugs.
--
-- Setting WM name to "compiz" does not solve the problem, because of yet
-- another bug in AWT code (related to insets). For LG3D insets are explicitly
--- set to 0, while for other WMs the insets are "guessed" and the algorithm
+-- set to 0, while for other WMs the insets are \"guessed\" and the algorithm
-- fails miserably by guessing absolutely bogus values.
-----------------------------------------------------------------------------
diff --git a/SwapWorkspaces.hs b/SwapWorkspaces.hs
index b792fd7..a6aff7e 100644
--- a/SwapWorkspaces.hs
+++ b/SwapWorkspaces.hs
@@ -12,7 +12,9 @@
-- each other, without having to move individual windows.
--
-- TODO: add quickcheck props for:
+--
-- * double swap invariant (guarantees no 'loss' of workspaces)
+--
-- * non-swapped ws's invariant
--
-----------------------------------------------------------------------------
@@ -28,13 +30,15 @@ import StackSet
-- $usage
-- Add this import to your Config.hs:
+--
-- > import XMonadContrib.SwapWorkspaces
--
-- Throw this in your keys definition:
+--
-- > ++
-- > [((modMask .|. controlMask, k), windows $ swapWithCurrent i)
-- > | (i, k) <- zip workspaces [xK_1 ..]]
---
+
-- %import XMonadContrib.SwapWorkspaces
-- %keybindlist ++
-- %keybindlist [((modMask .|. controlMask, k), windows $ swapWithCurrent i)
diff --git a/WindowBringer.hs b/WindowBringer.hs
index 452d552..e58fc26 100644
--- a/WindowBringer.hs
+++ b/WindowBringer.hs
@@ -36,11 +36,14 @@ import XMonadContrib.NamedWindows (getName)
-- where you left your XChat.
--
-- Place in your Config.hs:
+--
-- > import XMonadContrib.WindowBringer
+--
-- and in the keys definition:
+--
-- > , ((modMask .|. shiftMask, xK_g ), gotoMenu)
-- > , ((modMask .|. shiftMask, xK_b ), bringMenu)
---
+
-- %import XMonadContrib.WindowBringer
-- %keybind ((modMask .|. shiftMask, xK_g ), gotoMenu)
-- %keybind ((modMask .|. shiftMask, xK_b ), bringMenu)
diff --git a/XPrompt.hs b/XPrompt.hs
index f4debb0..823478e 100644
--- a/XPrompt.hs
+++ b/XPrompt.hs
@@ -266,13 +266,13 @@ keyPressHandle :: KeyMask -> KeyStroke -> XP ()
keyPressHandle mask (ks,_)
| mask == controlMask =
case () of
--- ^U
+-- ctrl U
_ | ks == xK_u -> killBefore >> go
--- ^K
+-- ctrl K
| ks == xK_k -> killAfter >> go
--- ^A
+-- ctrl A
| ks == xK_a -> startOfLine >> go
--- ^E
+-- ctrl E
| ks == xK_e -> endOfLine >> go
-- Unhandled control sequence
| otherwise -> eventLoop handle
diff --git a/XPropManage.hs b/XPropManage.hs
index e64d790..e946832 100644
--- a/XPropManage.hs
+++ b/XPropManage.hs
@@ -29,6 +29,7 @@ import XMonad
-- $usage
--
-- Add something like the following lines to Config.hs to use this module
+--
-- > import XMonadContrib.XPropManage
--
-- > manageHook = xPropManageHook xPropMatches
@@ -51,7 +52,7 @@ import XMonad
-- a function to apply in 'windows' (see Operations.hs). So if the action does only work on the
-- WindowSet use just 'pmP function'.
--
--- *1 You can get the available properties of an application with the xprop utility. STRING properties
+-- \*1 You can get the available properties of an application with the xprop utility. STRING properties
-- should work fine. Others might not work.
--
diff --git a/XSelection.hs b/XSelection.hs
index 5c93b14..49f2760 100644
--- a/XSelection.hs
+++ b/XSelection.hs
@@ -4,23 +4,47 @@
-- Copyright : (C) 2007 Andrea Rossato, Matthew Sackman
-- License : BSD3
--
--- Maintainer : Andrea Rossato <andrea.rossato@unibz.it>, Matthew Sackman <matthew@wellquite.org>
+-- Maintainer : Andrea Rossato <andrea.rossato@unibz.it>,
+-- Matthew Sackman <matthew@wellquite.org>
-- Stability : unstable
-- Portability : unportable
--
-- A module for accessing and manipulating the X Window mouse selection (used in copy and pasting).
-- getSelection and putSelection are adaptations of Hxsel.hs and Hxput.hs from XMonad-utils, available:
--- $ darcs get http://gorgias.mine.nu/repos/xmonad-utils
+--
+-- $ darcs get "http:\/\/gorgias.mine.nu\/repos\/xmonad-utils"
-----------------------------------------------------------------------------
+
+module XMonadContrib.XSelection (
+ -- * Usage
+ -- $usage
+ getSelection, promptSelection, putSelection) where
+
+-- getSelection, putSelection's imports:
+import Graphics.X11.Xlib (allocaXEvent, createSimpleWindow, defaultScreen, destroyWindow, internAtom, nextEvent, openDisplay, rootWindow, selectionNotify, Display(), Atom(), XEventPtr(), selectionRequest, sendEvent, noEventMask, sync)
+import Graphics.X11.Xlib.Extras (currentTime, ev_event_type, getEvent, getWindowProperty8, xConvertSelection, xSetSelectionOwner, xGetSelectionOwner, changeProperty8, propModeReplace, setSelectionNotify, ev_requestor, ev_selection, ev_target, ev_property, ev_time, ev_event_display)
+import Data.Maybe (fromMaybe)
+import Control.Concurrent (forkIO)
+import Data.Char (chr, ord)
+import Control.Exception as E (catch)
+
+-- promptSelection's imports:
+import XMonad (io, spawn, X ())
+
+-- decode's imports
+import Foreign (Word8(), (.&.), shiftL, (.|.))
+
{- $usage
Add 'import XMonadContrib.XSelection' to the top of Config.hs
Then make use of getSelection or promptSelection as needed; if
one wanted to run Firefox with the selection as an argument (say,
the selection is an URL you just highlighted), then one could add
to the Config.hs a line like thus:
- , ((modMask .|. shiftMask, xK_b ), promptSelection "firefox")
+
+> , ((modMask .|. shiftMask, xK_b ), promptSelection "firefox")
TODO:
+
* Fix Unicode handling. Currently it's still better than calling
'chr' to translate to ASCII, though.
As near as I can tell, the mangling happens when the String is
@@ -30,27 +54,12 @@
a complex issue; see
<http://www.haskell.org/pipermail/xmonad/2007-September/001967.html>
and <http://www.haskell.org/pipermail/xmonad/2007-September/001966.html>.
+
* Possibly add some more elaborate functionality: Emacs' registers are nice.
-}
-module XMonadContrib.XSelection (getSelection, promptSelection, putSelection) where
-
--- getSelection, putSelection's imports:
-import Graphics.X11.Xlib (allocaXEvent, createSimpleWindow, defaultScreen, destroyWindow, internAtom, nextEvent, openDisplay, rootWindow, selectionNotify, Display(), Atom(), XEventPtr(), selectionRequest, sendEvent, noEventMask, sync)
-import Graphics.X11.Xlib.Extras (currentTime, ev_event_type, getEvent, getWindowProperty8, xConvertSelection, xSetSelectionOwner, xGetSelectionOwner, changeProperty8, propModeReplace, setSelectionNotify, ev_requestor, ev_selection, ev_target, ev_property, ev_time, ev_event_display)
-import Data.Maybe (fromMaybe)
-import Control.Concurrent (forkIO)
-import Data.Char (chr, ord)
-import Control.Exception as E (catch)
-
--- promptSelection's imports:
-import XMonad (io, spawn, X ())
-
--- decode's imports
-import Foreign (Word8(), (.&.), shiftL, (.|.))
-
-- | Returns a String corresponding to the current mouse selection in X; if there is none, an empty string is returned.. Note that this is
--- only reliable for ASCII text and currently mangles/escapes more complex UTF-8 characters.
+-- only reliable for ASCII text and currently mangles\/escapes more complex UTF-8 characters.
getSelection :: IO String
getSelection = do
dpy <- openDisplay ""
@@ -113,7 +122,7 @@ putSelection text = do
processEvent dpy ty text e
-- | A wrapper around getSelection. Makes it convenient to run a program with the current selection as an argument. This is convenient
--- for handling URLs, in particular. For example, in your Config.hs you could bind a key to 'promptSelection "firefox"'; this would allow you to
+-- for handling URLs, in particular. For example, in your Config.hs you could bind a key to @promptSelection \"firefox\"@; this would allow you to
-- highlight a URL string and then immediately open it up in Firefox.
promptSelection :: String -> X ()
promptSelection app = spawn . ((app ++ " ") ++) =<< io getSelection