You are not logged in.
i'm totally new with xmonad, and i'm all confused with this problem...
it says that the last statement in a 'do' block must be an expression or something...
i'm just following http://thinkingeek.com/2011/11/21/simpl … en2-conky/,
everything goes right except the "log hook" part...
i don't really know Haskell code,
thanks for the help and sorry for my bad English,
here's the code...
-- import stuffs {
import XMonad
import XMonad.Actions.CycleWS
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.EwmhDesktops
import XMonad.Layout.SimpleFloat
import XMonad.Layout.NoBorders (smartBorders, noBorders)
import XMonad.Layout.PerWorkspace (onWorkspace, onWorkspaces)
import XMonad.Layout.Reflect (reflectHoriz)
import XMonad.Layout.IM
import XMonad.Layout.SimpleFloat
import XMonad.Layout.Spacing
import XMonad.Layout.ResizableTile
import XMonad.Layout.LayoutHints
import XMonad.Layout.LayoutModifier
import XMonad.Layout.Grid
import XMonad.Operations
import XMonad.Prompt
import XMonad.Prompt.RunOrRaise (runOrRaisePrompt)
import XMonad.Prompt.AppendFile (appendFilePrompt)
import XMonad.Util.Run
import Control.Monad
import Data.Ratio ((%))
import System.IO
import System.Exit
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-- end of import stuffs }
-- default terminal {
myTerm = "urxvt"
-- end of default terminal }
-- workspaces {
myWork = ["home", "surf", "devs", "ofce", "play", "misc"]
-- end of workspaces }
-- mod key {
myModm = mod4Mask
-- end of modkey }
-- window border {
myBord = 1
myNorm = "#272727"
myFocu = "#5387BF"
-- end of window border }
-- keybinding {
-- key to add
addKeys x = [
-- closing window
((modMask x, xK_c), kill)
]
-- key to remove
removeKeys x = [
-- gmrun
(modMask x .|. shiftMask, xK_p),
-- closing window
(modMask x .|. shiftMask, xK_c)
]
-- strip the key to remove
strippedKeys x = foldr M.delete (keys defaultConfig x) (removeKeys x)
-- merging keys
myKeys x = M.union (strippedKeys x) (M.fromList (addKeys x))
-- end of keybinding }
-- layout hooks {
defaultLayouts = tiled ||| Mirror tiled ||| simpleFloat ||| Full
where
-- tiling algorithm
tiled = Tall nmaster delta ratio
-- master window count
nmaster = 1
-- master pane portion
ratio = 2/3
-- increment/decrement resize
delta = 3/100
-- specific workspaces
miscLayout = noBorders $ Full
-- merging layout
myLayo = onWorkspace "misc" miscLayout $ defaultLayouts
-- end of layout hooks }
-- log hooks
myLogh :: Handle -> X ()
myLogh h = dynamicLogWithPP $ defaultPP {
ppCurrent = dzenColor "#ebac54" "#1B1D1E" . pad,
ppVisible = dzenColor "white" "#1B1D1E" . pad,
ppHidden = dzenColor "white" "#1B1D1E" . pad,
ppHiddenNoWindows = dzenColor "#7b7b7b" "#1B1D1E" . pad,
ppUrgent = dzenColor "#ff0000" "#1B1D1E" . pad,
ppWsSep = " ",
ppSep = " | ",
ppLayout = dzenColor "#ebac54" "#1B1D1E" . (
\x -> case x of
"ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
"Mirror ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
"Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
"Simple Float" -> "~"
_ -> x
),
ppTitle = (" " ++) . dzenColor "white" "#1B1D1E" . dzenEscape,
ppOutput = hPutStrLn h
}
-- end of log hooks
-- manage hooks {
myMana = composeAll . concat $ [
-- apps to surf
[ className =? t --> shiftWin "surf" | t <- mySurfClass ],
-- apps to devs
[ className =? t --> shiftWin "devs" | t <- myDevsClass ],
-- apps to float
[ className =? f --> doFloat | f <- myFloatClass ]
]
where
shiftWin = doF . liftM2 (.) W.greedyView W.shift
mySurfClass = ["Luakit", "luakit", "Chromium"]
myDevsClass = ["Geany", "Gedit", "Netbeans"]
myFloatClass = ["Gimp"]
-- end of manage hooks }
-- dzen bar
myDzen = "dzen2 -x '1440' -y '0' -h '24' -w '640' -ta 'l' -fg '#FFFFFF' -bg '#1B1D1E'"
myBitmapsDir = "/home/perud/.xmonad/dzen2"
-- end of dzen bar
-- status bar
myStat = "conky -c /home/perud/.xmonad/.conky_dzen | dzen2 -x '2080' -w '1040' -h '24' -ta 'r' -bg '#1B1D1E' -fg '#FFFFFF' -y '0'"
-- end of status bar
-- MAIN METHOD
main = do
dzenLeftBar <- spawnPipe myDzen
dzenRightBar <- spawnPipe myStat
xmonad $ defaultConfig {
terminal = myTerm,
workspaces = myWork,
modMask = myModm,
borderWidth = myBord,
normalBorderColor = myNorm,
focusedBorderColor = myFocu,
keys = myKeys,
layoutHook = myLayo,
logHook = myLogh dzenLeft >> fadeInactiveLogHook 0xdddddddd,
manageHook = myMana
}
-- END OF MAIN METHOD
Last edited by perud (2013-02-14 02:28:03)
nah...
Offline
Please use code tags when pasting to the boards:
https://wiki.archlinux.org/index.php/Fo … s_and_Code
Offline
sorry,
editing right away...
nah...
Offline