You are not logged in.
@knute: thanks that works great!
has anyone had any success with using XMonad.Hooks.Place to reposition windows automaticall when they are created? I don't really know haskell and I cant manage to hack it into my current managehook. I have sofar
import Xmonad.Hooks.Place
import ...
...
main = xmonad $ defaultConfig
{ terminal = "urxvt"
, modMask = mod4Mask --rebind Mod to Windows Key
, manageHook = myManageHook
, layoutHook = myLayoutHook
, focusedBorderColor = "#ee9a00"
, startupHook = startup
}
...
myManageHook = composeAll $
[ resource =? name --> doIgnore | name <- ignore ]
++[ title =? name --> doFloat | name <- floaters ]
++[ manageDocks <+> manageHook defaultConfig
,(isFullscreen --> doFullFloat) --full float fullscreen flash
]
where
floaters = ["xcalc", "glut"]
ignore = ["stalonetray"]
how could i use Xmonad.Hooks.Place to repostion xcalc to the centre right when it is created for instance?
Offline
@knute: thanks that works great!
You are most welcome.
how could i use Xmonad.Hooks.Place to repostion xcalc to the centre right when it is created for instance?
Personally, I wouldn't.
I would use doCenterFloat instead of doFloat.
doCenterFloat is part of the XMonad.Hooks.ManageHelpers, and it seems to do the job nicely for me.
HTH
Last edited by Knute (2009-12-13 14:33:44)
Knute
Offline
I'm not sure if you mean to open XCalc floating 'right away at the centre of the screen', or floating 'at the right edge in the centre' (ie, East). Well, here are 2 ways of doing the latter.
This will open any float on the middle right of the screen:
...
, manageHook = myManageHook <+> placeHook (fixed (1,0.5))
...
Or for a specific window only something like: (not sure if this is quite right, but it does work)
myManageHook = composeAll . concat $
[ [ className =? c --> doFloat | c <- cFloats ]
, [ title =? t --> doFloat | t <- tFloats ]
, [ className =? "XCalc" --> placeHook (fixed (1,0.5)) <+> doFloat ]
]
...
Last edited by pseup (2009-12-13 15:28:45)
Offline
thanks, i meant floating in the "middle right of the screen" but both of these methods are useful.
Offline
Hi.
I'm using following this http://pbrisbin.com:8080/pages/xmonad_status.html to have a nice dzen bar showing my workspaces.
Almost all is ok. But i get
" xmonad.hs:25:30: Not in scope: `d'
xmonad.hs:82:35: Not in scope: data constructor `Wide"
When restarting xmonad.
Those lines are
25 , logHook = myLogHook d
and
myLayout = avoidStruts $ Tall ||| Wide ||| Full
.
I can see the myLogHook d is not used anywhere, and i cant change it to h( another variable used in the example). And cant figure out the second problem, as i have the default layouts.
Thanks
Thanks and greetings.
Offline
Without your whole config for reference its tricky, but id say you are missing something along the lines of:
main = do
d <- spawnPipe myStatusBar
...
, logHook = myLogHook d
...
And for the 'Wide' if its not part of a layout from contrib then it was probably defined in a 'where' something like:
myLayout = avoidStruts $ Tall ||| Wide ||| Full
where
Wide = Mirror tiled -- or whatever layout you want to be called 'Wide'
* Fixed some indents
Last edited by pseup (2009-12-14 05:40:47)
Offline
Added those lines, but now it says
xmonad.hs:17:3:
The last statement in a 'do' construct must be an expressio
That line is
d <- spawnPipe myStatusBar
My full xmonad.hs is:
--My xmonad.hs file. Mostly taken from other's configs.
--First, we import things:
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import XMonad.Util.Run
import XMonad.Hooks.UrgencyHook
main=do
xmonad $ defaultConfig
d <- spawnPipe myStatusBar
{ terminal ="urxvtc"
, modMask =mod4Mask
, borderWidth=2
, normalBorderColor = "#303030"
, manageHook = manageDocks <+> myManageHook
<+> manageHook defaultConfig
, workspaces = myWorkspaces
, layoutHook = myLayout
, logHook = myLogHook d
}
--Workspaces
myWorkspaces = [ "www", "term", "3", "4", "5", "6", "7", "8", "9"]
----Custom keys starts here
`additionalKeys`
[ ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
, ((mod4Mask, xK_r ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
]
---Hooks for windows
myManageHook = composeAll --To manage certain windows in a certain way...
[ className =? "Swiftfox" --> doShift "www"
, className =? "Swiftfox" <&&> resource =? "Dialog" --> doFloat
, className =? "Gpicview" --> doFloat
] <+> manageDocks
-- Status Bars
myLogHook h = dynamicLogWithPP $ defaultPP
-- display current workspace as darkgrey on light grey (opposite of default colors)
{ ppCurrent = dzenColor "#303030" "#909090" . pad
-- display other workspaces which contain windows as a brighter grey
, ppHidden = dzenColor "#909090" "" . pad
-- display other workspaces with no windows as a normal grey
, ppHiddenNoWindows = dzenColor "#606060" "" . pad
-- display the current layout as a brighter grey
, ppLayout = dzenColor "#909090" "" . pad
-- if a window on a hidden workspace needs my attention, wrap it's workspace with bright red braces
, ppUrgent = wrap (dzenColor "#ff0000" "" "{") (dzenColor "#ff0000" "" "}") . pad
-- show the current window's title as a brighter grey and bracketed, also shorten if it goes over 40 characters
, ppTitle = wrap "^fg(#909090)[ " " ]^fg()" . shorten 40
-- no separator between workspaces
, ppWsSep = ""
-- put a few spaces between each object
, ppSep = " "
-- h is just a variable (has to be the same as above)
, ppOutput = hPutStrLn h
}
-- sets up dzen options for two bars displayed as one spanning my 1920 px wide monitor
myStatusBar = "dzen2 -p -ta l -fn Terminus-8 -x 0 -y 0 -w 700 -h 15 -fg '#606060' -bg '#303030' -e 'onexit=ungrabmouse'"
--Add avoidStruts to your layoutHook like so
myLayout = avoidStruts $ Tall ||| Wide ||| Full
where
Wide = Mirror tiled
Thanks and greetings.
Offline
main=do
xmonad $ defaultConfig
d <- spawnPipe myStatusBar
{ terminal ="urxvtc"
, modMask =mod4Mask
, borderWidth=2
, normalBorderColor = "#303030"
, manageHook = manageDocks <+> myManageHook
<+> manageHook defaultConfig
, workspaces = myWorkspaces
, layoutHook = myLayout
, logHook = myLogHook d
}
should probably be
main = do
d <- spawnPipe myStatusBar
xmonad $ defaultConfig
{ terminal ="urxvtc"
, modMask =mod4Mask
, borderWidth=2
, normalBorderColor = "#303030"
, manageHook = manageDocks <+> myManageHook
<+> manageHook defaultConfig
, workspaces = myWorkspaces
, layoutHook = myLayout
, logHook = myLogHook d
}
//github/
Offline
Personally I prefer the new statusBar command in DynamicLog
quick and dirty:
main = xmonad =<< statusBar "xmobar" myPP tsKey myConf
myPP = defaultPP { ... }
tsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
myConf = defaultConfig { ... }
Last edited by Mr.Elendig (2009-12-14 18:59:53)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Now the bar spawns, but i have no gap because i commented out those lines.
Did what pseup said but still having the trouble:
xmonad.hs:82:35: Not in scope: data constructor `Wide'
xmonad.hs:84:4: Not in scope: data constructor `Wide
--Add avoidStruts to your layoutHook like so
myLayout = avoidStruts $ Tall ||| Wide ||| Full
where
Wide = Mirror Tall
The bar says "Mirror Tall" as the name for the second layout, so i added it. Alsi tried to change Wide for Mirror Tall and "Mirror Tall", none works.
Now that im using a dual monitor setup i wold like to the bar appear on both screens(only does on laptop one), how can i do that?
A lot of thanks
Thanks and greetings.
Offline
Whoops sorry, Haskell does not like uppercase variables so 'Wide' should be 'wide'.
I tried your config, and it doesn't compile for a couple of other reasons here.
Additional keys was causing errors where it is, move it above 'myWorkspaces' to be part of 'main':
main=do
xmonad $ defaultConfig
{ ...
}
`additionalKeys`
[ ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
, ((mod4Mask, xK_r ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
]
And Tall doesn't work without specifying parameters, like:
myLayout = avoidStruts $ Tall 1 (2/100) (3/4) ||| wide ||| Full
where
wide = Mirror (Tall 1 (2/100) (3/3))
As for wanting another name to appear in the dzen, you can use XMonad.Layout.Named (simplest) or fiddle with it via ppLayout with something like:
customPP i = defaultPP
...
, ppLayout = dzenColor "#909090" "" . pad .
(\x -> case x of
"Mirror Tall" -> "whatever name you want"
_ -> x
)
I have no idea about dzen on multiple screens though.
Offline
Awesome! Lots of thanks!
Now to write the other dzen.
Damn, another thing .
Now the Tall layout does not divide in half with a new window, and the wide one acts like Full.
im trying to modify the thinhs between ( ) and make them like the ones on the example xmonad.hs, and get the same.
--Add avoidStruts to your layoutHook like so
myLayout = avoidStruts $ Tall 1 (1/2) (3/100) ||| wide ||| Full
where
wide = Mirror (Tall 1 (50/100) (2/4))
Also, is there a way to make the dzen bar not display window names? Im trying to comment
-- show the current window's title as a brighter grey and bracketed, also shorten if it goes over 40 characters
, ppTitle = wrap "^fg(#909090)[ " " ]^fg()" . shorten 40
but then the only change is that the windows' names aren between [ ].
Thanks
Last edited by YamiFrankc (2009-12-15 05:11:29)
Thanks and greetings.
Offline
I just recently started using Xmonad and am rather pleased with it, though I do have quick question. Is there a way to have Firefox itself tile (like it already does) while letting popups from it (options, addons, popups from sites, etc etc) float?
dnyy in IRC & Urban Terror
Offline
The Tall you have defined has a single master, uses increments of 1/2 of the screen when resizing, and only uses 3/100ths of the screen for the master. Switch the 2nd and 3rd ratios around. And the wide was an error in what i pasted last, change 3/3 to whatever ratio you want, eg:
myLayout = avoidStruts $ Tall 1 (3/100) (1/2) ||| wide ||| Full
where
wide = Mirror (Tall 1 (3/100) (1/2))
Edit: Knew I should have tried it first, 'shorten 0' still leaves the '...', you can do:
, ppTitle = \x -> ""
Last edited by pseup (2009-12-15 06:47:16)
Offline
I just recently started using Xmonad and am rather pleased with it, though I do have quick question. Is there a way to have Firefox itself tile (like it already does) while letting popups from it (options, addons, popups from sites, etc etc) float?
that's what the manageHooks for. you can match on resource, name, title, whatever is needed to make it float. (classname will obviously catch the man window too).
mine's kinda complicated, but you can see what's possible:
myManageHook = (composeAll . concat $
[ [resource =? r --> doIgnore | r <- myIgnores] -- ignore desktop
, [className =? c --> doShift "2-web" | c <- myWebs ] -- move webs to web
, [title =? t --> doShift "3-chat" | t <- myChatT ] -- move chats to chat
, [className =? c --> doShift "3-chat" | (c,_) <- myIM ] -- move chats to chat
, [className =? c <&&> role /=? r --> doFloat | (c,r) <- myIM ] -- float all ims but roster
, [className =? c --> doCenterFloat | c <- myFloats ] -- float my floats
, [name =? n --> doCenterFloat | n <- myNames ] -- float my names
, [isFullscreen --> doFullFloat ]
]) <+> manageTypes <+> manageDocks
where
role = stringProperty "WM_WINDOW_ROLE"
name = stringProperty "WM_NAME"
-- [("ClassName","Role")]
myIM = [("Gajim.py","roster")]
-- titles
myChatT = ["irssi"]
-- classnames
myFloats = ["MPlayer","Vlc","Zenity","VirtualBox","Xmessage","Save As...","XFontSel"]
myWebs = ["Navigator","Shiretoko","Firefox","Uzbl","uzbl","Google-chrome"]
-- resources
myIgnores = ["desktop","desktop_window"]
-- names
myNames = ["bashrun","Google Chrome Options"]
-- modified version of manageDocks
manageTypes :: ManageHook
manageTypes = checkType --> doCenterFloat
checkType :: Query Bool
checkType = ask >>= \w -> liftX $ do
m <- getAtom "_NET_WM_WINDOW_TYPE_MENU"
d <- getAtom "_NET_WM_WINDOW_TYPE_DIALOG"
u <- getAtom "_NET_WM_WINDOW_TYPE_UTILITY"
mbr <- getProp32s "_NET_WM_WINDOW_TYPE" w
case mbr of
Just [r] -> return $ elem (fromIntegral r) [m,d,u]
_ -> return False
you'll need ManageHelpers from contrib to use some of that.
//github/
Offline
How can i make an urgent hint to have it displayed on the workspaces bar?
Im trying with booth urxvt and pidgin and cant get one.
I try to use urgentonbell on urxvt, and tmux to bell on activity, but i dont get the wrapped workspace number.
Pidgin should do it just by itself, when theres a new msg, right?
Thanks and greetings.
Offline
I`m trying to get my own key bindings to work but keep getting the same error and can`t find what`s wrong:
~$ xmonad --recompile
Error detected while loading xmonad configuration file:
xmonad.hs:32:25:
Couldn't match expected type `XConfig l -> KeyMask'
against inferred type `KeyMask'
In the second argument of `(.|.)', namely `shiftMask
In the expression: modMask .|. shiftMask
In the expression: (modMask .|. shiftMask, xK_x)
Please check the file for errors.
This is my config file:
import XMonad
import XMonad.Layout.NoBorders
import XMonad.ManageHook
import XMonad.Layout
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import XMonad.Util.EZConfig
import Graphics.X11.Xlib
import Graphics.X11.Xlib.Extras
import Graphics.X11
main = do
xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/xmobarrc"
xmonad $ defaultConfig
{ borderWidth = 1
, manageHook = manageDocks <+> manageHook defaultConfig
, terminal = myterm
, normalBorderColor="#333333"
, focusedBorderColor="darkgreen"
, layoutHook = avoidStruts $ smartBorders $ layoutHook defaultConfig
, startupHook = startup
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "darkgrey" "" . shorten 50
}
}`additionalKeys` mykeys
mykeys = [ ((modMask .|. shiftMask, xK_x), spawn "myterm")
, ((modMask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
, ((modMask .|. shiftMask, xK_g), spawn "iceweasel")
, ((modMask .|. shiftMask, xK_t), sendMessage ToggleStruts)
]
myterm = "aterm -bg black +sb -fg green -fn -*-terminus-medium-*-normal-*-17-*-*-*-*-*-*-*"
startup :: X ()
startup = do
spawn "myterm"
spawn "gnome-settings-daemon"
Another thing is that the startupspawn "myterm" doesn`t work. When i startup xmonad, the screen remains empty.
Offline
orlonth, if you define mykeys as such:
mykeys = let modMask = mod4Mask in
[ ((modMask .|. .......
]
Or perhaps it would just be easier to use additionalKeysP instead (refer to the documentation: http://xmonad.org/xmonad-docs/xmonad-co … onfig.html )
Regarding your startupHook, it should do the right thing if you have an actual executable named myterm in your $PATH, and only once your config has been successfully loaded.
Offline
Started using xmonad today, complete beginner to tiling wm's and haskell. Most my config is taken from brisbin33's but I'm getting an error when I try to restart.
Error detected while loading xmonad configuration file: /home/benji/.xmonad/xmonad.hs
xmonad.hs:126:59:
Couldn't match expected type '([Char]. [Char], [Char], [Char])'
against inferred type '(a, b)'
In the pattern: (c, _)
In the stmt of a list comprehensionL (c, _) <- myIM
In the expression:
[className =? c --> doShift "3-chat" | (c, _) <- myIM]
Please check the file for errors
My xmonad.hs is http://pastebin.com/m49c31c30
Offline
Sorry posted question in here as thought it might get more views/answers.
I started a new xmonad.hs file since then anyway, started simple and kept adding more piece by piece. Nearly perfect now just a few pieces missing.
1. I've added a scratchPad but I want it to use urxvt (default terminal is xterm) and I'd like it to appear in a certain place (bottom right)
2. Urgency Hooks, I've read about them but still not sure how to get it working, what I'd like is for the name of the workspace to turn red on xmobar when a window on that workspace needs attention.
3. The gmail and mpd scripts for xmobar from here are gone, could someone reupload them somewhere else?
My xmonad.hs is http://pastebin.com/m12ffb504
Thanks
Last edited by descendent87 (2010-02-17 01:20:54)
Offline
#1
you can adjust scratchpad positioning in lines 128-131 of your paste. [h]eight, [w]idth, length from [t]op edge, and length from [l]eft edge as a percentage of screensize (1 == 100%).
you can change the terminal at line 157. i use 'scratchPad = scratchpadSpawnActionTerminal myTerminal' which pulls myTerminal from where it's defined elsewhere in the config (line 54).
#2
to get the urgency hooks working, you'll just need to add two words to main as described here.
to get it colored the way you want you'll have to add a ppUrgent to myLogHook. you can check the docs for DynamicLog or just read a few configs to get a hang of how to do that (similar to ppOutput you have already).
#3
i dunno...
good luck!
//github/
Offline
Thanks thought the scratchpad would be something simple like that I had missed. Got urgency hooks working, all I had to do was add the 2 words, didn't need to add a ppUrgent hook.
As for the mpd and gmail scripts I'll have a look around for them or just setup a simple conky if not.
Offline
Hello,
I'm new to XMonad and Dzen,
I'm tryng to have a working clock in my XMonad Dzen status bar
with the ppExtras from dynamicLog, the clock is correctly displayed
but never updates until I switch Workspaces or Screen or toggle the bar.
At the moment as a workaround I launch a second Dzen from my .xinitrc
and the clock updates fine in it but I would like to have only one fully workable
Dzen and not two Dzen.
I post some parts of my xmonad.hs which could be useful to help debugging my settings
import XMonad
import qualified Data.Map as M
import qualified XMonad.StackSet as W
import Data.Monoid
import XMonad.Hooks.DynamicLog
import System.IO
import XMonad.Util.Loggers
import XMonad.Util.Run
main = do
x <- spawnPipe statusBarCmd
xmonad $ defaultConfig {
...
logHook = myLogHook x,
...
}
statusBarCmd = "dzen2 -e 'onstart=lower' -w 1200 -ta c -fn 'Monospace-10'"
eolPP = defaultPP { ppCurrent = dzenColor "green" "black" . pad
, ppVisible = dzenColor "red" "black" . pad
, ppHidden = dzenColor "white" "black" . pad
, ppHiddenNoWindows = const ""
, ppUrgent = dzenColor "red" "black" . dzenStrip
, ppWsSep = ""
, ppSep = " "
, ppLayout = dzenColor "white" "black" .
(\ x -> case x of
"Tall" -> "[ ]="
"Mirror Tall" -> "TTT"
"TwoPane" -> "[ ]|"
"Full" -> "[ ]"
_ -> pad x
)
, ppTitle = ("^bg(#000000) " ++) . dzenEscape
, ppExtras = [ date "%T" ]
}
myLogHook x = dynamicLogWithPP $ eolPP { ppOutput = hPutStrLn x }
Any idea?
Last edited by eol (2010-02-24 19:19:12)
Offline
Take a look at one of the dzen muxers,
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline