mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 12:00:24 +10:00
Merge branch 'master' into 'master'
Add doCopy and doCopyToAll See merge request dwt1/dotfiles!29
This commit is contained in:
@@ -6,7 +6,7 @@ import System.Exit (exitSuccess)
|
|||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
|
|
||||||
-- Actions
|
-- Actions
|
||||||
import XMonad.Actions.CopyWindow (kill1)
|
import XMonad.Actions.CopyWindow (kill1, killAllOtherCopies, copyWindow)
|
||||||
import XMonad.Actions.CycleWS (Direction1D(..), moveTo, shiftTo, WSType(..), nextScreen, prevScreen)
|
import XMonad.Actions.CycleWS (Direction1D(..), moveTo, shiftTo, WSType(..), nextScreen, prevScreen)
|
||||||
import XMonad.Actions.GridSelect
|
import XMonad.Actions.GridSelect
|
||||||
import XMonad.Actions.MouseResize
|
import XMonad.Actions.MouseResize
|
||||||
@@ -305,6 +305,23 @@ myWorkspaceIndices = M.fromList $ zipWith (,) myWorkspaces [1..] -- (,) == \x y
|
|||||||
clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
|
clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
|
||||||
where i = fromJust $ M.lookup ws myWorkspaceIndices
|
where i = fromJust $ M.lookup ws myWorkspaceIndices
|
||||||
|
|
||||||
|
-- 'doCopy' copies the managed window into another workspace.
|
||||||
|
-- If you use this feature then you need to change your kill keybinding
|
||||||
|
-- from kill1 to killAllOtherCopies <+> kill1
|
||||||
|
-- I personally have two different keybindings, one for killing only copies, one for killing all of them.
|
||||||
|
doCopy :: WorkspaceId -> ManageHook
|
||||||
|
doCopy m = ask >>= \w -> doF (copyWindow w m)
|
||||||
|
|
||||||
|
-- 'doCopyToAll' simply copies managed window into the all workspaces.
|
||||||
|
-- Since scracthpads and dynamic workspaces are not presented in the 'myWorkspaces'
|
||||||
|
-- they will not be affected. I personally use this feature for my webcam.
|
||||||
|
-- , title =? "video - mpv" --> doFloat <+> doCopyToAll
|
||||||
|
-- If you use this feature then you need to change your kill keybinding
|
||||||
|
-- from kill1 to killAllOtherCopies <+> kill1
|
||||||
|
-- I personally have two different keybindings, one for killing only copies, one for killing all of them.
|
||||||
|
doCopyToAll :: ManageHook
|
||||||
|
doCopyToAll = foldr (\w rest -> doCopy (w) <+> rest) (doCopy (myWorkspaces !! 1)) myWorkspaces
|
||||||
|
|
||||||
myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
|
myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
|
||||||
myManageHook = composeAll
|
myManageHook = composeAll
|
||||||
-- 'doFloat' forces a window to float. Useful for dialog boxes and such.
|
-- 'doFloat' forces a window to float. Useful for dialog boxes and such.
|
||||||
|
|||||||
Reference in New Issue
Block a user