summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <gueux@gueux.org>2014-11-05 09:13:13 +0100
committerFélix Sipma <gueux@gueux.org>2014-11-05 09:13:13 +0100
commit48763e58dc0980e2c88e4ddd730b3da28a47c060 (patch)
treeb01b5f6cc9c7f8854f426f10570e0e8cc7e43a3d
parent7388ea983ac90dfa6c7641844fb1b4ea7dcd13f6 (diff)
xmonad: remove xmonad_azerty.hs
-rw-r--r--[l---------].xmonad/xmonad.hs282
-rw-r--r--.xmonad/xmonad_azerty.hs141
-rw-r--r--.xmonad/xmonad_bepo.hs281
3 files changed, 281 insertions, 423 deletions
diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs
index af6a25b..6bf92be 120000..100644
--- a/.xmonad/xmonad.hs
+++ b/.xmonad/xmonad.hs
@@ -1 +1,281 @@
-/home/gueux/.xmonad/xmonad_bepo.hs \ No newline at end of file
+{-# LANGUAGE CPP, TypeFamilies #-}
+
+{-
+#include <X11/XF86keysym.h>
+-}
+
+-- xmonad.hs bépo
+
+import XMonad
+import XMonad.Hooks.DynamicLog
+import XMonad.Hooks.ManageDocks
+import XMonad.Hooks.UrgencyHook
+import XMonad.Util.Scratchpad
+import XMonad.Prompt
+import XMonad.Prompt.Ssh
+import XMonad.Prompt.Window
+import XMonad.Prompt.Shell
+import qualified XMonad.StackSet as W
+import Data.Ratio ((%))
+--import System.IO.UTF8
+import System.IO
+-- import XMonad.Util.Dzen
+import XMonad.Layout.NoBorders
+import XMonad.Layout.Grid
+import XMonad.Layout.Tabbed
+import XMonad.Util.EZConfig
+--import XMonad.Util.Run hiding (hPutStrLn)
+import XMonad.Util.Run
+import XMonad.Actions.CycleWS
+import Graphics.X11.ExtraTypes.XF86
+--import XMonad.Actions.DynamicWorkspaces
+--import XMonad.Actions.WorkspaceNames
+--import XMonad.Actions.Submap
+
+myUrgencyHook =
+ withUrgencyHookC
+ dzenUrgencyHook { args = ["-x", "300", "-h", "14", "-w", "500", "-bg", "yellow", "-fg", "black"] }
+ --dzenUrgencyHook { args = ["-bg", "yellow", "-fg", "black"] }
+ --NoUrgencyHook
+ urgencyConfig { suppressWhen = Focused }
+
+webWS :: WorkspaceId
+webWS = "9:web"
+
+workspaces' :: [WorkspaceId]
+workspaces' = ["1", "2", "3", "4", "5", "6", "7", "8", webWS, "0:easytag", "é:pdf"]
+
+-- bépo
+workspaceskeys :: [KeySym]
+workspaceskeys = [xK_asciitilde, xK_quotedbl, xK_apostrophe, xK_exclam, xK_question, xK_at, xK_plus, xK_minus, xK_slash, xK_asterisk, xK_eacute]
+
+--classNames obtained with "xprop"
+myManageHook :: ManageHook
+myManageHook = scratchpadManageHookDefault <+>
+ (composeAll . concat $
+ [ [ className =? c --> doFloat | c <- floats]
+ , [ (resource =? "Navigator" <&&> className =? w) --> doShift "9:web" | w <- webs]
+ , [ className =? w --> doShift "é:pdf" | w <- pdfs]
+ , [ resource =? "desktop_window" --> doIgnore
+ , className =? "Easytag" --> doShift "0:easytag"
+-- , (resource =? "win" <&&> className =? "Xpdf") --> doShift "é:xpdf"
+ ]
+ ])
+ --where floats = ["Vlc", "MPlayer", ".", "feh", "Gimp", "Inkscape", "XPaint", "Toplevel", "Gm_tcl"]
+ where floats = ["Vlc", "MPlayer", ".", "feh", "XPaint", "Toplevel", "Gm_tcl", "mpv", "Screenruler"]
+ webs = ["Firefox", "Opera", "Iceweasel"]
+ pdfs = ["Xpdf", "Evince", "Zathura"]
+ --moveTo = doF . W.shift
+
+-- shamelessly stolen from Xilon's config
+-- myPP handle = defaultPP {
+-- ppUrgent = wrap ("^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myUrgentBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
+-- ppCurrent = wrap ("^fg(" ++ myFocusedFGColor ++ ")^bg(" ++ myFocusedBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
+-- ppVisible = wrap ("^fg(" ++ myNormalFGColor ++ ")^bg(" ++ myNormalBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
+-- ppSep = "^p(4)^fg(" ++ mySeperatorColor ++ ")^r(3x3)^fg()^p(4)",
+-- ppTitle = wrap ("^fg(" ++ myFocusedFGColor ++ ")") "^fg()",
+-- -- ppExtras = [formatUrgent],
+-- ppOrder = \(ws:l:t:xs) -> xs ++ [l,ws,t], -- remove or re-arrange l.ayout ws.orkspaces or t.itle as desired
+-- ppOutput = hPutStrLn handle
+-- }
+
+
+--{{{ Theme
+
+--Font
+--myFont = "Terminus-6"
+
+-- Colors
+
+--- Main Colours
+myFgColor, myBgColor, myHighlightedFgColor, myHighlightedBgColor :: String
+myFgColor = "#DCDCCC"
+myBgColor = "#3f3f3f"
+myHighlightedFgColor = myFgColor
+myHighlightedBgColor = "#7F9F7F"
+
+--- Borders
+myNormalBorderColor, myFocusedBorderColor :: String
+myNormalBorderColor = "#454545"
+myFocusedBorderColor = "#f9b857"
+
+--- Ws Stuff
+myCurrentWsFgColor, myCurrentWsBgColor, myVisibleWsFgColor, myVisibleWsBgColor,
+ myHiddenWsFgColor, myTitleFgColor :: String
+myCurrentWsFgColor = myHighlightedFgColor
+myCurrentWsBgColor = myHighlightedBgColor
+myVisibleWsFgColor = myBgColor
+myVisibleWsBgColor = "#CCDC90"
+myHiddenWsFgColor = myHighlightedFgColor
+myTitleFgColor = myFgColor
+
+--- Urgency
+myUrgentFgColor, myUrgentBgColor :: String
+myUrgentFgColor = "#ffffff"
+myUrgentBgColor = "#f57900"
+
+-- }}}
+
+
+---{{{ Dzen Config
+myPP :: Handle -> PP
+myPP h = defaultPP {
+ ppOutput = hPutStrLn h,
+ ppSep = wrapFg myHighlightedBgColor "|",
+ ppWsSep = "",
+ ppCurrent = wrapFgBg myCurrentWsFgColor myCurrentWsBgColor,
+ ppVisible = wrapFgBg myVisibleWsFgColor myVisibleWsBgColor,
+ ppHidden = wrapFg myHiddenWsFgColor,
+ --ppUrgent = wrapFgBg myUrgentFgColor myUrgentBgColor,
+ ppUrgent = wrap ("^fg(" ++ myUrgentFgColor ++ ")^bg(" ++ myUrgentBgColor ++ ")!!!!") "!!!!^fg()^bg()",
+ ppTitle = \x -> " " ++ wrapFg myTitleFgColor x,
+ ppLayout = dzenColor myFgColor"",
+-- ppExtras = [formatUrgent],
+ ppOrder = \(ws:l:t:xs) -> xs ++ [l,ws,t] -- remove or re-arrange l.ayout ws.orkspaces or t.itle as desired
+ }
+ where
+ wrapFgBg fgColor' bgColor' = wrap ("^fg(" ++ fgColor' ++ ")^bg(" ++ bgColor' ++ ")") "^fg()^bg()"
+ wrapFg fgColor' = wrap ("^fg(" ++ fgColor' ++ ")") "^fg()"
+--}}}
+
+
+-- for ppExtras use
+-- formatUrgent :: X (Maybe String)
+-- formatUrgent = do
+-- urge <- readUrgents
+-- if null urge
+-- then return Nothing
+-- else return . Just $ "^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myUrgentBGColor ++ ")^p(4)"
+-- layout' ::
+layout' = avoidStruts (smartBorders (tiled ||| Mirror tiled ||| Grid ||| Full ||| simpleTabbed ))
+ where
+ tiled = Tall nmaster delta ratio
+ nmaster = 1 -- The default number of windows in the master pane
+ ratio = 132%212 -- Default proportion of screen occupied by master pane
+ delta = 5%100 -- Percent of screen to increment by when resizing panes
+
+modm :: KeyMask
+modm = mod1Mask
+
+keys' :: [((KeyMask, KeySym), X ())]
+keys' =
+ -- zip (zip (repeat (modm)) workspaceskeys) (map (withNthWorkspace W.greedyView) [0..])
+ -- ++
+ -- zip (zip (repeat (modm .|. shiftMask)) workspaceskeys) (map (withNthWorkspace W.shift) [0..])
+ [((m .|. modm, k), windows $ f i)
+ | (i, k) <- zip workspaces' workspaceskeys
+ , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
+ ++
+ [ ((modm, 0x3b), sendMessage (IncMasterN (-1))) -- %! Deincrement the number of windows in the master area
+ , ((modm, xK_b), sendMessage ToggleStruts) -- Toggle dzen gap
+ , ((modm, xK_Tab), toggleWS) -- Toggle workspaces
+ , ((modm, xK_z), withFocused $ windows . W.sink) -- unfloat
+ , ((modm, xK_u), focusUrgent)
+ , ((modm, xK_s), sshPrompt defaultXPConfig)
+ --, ((modm .|. shiftMask, xK_p), shellPrompt defaultXPConfig)
+ , ((modm, xK_p), shellPrompt defaultXPConfig)
+ --, ((modm, xK_f), safePrompt "firefox" defaultXPConfig)
+ , ((modm, xK_g), windowPromptGoto defaultXPConfig)
+ --, ((modm, xK_semicolon), spawn "mpc next")
+ --, ((modm, xK_comma), spawn "mpc prev")
+ -- bépo
+ , ((modm, xK_t), windows W.focusDown)
+ , ((modm, xK_s), windows W.focusUp)
+ , ((modm .|. shiftMask, xK_t), windows W.swapDown)
+ , ((modm .|. shiftMask, xK_s), windows W.swapUp)
+ --, ((modm, xK_t), windows W.swapDown)
+ --, ((modm, xK_s), windows W.swapUp)
+ , ((modm, xK_c), sendMessage Shrink)
+ , ((modm, xK_r), sendMessage Expand)
+ , ((modm, xK_j), spawn "urxvt")
+ --, ((modm .|. shiftMask, xK_j), kill)
+ , ((modm, xK_k), spawn "emacsclient -c")
+ --, ((modm, xK_l), spawn "urxvtc -e screen")
+ --, ((modm, xK_l), spawn "urxvtc -e mutt")
+ , ((modm, xK_l), spawn "dzen2-music.sh")
+ , ((modm, xK_h), spawn "dzen2-remind.sh")
+ -- dynamic workspaces
+ -- , ((modm .|. shiftMask, xK_BackSpace), removeWorkspace)
+ -- , ((modm .|. shiftMask, xK_v ), selectWorkspace defaultXPConfig)
+ -- , ((modm, xK_m ), withWorkspace defaultXPConfig (windows . W.shift))
+ -- , ((modm .|. shiftMask, xK_m ), withWorkspace defaultXPConfig (windows . copy))
+ -- , ((modm .|. shiftMask, xK_r ), renameWorkspace defaultXPConfig)
+ -- , ((0, xF86XK_ScreenSaver), spawn "slock")
+ ]
+ ++
+ multimedia
+
+shortcut :: MonadIO x => keyMask -> String -> keySym -> ((keyMask, keySym), x ())
+shortcut keyMask command keySym = ((keyMask, keySym), spawn command)
+
+multimedia :: [((KeyMask, KeySym), X ())]
+multimedia =
+ [ player "prev" xK_KP_Down
+ , player "next" xK_KP_End
+-- , amixer "toggle" XF86XK_AudioMute
+ --, noMask "pacmd dump|awk --non-decimal-data '$1~/set-sink-mute/{system (\"pacmd \"$1\" \"$2\" \"($3==\"yes\"?\"no\":\"yes\"))}' >/dev/null" XF86XK_AudioMute
+ , player "toggle" xK_Pause
+ , player "stop" xF86XK_AudioStop
+ --, doubleVolume '-' XF86XK_AudioLowerVolume
+ --, doubleVolume '+' XF86XK_AudioRaiseVolume
+ , doubleVolume '-' xF86XK_AudioLowerVolume
+ , doubleVolume '+' xF86XK_AudioRaiseVolume
+ , noMask "slock" xF86XK_ScreenSaver
+ --, noMask "pacmd dump|awk --non-decimal-data '$1~/set-sink-volume/{system (\"pacmd \"$1\" \"$2\" \"$3-1000)}' >/dev/null" XF86XK_AudioLowerVolume
+ --, noMask "pacmd dump|awk --non-decimal-data '$1~/set-sink-volume/{system (\"pacmd \"$1\" \"$2\" \"$3+1000)}' >/dev/null" XF86XK_AudioRaiseVolume
+ --, noMask "screenshot.sh" XF86XK_ScreenSaver
+ , noMask "bepo.sh" XF86XK_Calculator
+ --, noMask "dzen2-remind.sh" XF86XK_Calculator
+ --, noMask "bépo.sh" XF86XK_Calculator
+ , noMask "vga.sh" XF86XK_Display
+ --, noMask "vga.sh" 0x1008ff59
+ , noMask "sudo pm-hibernate" XF86XK_Suspend
+ --, noMask "dzen2-music.sh" xK_KP_Next
+ , ((0, xF86XK_HomePage), windows $ W.greedyView webWS)
+ ]
+
+player :: String -> keySym -> ((KeyMask, keySym), X ())
+player command =
+ noMask $ "mpc " ++ command
+
+players :: String -> String -> keySym -> ((KeyMask, keySym), X ())
+players mpc rhythmbox =
+ noMask $ "mpc " ++ mpc ++ "; rhythmbox-client --no-start --" ++ rhythmbox
+
+noMask :: String -> keySym -> ((KeyMask, keySym), X ())
+noMask = shortcut 0
+
+amixer :: String -> keySym -> ((KeyMask, keySym), X ())
+amixer option = noMask $ "amixer -q set Master " ++ option
+
+volume :: String -> Char -> keySym -> ((KeyMask, keySym), X ())
+volume scontrol signal = amixer $ scontrol ++ " 1" ++ [signal]
+
+doubleVolume :: Char -> keySym -> ((KeyMask, keySym), X ())
+doubleVolume signal = noMask $ "amixer -q set Master 1" ++ [signal] ++ " && amixer -q set PCM 2" ++ [signal]
+
+main :: IO ()
+main = do
+ h <- spawnPipe ("dzen2" ++ " " ++ flags)
+ xmonad $ myUrgencyHook $ defaultConfig
+ {
+ workspaces = workspaces'
+ , borderWidth = 2
+ , layoutHook = layout'
+ --, manageHook = manageDocks <+> manageHook defaultConfig
+ , manageHook = myManageHook <+> manageDocks
+ , terminal = "urxvt"
+ , normalBorderColor = myNormalBorderColor
+ , logHook = dynamicLogWithPP $ myPP h
+ , focusedBorderColor = myFocusedBorderColor
+ , focusFollowsMouse = False
+ }
+ `additionalKeys` keys'
+ where
+ fg = "'grey70'"
+ --bg = "'#2c2c32'"
+ bg = "'#222'"
+ --fn = "'-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*'"
+ --fn = "'Profont:style=regular:pixelsize=12'"
+ fn = "'ProggyTinyTTSZ:pixelsize=16:style=medium'"
+ flags = "-e '' -w 600 -ta l -fg " ++ fg ++ " -bg " ++ bg ++ " -fn " ++ fn
diff --git a/.xmonad/xmonad_azerty.hs b/.xmonad/xmonad_azerty.hs
deleted file mode 100644
index ec1fa75..0000000
--- a/.xmonad/xmonad_azerty.hs
+++ /dev/null
@@ -1,141 +0,0 @@
--- xmonad.hs azerty
-
-import XMonad
-import XMonad.Layout
-import XMonad.Operations
-import XMonad.Hooks.DynamicLog
-import XMonad.Hooks.ManageDocks
-import XMonad.Hooks.UrgencyHook
-import XMonad.Util.Scratchpad
-import XMonad.Actions.DwmPromote
-import XMonad.Prompt
-import XMonad.Prompt.Man
-import XMonad.Prompt.Ssh
-import XMonad.Prompt.Window
-import XMonad.Prompt.Shell
-import qualified Data.Map as M
-import Graphics.X11
-import qualified XMonad.StackSet as W
-import Data.Bits ((.|.))
-import Data.Ratio ((%))
-import System.IO
-
--- import XMonad.Util.Dzen
-import XMonad.Layout.NoBorders
-import XMonad.Layout.Grid
-import XMonad.Layout.Tabbed
-import XMonad.Hooks.UrgencyHook
-import XMonad.Util.EZConfig
-import XMonad.Util.Run
-
-myNormalBGColor = "#111111"
-myFocusedBGColor = "#010101"
-myNormalFGColor = "#111111"
-myFocusedFGColor = "#ffffff"
-myUrgentFGColor = "#f57900"
-myUrgentBGColor = myNormalBGColor
-mySeperatorColor = "#2e3436"
-
-
-main = do
- h <- spawnPipe ("dzen2" ++ " " ++ flags)
- xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
- { workspaces = workspaces'
- , borderWidth = 2
- , layoutHook = layout'
- --, manageHook = manageDocks <+> manageHook defaultConfig
- , manageHook = myManageHook <+> manageDocks
- , terminal = "urxvtc"
- , normalBorderColor = "#454545"
- , logHook = dynamicLogWithPP $ myPP h
- , focusedBorderColor = "#f9b857"
- , focusFollowsMouse = False
- }
- `additionalKeys` keys'
- where
- fg = "'grey70'"
- bg = "'#2c2c32'"
- fn = "'-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*'"
- flags = "-e '' -w 540 -ta l -fg " ++ fg ++ " -bg " ++ bg ++ " -fn " ++ fn
-
-
--- workspaces' = ["α","β","γ","δ","ε","ζ"] ++ map show [7 .. 15 :: Int]
-workspaces' = map show [1 .. 10 :: Int]
-
-myManageHook' = manageDocks <+>
- composeAll
- [ className =? "MPlayer" --> doFloat
- , className =? "feh" --> doFloat
- , className =? "Gimp" --> doFloat
- , className =? "gecko" --> doF (W.shift "2")]
-
-myManageHook = scratchpadManageHookDefault <+>
- (composeAll . concat $
- [ [ className =? c --> doFloat | c <- floats]
- ])
- where floats = ["MPlayer", ".", "feh", "Gimp"]
- webs = ["Firefox-bin", "Firefox", "Minefield"]
- moveTo = doF . W.shift
-
-
--- shamelessly stolen from Xilon's config
-myPP handle = defaultPP {
- ppCurrent = wrap ("^fg(" ++ myFocusedFGColor ++ ")^bg(" ++ myFocusedBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
- ppUrgent = wrap ("^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myUrgentBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
- ppVisible = wrap ("^fg(" ++ myNormalFGColor ++ ")^bg(" ++ myNormalBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
- ppSep = "^fg(" ++ mySeperatorColor ++ ")^r(3x3)^fg()",
- ppTitle = wrap (" ^fg(" ++ myFocusedFGColor ++ ")") "^fg()" ,
- ppOutput = hPutStrLn handle
-}
-
-
-layout' = avoidStruts (smartBorders (tiled ||| Mirror tiled ||| Grid ||| Full ||| simpleTabbed ))
- where
- tiled = Tall nmaster delta ratio
- nmaster = 1 -- The default number of windows in the master pane
- ratio = 132%212 -- Default proportion of screen occupied by master pane
- delta = 5%100 -- Percent of screen to increment by when resizing panes
-
-keys' = [((m .|. mod1Mask, k), windows $ f i)
- | (i, k) <- zip workspaces' [0x26,0xe9,0x22,0x27,0x28,0x2d,0xe8,0x5f,0xe7,0xe0]
- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
- ++
- [((mod1Mask, 0x3b), sendMessage (IncMasterN (-1))) -- %! Deincrement the number of windows in the master area
- ,((mod1Mask, xK_b), sendMessage ToggleStruts) -- Toggle dzen gap
-
- ,((mod1Mask, xK_u), withFocused $ windows . W.sink) -- unfloat
- --,((mod1Mask , xK_s), sshPrompt defaultXPConfig)
- --,((mod1Mask .|. shiftMask , xK_p), shellPrompt defaultXPConfig)
- ,((mod1Mask, xK_p), shellPrompt defaultXPConfig)
- --,((mod1Mask , xK_u), safePrompt "iceweasel" defaultXPConfig)
- ,((mod1Mask, xK_g), windowPromptGoto defaultXPConfig)
- ,((mod1Mask, xK_semicolon), spawn "mpc next")
- ,((mod1Mask, xK_comma), spawn "mpc prev")
- --,((controlMask, xK_v), spawn "xclip -o")
- -- bépo
- ,((mod1Mask, xK_t), windows W.focusDown)
- ,((mod1Mask, xK_s), windows W.focusUp)
- ,((mod1Mask .|. shiftMask, xK_t), windows W.swapDown)
- ,((mod1Mask .|. shiftMask, xK_s), windows W.swapUp)
- ,((mod1Mask, xK_c), sendMessage Shrink)
- ,((mod1Mask, xK_r), sendMessage Expand)
- ]
-
-
-
--- Launch xmonad with the following:
---
--- #!/bin/sh
---
--- FG='grey70'
--- BG='#2c2c32'
--- FONT='-*-profont-*-*-*-*-12-*-*-*-*-*-*'
---
--- while (true); do ~/scripts/weather.pl; done &
--- xmonad-acpi | dzen2 -e '' -x 600 -w 768 -ta r -fg $FG -bg $BG -fn $FONT &
--- xmonad &
---
--- wait $!
--- pkill -HUP dzen2
--- pkill -HUP -f xmonad-acpi
--- wait
diff --git a/.xmonad/xmonad_bepo.hs b/.xmonad/xmonad_bepo.hs
deleted file mode 100644
index 6bf92be..0000000
--- a/.xmonad/xmonad_bepo.hs
+++ /dev/null
@@ -1,281 +0,0 @@
-{-# LANGUAGE CPP, TypeFamilies #-}
-
-{-
-#include <X11/XF86keysym.h>
--}
-
--- xmonad.hs bépo
-
-import XMonad
-import XMonad.Hooks.DynamicLog
-import XMonad.Hooks.ManageDocks
-import XMonad.Hooks.UrgencyHook
-import XMonad.Util.Scratchpad
-import XMonad.Prompt
-import XMonad.Prompt.Ssh
-import XMonad.Prompt.Window
-import XMonad.Prompt.Shell
-import qualified XMonad.StackSet as W
-import Data.Ratio ((%))
---import System.IO.UTF8
-import System.IO
--- import XMonad.Util.Dzen
-import XMonad.Layout.NoBorders
-import XMonad.Layout.Grid
-import XMonad.Layout.Tabbed
-import XMonad.Util.EZConfig
---import XMonad.Util.Run hiding (hPutStrLn)
-import XMonad.Util.Run
-import XMonad.Actions.CycleWS
-import Graphics.X11.ExtraTypes.XF86
---import XMonad.Actions.DynamicWorkspaces
---import XMonad.Actions.WorkspaceNames
---import XMonad.Actions.Submap
-
-myUrgencyHook =
- withUrgencyHookC
- dzenUrgencyHook { args = ["-x", "300", "-h", "14", "-w", "500", "-bg", "yellow", "-fg", "black"] }
- --dzenUrgencyHook { args = ["-bg", "yellow", "-fg", "black"] }
- --NoUrgencyHook
- urgencyConfig { suppressWhen = Focused }
-
-webWS :: WorkspaceId
-webWS = "9:web"
-
-workspaces' :: [WorkspaceId]
-workspaces' = ["1", "2", "3", "4", "5", "6", "7", "8", webWS, "0:easytag", "é:pdf"]
-
--- bépo
-workspaceskeys :: [KeySym]
-workspaceskeys = [xK_asciitilde, xK_quotedbl, xK_apostrophe, xK_exclam, xK_question, xK_at, xK_plus, xK_minus, xK_slash, xK_asterisk, xK_eacute]
-
---classNames obtained with "xprop"
-myManageHook :: ManageHook
-myManageHook = scratchpadManageHookDefault <+>
- (composeAll . concat $
- [ [ className =? c --> doFloat | c <- floats]
- , [ (resource =? "Navigator" <&&> className =? w) --> doShift "9:web" | w <- webs]
- , [ className =? w --> doShift "é:pdf" | w <- pdfs]
- , [ resource =? "desktop_window" --> doIgnore
- , className =? "Easytag" --> doShift "0:easytag"
--- , (resource =? "win" <&&> className =? "Xpdf") --> doShift "é:xpdf"
- ]
- ])
- --where floats = ["Vlc", "MPlayer", ".", "feh", "Gimp", "Inkscape", "XPaint", "Toplevel", "Gm_tcl"]
- where floats = ["Vlc", "MPlayer", ".", "feh", "XPaint", "Toplevel", "Gm_tcl", "mpv", "Screenruler"]
- webs = ["Firefox", "Opera", "Iceweasel"]
- pdfs = ["Xpdf", "Evince", "Zathura"]
- --moveTo = doF . W.shift
-
--- shamelessly stolen from Xilon's config
--- myPP handle = defaultPP {
--- ppUrgent = wrap ("^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myUrgentBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
--- ppCurrent = wrap ("^fg(" ++ myFocusedFGColor ++ ")^bg(" ++ myFocusedBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
--- ppVisible = wrap ("^fg(" ++ myNormalFGColor ++ ")^bg(" ++ myNormalBGColor ++ ")^p(4)") "^p(4)^fg()^bg()",
--- ppSep = "^p(4)^fg(" ++ mySeperatorColor ++ ")^r(3x3)^fg()^p(4)",
--- ppTitle = wrap ("^fg(" ++ myFocusedFGColor ++ ")") "^fg()",
--- -- ppExtras = [formatUrgent],
--- ppOrder = \(ws:l:t:xs) -> xs ++ [l,ws,t], -- remove or re-arrange l.ayout ws.orkspaces or t.itle as desired
--- ppOutput = hPutStrLn handle
--- }
-
-
---{{{ Theme
-
---Font
---myFont = "Terminus-6"
-
--- Colors
-
---- Main Colours
-myFgColor, myBgColor, myHighlightedFgColor, myHighlightedBgColor :: String
-myFgColor = "#DCDCCC"
-myBgColor = "#3f3f3f"
-myHighlightedFgColor = myFgColor
-myHighlightedBgColor = "#7F9F7F"
-
---- Borders
-myNormalBorderColor, myFocusedBorderColor :: String
-myNormalBorderColor = "#454545"
-myFocusedBorderColor = "#f9b857"
-
---- Ws Stuff
-myCurrentWsFgColor, myCurrentWsBgColor, myVisibleWsFgColor, myVisibleWsBgColor,
- myHiddenWsFgColor, myTitleFgColor :: String
-myCurrentWsFgColor = myHighlightedFgColor
-myCurrentWsBgColor = myHighlightedBgColor
-myVisibleWsFgColor = myBgColor
-myVisibleWsBgColor = "#CCDC90"
-myHiddenWsFgColor = myHighlightedFgColor
-myTitleFgColor = myFgColor
-
---- Urgency
-myUrgentFgColor, myUrgentBgColor :: String
-myUrgentFgColor = "#ffffff"
-myUrgentBgColor = "#f57900"
-
--- }}}
-
-
----{{{ Dzen Config
-myPP :: Handle -> PP
-myPP h = defaultPP {
- ppOutput = hPutStrLn h,
- ppSep = wrapFg myHighlightedBgColor "|",
- ppWsSep = "",
- ppCurrent = wrapFgBg myCurrentWsFgColor myCurrentWsBgColor,
- ppVisible = wrapFgBg myVisibleWsFgColor myVisibleWsBgColor,
- ppHidden = wrapFg myHiddenWsFgColor,
- --ppUrgent = wrapFgBg myUrgentFgColor myUrgentBgColor,
- ppUrgent = wrap ("^fg(" ++ myUrgentFgColor ++ ")^bg(" ++ myUrgentBgColor ++ ")!!!!") "!!!!^fg()^bg()",
- ppTitle = \x -> " " ++ wrapFg myTitleFgColor x,
- ppLayout = dzenColor myFgColor"",
--- ppExtras = [formatUrgent],
- ppOrder = \(ws:l:t:xs) -> xs ++ [l,ws,t] -- remove or re-arrange l.ayout ws.orkspaces or t.itle as desired
- }
- where
- wrapFgBg fgColor' bgColor' = wrap ("^fg(" ++ fgColor' ++ ")^bg(" ++ bgColor' ++ ")") "^fg()^bg()"
- wrapFg fgColor' = wrap ("^fg(" ++ fgColor' ++ ")") "^fg()"
---}}}
-
-
--- for ppExtras use
--- formatUrgent :: X (Maybe String)
--- formatUrgent = do
--- urge <- readUrgents
--- if null urge
--- then return Nothing
--- else return . Just $ "^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myUrgentBGColor ++ ")^p(4)"
--- layout' ::
-layout' = avoidStruts (smartBorders (tiled ||| Mirror tiled ||| Grid ||| Full ||| simpleTabbed ))
- where
- tiled = Tall nmaster delta ratio
- nmaster = 1 -- The default number of windows in the master pane
- ratio = 132%212 -- Default proportion of screen occupied by master pane
- delta = 5%100 -- Percent of screen to increment by when resizing panes
-
-modm :: KeyMask
-modm = mod1Mask
-
-keys' :: [((KeyMask, KeySym), X ())]
-keys' =
- -- zip (zip (repeat (modm)) workspaceskeys) (map (withNthWorkspace W.greedyView) [0..])
- -- ++
- -- zip (zip (repeat (modm .|. shiftMask)) workspaceskeys) (map (withNthWorkspace W.shift) [0..])
- [((m .|. modm, k), windows $ f i)
- | (i, k) <- zip workspaces' workspaceskeys
- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
- ++
- [ ((modm, 0x3b), sendMessage (IncMasterN (-1))) -- %! Deincrement the number of windows in the master area
- , ((modm, xK_b), sendMessage ToggleStruts) -- Toggle dzen gap
- , ((modm, xK_Tab), toggleWS) -- Toggle workspaces
- , ((modm, xK_z), withFocused $ windows . W.sink) -- unfloat
- , ((modm, xK_u), focusUrgent)
- , ((modm, xK_s), sshPrompt defaultXPConfig)
- --, ((modm .|. shiftMask, xK_p), shellPrompt defaultXPConfig)
- , ((modm, xK_p), shellPrompt defaultXPConfig)
- --, ((modm, xK_f), safePrompt "firefox" defaultXPConfig)
- , ((modm, xK_g), windowPromptGoto defaultXPConfig)
- --, ((modm, xK_semicolon), spawn "mpc next")
- --, ((modm, xK_comma), spawn "mpc prev")
- -- bépo
- , ((modm, xK_t), windows W.focusDown)
- , ((modm, xK_s), windows W.focusUp)
- , ((modm .|. shiftMask, xK_t), windows W.swapDown)
- , ((modm .|. shiftMask, xK_s), windows W.swapUp)
- --, ((modm, xK_t), windows W.swapDown)
- --, ((modm, xK_s), windows W.swapUp)
- , ((modm, xK_c), sendMessage Shrink)
- , ((modm, xK_r), sendMessage Expand)
- , ((modm, xK_j), spawn "urxvt")
- --, ((modm .|. shiftMask, xK_j), kill)
- , ((modm, xK_k), spawn "emacsclient -c")
- --, ((modm, xK_l), spawn "urxvtc -e screen")
- --, ((modm, xK_l), spawn "urxvtc -e mutt")
- , ((modm, xK_l), spawn "dzen2-music.sh")
- , ((modm, xK_h), spawn "dzen2-remind.sh")
- -- dynamic workspaces
- -- , ((modm .|. shiftMask, xK_BackSpace), removeWorkspace)
- -- , ((modm .|. shiftMask, xK_v ), selectWorkspace defaultXPConfig)
- -- , ((modm, xK_m ), withWorkspace defaultXPConfig (windows . W.shift))
- -- , ((modm .|. shiftMask, xK_m ), withWorkspace defaultXPConfig (windows . copy))
- -- , ((modm .|. shiftMask, xK_r ), renameWorkspace defaultXPConfig)
- -- , ((0, xF86XK_ScreenSaver), spawn "slock")
- ]
- ++
- multimedia
-
-shortcut :: MonadIO x => keyMask -> String -> keySym -> ((keyMask, keySym), x ())
-shortcut keyMask command keySym = ((keyMask, keySym), spawn command)
-
-multimedia :: [((KeyMask, KeySym), X ())]
-multimedia =
- [ player "prev" xK_KP_Down
- , player "next" xK_KP_End
--- , amixer "toggle" XF86XK_AudioMute
- --, noMask "pacmd dump|awk --non-decimal-data '$1~/set-sink-mute/{system (\"pacmd \"$1\" \"$2\" \"($3==\"yes\"?\"no\":\"yes\"))}' >/dev/null" XF86XK_AudioMute
- , player "toggle" xK_Pause
- , player "stop" xF86XK_AudioStop
- --, doubleVolume '-' XF86XK_AudioLowerVolume
- --, doubleVolume '+' XF86XK_AudioRaiseVolume
- , doubleVolume '-' xF86XK_AudioLowerVolume
- , doubleVolume '+' xF86XK_AudioRaiseVolume
- , noMask "slock" xF86XK_ScreenSaver
- --, noMask "pacmd dump|awk --non-decimal-data '$1~/set-sink-volume/{system (\"pacmd \"$1\" \"$2\" \"$3-1000)}' >/dev/null" XF86XK_AudioLowerVolume
- --, noMask "pacmd dump|awk --non-decimal-data '$1~/set-sink-volume/{system (\"pacmd \"$1\" \"$2\" \"$3+1000)}' >/dev/null" XF86XK_AudioRaiseVolume
- --, noMask "screenshot.sh" XF86XK_ScreenSaver
- , noMask "bepo.sh" XF86XK_Calculator
- --, noMask "dzen2-remind.sh" XF86XK_Calculator
- --, noMask "bépo.sh" XF86XK_Calculator
- , noMask "vga.sh" XF86XK_Display
- --, noMask "vga.sh" 0x1008ff59
- , noMask "sudo pm-hibernate" XF86XK_Suspend
- --, noMask "dzen2-music.sh" xK_KP_Next
- , ((0, xF86XK_HomePage), windows $ W.greedyView webWS)
- ]
-
-player :: String -> keySym -> ((KeyMask, keySym), X ())
-player command =
- noMask $ "mpc " ++ command
-
-players :: String -> String -> keySym -> ((KeyMask, keySym), X ())
-players mpc rhythmbox =
- noMask $ "mpc " ++ mpc ++ "; rhythmbox-client --no-start --" ++ rhythmbox
-
-noMask :: String -> keySym -> ((KeyMask, keySym), X ())
-noMask = shortcut 0
-
-amixer :: String -> keySym -> ((KeyMask, keySym), X ())
-amixer option = noMask $ "amixer -q set Master " ++ option
-
-volume :: String -> Char -> keySym -> ((KeyMask, keySym), X ())
-volume scontrol signal = amixer $ scontrol ++ " 1" ++ [signal]
-
-doubleVolume :: Char -> keySym -> ((KeyMask, keySym), X ())
-doubleVolume signal = noMask $ "amixer -q set Master 1" ++ [signal] ++ " && amixer -q set PCM 2" ++ [signal]
-
-main :: IO ()
-main = do
- h <- spawnPipe ("dzen2" ++ " " ++ flags)
- xmonad $ myUrgencyHook $ defaultConfig
- {
- workspaces = workspaces'
- , borderWidth = 2
- , layoutHook = layout'
- --, manageHook = manageDocks <+> manageHook defaultConfig
- , manageHook = myManageHook <+> manageDocks
- , terminal = "urxvt"
- , normalBorderColor = myNormalBorderColor
- , logHook = dynamicLogWithPP $ myPP h
- , focusedBorderColor = myFocusedBorderColor
- , focusFollowsMouse = False
- }
- `additionalKeys` keys'
- where
- fg = "'grey70'"
- --bg = "'#2c2c32'"
- bg = "'#222'"
- --fn = "'-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*'"
- --fn = "'Profont:style=regular:pixelsize=12'"
- fn = "'ProggyTinyTTSZ:pixelsize=16:style=medium'"
- flags = "-e '' -w 600 -ta l -fg " ++ fg ++ " -bg " ++ bg ++ " -fn " ++ fn