diff options
author | Daniel Schoepe <daniel.schoepe@gmail.com> | 2009-07-09 12:07:03 +0200 |
---|---|---|
committer | Daniel Schoepe <daniel.schoepe@gmail.com> | 2009-07-09 12:07:03 +0200 |
commit | 525d6d99f0740345e55a551f0768b43e32931b51 (patch) | |
tree | b93d5dfb33e472b0ffecbf4c8ed51aebf0a4e5b6 | |
parent | 2535cc7fae76e0512f62b76b5b1b81d6c9b8d15e (diff) | |
download | XMonadContrib-525d6d99f0740345e55a551f0768b43e32931b51.tar.gz XMonadContrib-525d6d99f0740345e55a551f0768b43e32931b51.tar.xz XMonadContrib-525d6d99f0740345e55a551f0768b43e32931b51.zip |
Add ability to copy the entered string in X.Prompt
Ignore-this: 4e8b98f281001d7540617d0ff6a3d4f3
darcs-hash:20090709100703-7f603-ca459dc9695aab8fc70396761bdd6bf51ca962ab.gz
-rw-r--r-- | XMonad/Prompt.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index eb25fba..123c8a6 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -56,7 +56,7 @@ import Prelude hiding (catch) import XMonad hiding (config, io) import qualified XMonad.StackSet as W import XMonad.Util.Font -import XMonad.Util.XSelection (getSelection) +import XMonad.Util.XSelection (getSelection, putSelection) import Control.Arrow ((&&&)) import Control.Concurrent (threadDelay) @@ -371,6 +371,7 @@ keyPressHandle mask (ks,_) | ks == xK_a -> startOfLine >> go | ks == xK_e -> endOfLine >> go | ks == xK_y -> pasteString >> go + | ks == xK_c -> copyString >> go | ks == xK_Right -> moveWord Next >> go | ks == xK_Left -> moveWord Prev >> go | ks == xK_Delete -> killWord Next >> go @@ -459,6 +460,10 @@ insertString str = pasteString :: XP () pasteString = join $ io $ liftM insertString $ getSelection +-- | Copy the currently entered string into the X selection. +copyString :: XP () +copyString = gets command >>= io . putSelection + -- | Remove a character at the cursor position deleteString :: Direction -> XP () deleteString d = |