diff options
| author | Miguel <m.i@gmx.at> | 2019-01-27 20:05:18 +0100 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2019-01-27 20:05:18 +0100 |
| commit | dfe1efe982999312aba825c98918cdd205870cd2 (patch) | |
| tree | d6e0d16f717e8d970584da50794b3c7ff2231507 /xmonad/xmonad.hs | |
| parent | bd0c6bc05c529e90317e9b3d6f0ba7890a1ebca3 (diff) | |
some updates
Diffstat (limited to 'xmonad/xmonad.hs')
| -rw-r--r-- | xmonad/xmonad.hs | 125 |
1 files changed, 53 insertions, 72 deletions
diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs index 2974ed8..84337a8 100644 --- a/xmonad/xmonad.hs +++ b/xmonad/xmonad.hs @@ -1,6 +1,6 @@ -- -- Miguel's Xmonad Config. --- Last Update: 2018-05-29 +-- Last Update: 2018-06-07 -- import XMonad @@ -9,7 +9,6 @@ import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Actions.SpawnOn -import XMonad.Layout.Gaps import XMonad.Util.Run import qualified XMonad.StackSet as W import XMonad.Util.EZConfig @@ -21,7 +20,7 @@ import XMonad.Util.NamedWindows import XMonad.Util.WorkspaceCompare import System.IO --- testing layouts +import XMonad.Layout.Gaps import XMonad.Layout.NoBorders import XMonad.Layout.Accordion import XMonad.Layout.Circle @@ -37,8 +36,13 @@ configPath="/home/miguel/git/dotfiles/xmonad" -- DREAMS / TODO -- notify-send replace/ always same workspace -- bells for different apps: mutt, slrn , cmabber --- xterm-float that will float with 80x20 chars +-- xterm-float that will float with 80x20 chars? +-- help shift-mod-/ -- ... +-- TODO: would still like fullscreen flash vids to not crop and leave xmobar drawn +-- TODO: hook in TopicSpaces, start specific apps on specific workspaces +-- | The available layouts. Note that each layout is separated by |||, which +-- denotes layout choice.||| Circle||| OneBig (3/4) (3/4) ||| spiral (1/1.61803) ||| tabbedBottom shrinkText def {fontName="xft:Sans-13:bold",decoHeight=60} -- http://xmonad.org/manpage.html -- xmona key-bindings : @@ -58,41 +62,24 @@ configPath="/home/miguel/git/dotfiles/xmonad" -- mod-`1234567890-=< (+shifted) -- mod-qwer (+shifted) -- mouse-1/2/3 +-- +-- https://superuser.com/questions/478498/start-applications-on-specific-workspaces-in-xmonad +-- spawnOn appears to be broken !? + +spawnToWorkspace :: String -> String -> X () +spawnToWorkspace program workspace = do spawn program + windows $ W.greedyView workspace +spawnOnSingle workspace prog = spawnOn workspace $ "xterm -e " ++ configPath ++ "/single-startup.sh " ++ prog -- http://pbrisbin.com/posts/using_notify_osd_for_xmonad_notifications/ data LibNotifyUrgencyHook = LibNotifyUrgencyHook deriving (Read, Show) - instance UrgencyHook LibNotifyUrgencyHook where urgencyHook LibNotifyUrgencyHook w = do name <- getName w Just idx <- fmap (W.findTag w) $ gets windowset safeSpawn "notify-send" [show name, "workspace " ++ idx] --- TODO: would still like fullscreen flash vids to not crop and leave xmobar drawn --- TODO: remove the red border when doing fullscreen? tried adding 'smartBorders' to the layoutHook but that didn't work --- TODO: hook in TopicSpaces, start specific apps on specific workspaces - --- extra workspaces (used below) ---myExtraWorkspaces = --- [ --- (xK_quoteleft, "~★"), --- (xK_1, "1⚒"), --- (xK_2, "2⚁"), --- (xK_3, "3⚂"), --- (xK_4, "4⚃"), --- (xK_5, "5⚄"), --- (xK_6, "6✉"), --- (xK_7, "7⚛"), --- (xK_8, "8♬"), --- (xK_9, "9☎"), --- (xK_0, "0☭"), --- (xK_minus, "-☹"), --- (xK_equal, "+☺"), --- (xK_BackSpace, "<☠") --- ] --- | The available layouts. Note that each layout is separated by |||, which --- denotes layout choice.||| Circle||| OneBig (3/4) (3/4) ||| spiral (1/1.61803) ||| tabbedBottom shrinkText def {fontName="xft:Sans-13:bold",decoHeight=60} layout = tiled ||| Mirror tiled ||| noBorders Full ||| Grid ||| ThreeColMid 1 (3/100) (1/2) where -- default tiling algorithm partitions the screen into two panes @@ -129,69 +116,62 @@ myExtraWorkspaces = main = do xmproc <- spawnPipe $ "/usr/bin/xmobar "++configPath++"/xmobarrc" xmonad - $ withUrgencyHook LibNotifyUrgencyHook - $ docks $ ewmh defaultConfig { - --- workspaces = ["~","1","2","3","4","5","6","7","8","9","0"] ++ (map snd myExtraWorkspaces), - workspaces = (map snd myExtraWorkspaces), - borderWidth = 5, --- focusedBorderColor = "#ff4444", - focusedBorderColor = "#0000ff", - normalBorderColor = "#777777", --- workspaces = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n"] , - -- ++ map show [1,2,3,4], - --- focusFollowsMouse = False, - modMask = mod4Mask, +-- $ withUrgencyHook LibNotifyUrgencyHook +-- $ docks + $ ewmh defaultConfig { + + workspaces = (map snd myExtraWorkspaces) + ,borderWidth = 2 + ,normalBorderColor = "#586e75" + --focusedBorderColor = "#cb4b16", + ,focusedBorderColor = "#eee8d5" +-- focusFollowsMouse = False, + ,modMask = mod4Mask --terminal = "urxvt", - terminal = "xterm -e tmux" + ,terminal = "xterm -e tmux" -- if you are using xmonad 0.9, you can avoid web flash videos getting cropped in fullscreen like so: --- manageHook = ( isFullscreen --> doFullFloat ) <+> manageDocks <+> manageHook defaultConfig, + --,manageHook = ( isFullscreen --> doFullFloat ) <+> manageDocks <+> manageHook defaultConfig, -- (no longer needed in 0.10) - ,manageHook = composeAll [] - --[ className =? "XTerm" --> doFloat ] - + --,manageHook = composeAll [] <+> manageSpawn + ,manageHook = composeAll[ + className =? "Xmessage" --> doFloat + ] <+> manageSpawn <+> manageDocks <+> manageHook def -- (className=? "qemu-system-i386" -->doShift "2") -- <+> ( title=?"xterm-float" --> (doRectFloat$W.RationalRect 0 0 0.5 0.5) ) -- <+> manageSpawn <+> manageDocks <+> manageHook defaultConfig ,layoutHook = avoidStruts $ layout --- ,startupHook = do - --- spawnOn "1" "xterm" + ,startupHook = do spawnOnSingle "6" "mutt" +-- spawnOnSingle "6" "slrn" +-- spawnOnSingle "6" "newsbeuter" + spawnOnSingle "6" "mcabber" + spawnOnSingle "6" "weechat" +-- spawnToWorkspace "xterm" (map snd myExtraWorkspaces !! 6) -- spawnOn "6" "xterm -e irssi" -- spawnOn "6" "xterm -e slrn" -- spawnOn "6" "xterm -e mutt" -- spawnOn "9" "chromium --new-window https://people.live.com/ https://www.facebook.com/" - - --spawnOn "7" "chromium --new-window http://softwarefools.com/" --- spawn "chromium --new-window http://softwarefools.com/" - --- spawnOn "9" "skype" --- spawnOn "9" "pidgin" - --- spawnOn "9" "nm-applet" --- spawnOn "9" "skype --dbpath=/home/miguel/.Skype_atene" -- setWMName "LG3D" - --, - ,logHook = takeTopFocus >>( dynamicLogWithPP $ xmobarPP { -- ppOrder = reverse, - ppSort = mkWsSort $ getXineramaPhysicalWsCompare horizontalScreenOrderer, --getSortByXineramaPhysicalRule def, +-- ppSort = mkWsSort $ getXineramaPhysicalWsCompare horizontalScreenOrderer, --getSortByXineramaPhysicalRule def, + ppSort = getSortByXineramaPhysicalRule, +-- ppSort = mkWsSort $ getXineramaPhysicalWsCompare, +-- ppSort = mkWsSort $ getXineramaWsCompare, ppOutput = hPutStrLn xmproc, - ppTitle = xmobarColor "green" "" . shorten 50, - ppCurrent = (\x -> "<fc=red>"++x++"</fc>"), - ppVisible = (\x -> "<fc=green>"++x++"</fc>"), - ppHidden = (\x -> "<fc=yellow>"++x++"</fc>"), - ppHiddenNoWindows = (\x -> "<fc=gray>"++x++"</fc>") - ,ppVisibleNoWindows = Just (\x-> "<fc=blue>"++x++"</fc>") + ppTitle = xmobarColor "#859900" "" . shorten 50, --green + ppCurrent = (\x -> "<fc=#dc322f>"++x++"</fc>"), --red + ppVisible = (\x -> "<fc=#859900>"++x++"</fc>"), --green + ppHidden = (\x -> "<fc=#b58900>"++x++"</fc>"), --yellow + ppHiddenNoWindows = (\x -> "<fc=#93a1a1>"++x++"</fc>") --gray + -- ,ppVisibleNoWindows = Just (\x-> "<fc=#268bd2>"++x++"</fc>") --blue }) } `additionalKeys` ( @@ -199,9 +179,10 @@ main = do ((mod4Mask, xK_F1 ), spawn "xterm -e vim ~/.xmonad/xmonad.hs") ,((mod4Mask , xK_b ), sendMessage ToggleStruts) - , ((mod4Mask, xK_m ), spawn "notify-send \"$( fetchmail )\"") +-- , ((mod4Mask, xK_m ), spawn "notify-send \"$( fetchmail )\"") + , ((mod4Mask, xK_m ), spawn "xterm -e \"fetchmail&&sleep 2\"") , ((mod4Mask, xK_c ), spawn "notify-send \"$(xclip -o)\"") - , ((mod4Mask, xK_p ), spawn "dmenu_run -nb '#000' -nf '#77aaff' -sb '#77aadd' -sf black -fn '-adobe-courier-medium-r-*-*-34-*-*-*-*-*-*-*'") + , ((mod4Mask, xK_p ), spawn "dmenu_run -nb '#073642' -nf '#fdf6e3' -sb '#268bd2' -sf '#073642' -fn 'DejaVu Sans-10'") -- mods-s screenshot window -- , ((mod4Mask, xK_s ), spawn "xwd | convert - /tmp/screen.png && gimp /tmp/screen.png") @@ -236,7 +217,7 @@ main = do [ ((m .|. mod4Mask, key), screenWorkspace sc >>= flip whenJust (windows . f)) -- Replace 'mod1Mask' with your mod key of choice. - | (key, sc) <- zip [xK_q,xK_w, xK_e, xK_r] [3,2,0,1] -- was [0..] *** change to match your screen order *** + | (key, sc) <- zip [xK_q,xK_w, xK_e, xK_r] [2,0,1,3] -- was [0..] *** change to match your screen order *** , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ] |
