You are not logged in.

#151 2009-06-11 02:21:39

Lexion
Member
Registered: 2008-03-23
Posts: 510

Re: xmonad Hacking Thread

You can't have it in defaultConfig, you have to put it outside anything, i.e. between the imports and main = do.


urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand

Offline

#152 2009-06-11 02:47:28

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: xmonad Hacking Thread

Lexion wrote:

I press 'e' (the key I binded to view the empty workspace) and nothing happens.  Here is my xmonad.hs:

Notice that you've bound M-e and M-S-e to switching between screens after the empty workspace stuff. M.fromList takes the last elements, so to fix this you should probably remove the xK_e from that list comprehension.

Offline

#153 2009-06-11 02:59:47

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: xmonad Hacking Thread

@unregistered, Or you can write the suggestions Nepherte gave you inline.

Also notice that due to operator precedence being lower than function application, you need () around your fractions.

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO

main = do
    xmproc <- spawnPipe "xmobar"
    xmonad $ defaultConfig
        { manageHook = manageDocks <+> manageHook defaultConfig
        , layoutHook = let tiled = Tall 1 (1/2) (3/100) in avoidStruts $ Full ||| Mirror tiled ||| tiled
        , logHook = dynamicLogWithPP $ xmobarPP
                        { ppOutput = hPutStrLn xmproc
                        , ppTitle = xmobarColor "green" "" . shorten 50
                        }
        , focusedBorderColor = "#00ff00"
        --, modMask = mod4Mask     -- Rebind Mod to the Windows key
        }

Offline

#154 2009-06-11 04:11:15

unregistered
Member
Registered: 2008-04-09
Posts: 134

Re: xmonad Hacking Thread

hey thanks, that worked, this thread's really helpful but is it better to put it inside or outside or it makes no difference?

Offline

#155 2009-06-11 04:33:28

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: xmonad Hacking Thread

The only difference is where the names are in scope. In the example I gave, the 'tiled' is only in scope where it is used. If you put it at top level, you could refer to 'tiled' anywhere in the module. In this case, it makes no difference, since there should be no reason to refer to it elsewhere.

Offline

#156 2009-06-11 04:43:12

unregistered
Member
Registered: 2008-04-09
Posts: 134

Re: xmonad Hacking Thread

ic, what about configuring the looks of the dmenu, how would I go about doing so?
from here it seems that I would have to configure the looks of dmenu in xmonad.hs
http://bbs.archlinux.org/viewtopic.php?id=43802

Offline

#157 2009-06-11 12:15:17

Lexion
Member
Registered: 2008-03-23
Posts: 510

Re: xmonad Hacking Thread

@vogt:  I'm new to haskell, so could you give me an example or something?  I don't really understand your answer.


urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand

Offline

#158 2009-06-11 14:52:47

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: xmonad Hacking Thread

unregistered wrote:
Nepherte wrote:

You can do something like this:

tiled = Tall 1 1/2 3/100
myLayout = avoidStruts $ Full ||| tiled ||| Mirror tiled ||| other tiling algorithm

in your main, you should then assign the layoutHook to myLayout:

layoutHook = myLayout

You can toggle between layouts with mod + spacebar if you didn't change the default key for it.

hey I got a tiled and myLayout not in scope error when trying to compile, any ideas?

here's the config

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO

main = do
    xmproc <- spawnPipe "xmobar"
    xmonad $ defaultConfig
        { manageHook = manageDocks <+> manageHook defaultConfig
        , tiled = Tall 1 1/2 3/100
        , myLayout = avoidStruts $ Full ||| Mirror tiled ||| tiled
        , layoutHook = myLayout
        , logHook = dynamicLogWithPP $ xmobarPP
                        { ppOutput = hPutStrLn xmproc
                        , ppTitle = xmobarColor "green" "" . shorten 50
                        }
        , focusedBorderColor = "#00ff00"
        --, modMask = mod4Mask     -- Rebind Mod to the Windows key
        }

It should be:

import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO

myLayout = avoidStruts $ Full ||| Mirror tiled ||| tiled
    where
        tiled = Tall 1 1/2 3/100

main = do
    xmproc <- spawnPipe "xmobar"
    xmonad $ defaultConfig
        { manageHook = manageDocks <+> manageHook defaultConfig
        , layoutHook = myLayout
        , logHook = dynamicLogWithPP $ xmobarPP
                        { ppOutput = hPutStrLn xmproc
                        , ppTitle = xmobarColor "green" "" . shorten 50
                        }
        , focusedBorderColor = "#00ff00"
        --, modMask = mod4Mask     -- Rebind Mod to the Windows key

Offline

#159 2009-06-12 10:53:42

unregistered
Member
Registered: 2008-04-09
Posts: 134

Re: xmonad Hacking Thread

@Nepherte
you forgot the parentheses around the fractions but otherwise it worked fine smile

how can I edit the key for launching dmenu to this:

MODKEY, XK_p, spawn, "exe=`dmenu_path | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"'" " -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'` && eval \"exec $exe\""

PS I just want to change the color of dmenu but preserve the alt-P default binding

Last edited by unregistered (2009-06-12 10:56:18)

Offline

#160 2009-06-13 04:40:51

sw2wolf
Member
From: China
Registered: 2009-06-08
Posts: 99
Website

Re: xmonad Hacking Thread

I have tested lxpanel+xmonad as below:

import XMonad

import XMonad.Actions.CycleWS
import XMonad.Actions.SwapWorkspaces
import XMonad.Actions.Submap
import XMonad.Actions.WindowGo

import XMonad.Hooks.ManageDocks
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageHelpers

import XMonad.Util.Run(spawnPipe)

import XMonad.Layout.TwoPane
import XMonad.Layout.MosaicAlt
import XMonad.Layout.Combo
import XMonad.Layout.WindowNavigation

import qualified XMonad.StackSet as W 

import Data.Bits ((.|.))
import qualified Data.Map as M

import System.Exit
import System.IO
 
main = do
    xmonad $ defaultConfig
            { borderWidth        = 1
            , focusedBorderColor     = "#ff6666"
            , normalBorderColor     = "#2222aa"
            , manageHook       = myManageHook <+> manageHook defaultConfig <+> manageDocks
            , workspaces       = map show [1 .. 10 :: Int]
            , terminal        = "roxterm"
            , modMask          = mod4Mask
            , focusFollowsMouse  = False
            , startupHook      = myStartupHook
            , logHook = myLogHook
            , layoutHook    = ewmhDesktopsLayout $ windowNavigation $ avoidStruts $ (Mirror tall ||| tall ||| Full) 
            , keys             = \c -> myKeys c `M.union` keys defaultConfig c
            }
    where 
        tall     = Tall 1 (3/100) (1/2)
        
        myStartupHook :: X ()
        myStartupHook = do
                            spawn "fcitx"
                            spawn "/usr/local/bin/roxterm"
                            spawn "lxpanel"
        myLogHook :: X ()
        myLogHook = ewmhDesktopsLogHook

        myManageHook :: ManageHook
        myManageHook = composeAll . concat $
                        [ [ className =? c --> doFloat | c <- myCFloats]
                         ,[ resource  =? r --> doFloat | r <- myRFloats]
                         ,[ title     =? t --> doFloat | t <- myTFloats]
                         --,[ isFullscreen   --> doFullFloat ]
                         ,[ className =? c --> doIgnore | c <- ignores]
                         ,[ className =? "Audacious" --> doShift "3" ]
                         ,[ className =? "Firefox" --> doF W.swapDown]
                         ,[(role =? "gimp-toolbox" <||> role =? "gimp-image-window") --> (ask >>= doF . W.sink)]]
                    where myCFloats = ["GQview", "Thunderbird-bin", "MPlayer", "Gimp","Vncviewer","Xmessage"]
                          myRFloats = ["Dialog", "Download", "Places"]
                          myTFloats  = ["Firefox Preferences", "Element Properties"]
                          ignores = ["trayer"]
                          role = stringProperty "WM_WINDOW_ROLE"

        myKeys (XConfig {modMask = modm}) = M.fromList $
            -- Apps and tools
            [ ((modm, xK_F2), spawn "gmrun")
            , ((modm, xK_p), spawn "exe=`dmenu_path | dmenu -b` && eval \"exec $exe\"")
            , ((mod4Mask, xK_F12), spawn "sudo shutdown -h now")
            , ((modm .|. controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
            , ((modm, xK_Print), spawn "scrot '/tmp/%Y-%m-%d_%H:%M:%S_$wx$h_scrot.png' -e 'mv $f ~'")

            -- Window Navigation
            -- select...
            , ((modm, xK_Right), sendMessage $ Go R)
            , ((modm, xK_Left ), sendMessage $ Go L)
            , ((modm, xK_Up   ), sendMessage $ Go U)
            , ((modm, xK_Down ), sendMessage $ Go D)

            -- swap...
            , ((modm .|. controlMask, xK_Right), sendMessage $ Swap R)
            , ((modm .|. controlMask, xK_Left ), sendMessage $ Swap L)
            , ((modm .|. controlMask, xK_Up   ), sendMessage $ Swap U)
            , ((modm .|. controlMask, xK_Down ), sendMessage $ Swap D)
            ]

The lxpanel can work with xmonad happily.  And there is another question:  In firefox, open the "Organize Bookmark window" -> Restore bookmark from a file, then the confire dialog will be hidden by the "Organize Bookmark window" ,  I have to use mouse to move the "Organize Bookmark window" to discover the "confirm dialog".

One more question associated with wine:
When running windows application using wine, the app. will lose keyborad focus until i click the app. using mouse.

Last edited by sw2wolf (2009-06-14 05:49:21)


e^(π⋅i) + 1 = 0

Offline

#161 2009-06-20 20:08:06

baldr
Member
Registered: 2008-04-21
Posts: 6

Re: xmonad Hacking Thread

@unregistered: Just change the options you give dmenu in the xmonad.hs file. Check man dmenu for the different options.

Here is my line:

, ((modMask,     xK_p ), spawn "exe=`dmenu_path | dmenu -fn -*-terminus-*-*-*-*-12-*-*-*-*-*-*-u -nb black -nf gray` && eval \"exec $exe\"")

(To find a font you can use xfontsel.)

Offline

#162 2009-06-21 01:48:47

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: xmonad Hacking Thread

Lexion wrote:

@vogt:  I'm new to haskell, so could you give me an example or something?  I don't really understand your answer.

The keybindings are stored in a map (the same interface as a hash table, or dictionary in other languages). When converting from the list that you specify the keybindings in, duplicated elements (xK_e in your case), the last binding is taken. In your case xK_e with your modkey, and possibly shift end up being bound to switching screens. The solution is to remove the second occurence of xK_e, from your config.

I think that using XMonad.Util.EZConfig would be better choice for you, since it overrides the existing keybindings. It also has some functions to run on xmonad's startup (or restart) that will tell you if you have bound the same key combination twice.

Offline

#163 2009-06-21 02:44:49

sw2wolf
Member
From: China
Registered: 2009-06-08
Posts: 99
Website

Re: xmonad Hacking Thread

>>In firefox, open the "Organize Bookmark window" -> Restore bookmark from a file, then the confire dialog will be hidden by the "Organize Bookmark window" ,  I have to use mouse to move the "Organize Bookmark window" to discover the "confirm dialog".

up to now, i have not found any answer.  Doesnot it mean it cannot be fixed ?


e^(π⋅i) + 1 = 0

Offline

#164 2009-06-22 08:47:46

unregistered
Member
Registered: 2008-04-09
Posts: 134

Re: xmonad Hacking Thread

for tabbed layout, what would be the key combination to jump to a specific tab?

Offline

#165 2009-06-27 06:42:29

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: xmonad Hacking Thread

I posted a new thread on the Desktop Environment section, but I figure it won't hurt to ask here either.  Does anyone know how to change the behaviour of floating windows, so that they aren't always above other windows?  I'm trying to migrate from Awesome and found that behaviour very useful (but, alas, the configuration syntax changes too fast for me to keep up, and there are one or two other issues), since I usually run Skype floating, but on my main screen, so I can chat while I work/read responses through the transparent terminals I use.  If I have to edit the Xmonad source, I'd be willing to do that too, I'd just need someone to point out what I need to change, and in what file (haven't even really begun learning Haskell yet, too busy). If anyone has an idea of whom I best direct this question to instead (or someone who is sure to know the answer), that would be great too.

Nice configs here as well.


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#166 2009-06-27 15:10:25

McManiaC
Member
Registered: 2009-03-06
Posts: 15

Re: xmonad Hacking Thread

Have you tried the IM-Layout?

http://xmonad.org/xmonad-docs/xmonad-co … ut-IM.html

Keeping the floated windows *below* the tiled doesn't make much sense imo, since you'd have to close all windows again to see any of the floated (yeh, ok, you're using transparency -- but still tongue ). Use multiple workspaces instead - that what they're good for! smile

Last edited by McManiaC (2009-06-27 15:14:37)

Offline

#167 2009-06-27 15:13:07

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: xmonad Hacking Thread

No, I don't want it to be just below, I want it to just not always be on top...like be able to have it below or above.  However, it is a step closer to know that the opposite is true, so a balance should be possible, right?

Thanks for the suggestion though.


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#168 2009-06-27 15:15:44

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: xmonad Hacking Thread

lswest wrote:

No, I don't want it to be just below, I want it to just not always be on top...like be able to have it below or above.  However, it is a step closer to know that the opposite is true, so a balance should be possible, right?

Thanks for the suggestion though.

You might be able to use a Combo layout for what you want .... I don't know though as I use the IM Layout.  smile


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#169 2009-06-27 16:15:02

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: xmonad Hacking Thread

lifeafter2am wrote:
lswest wrote:

No, I don't want it to be just below, I want it to just not always be on top...like be able to have it below or above.  However, it is a step closer to know that the opposite is true, so a balance should be possible, right?

Thanks for the suggestion though.

You might be able to use a Combo layout for what you want .... I don't know though as I use the IM Layout.  smile

How would you do that? I haven't had time to google it yet, but I thought I may as well reply, and ask, right? tongue  Thanks for the suggestion, I hope that would work.


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#170 2009-06-27 16:37:18

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: xmonad Hacking Thread

lswest wrote:
lifeafter2am wrote:
lswest wrote:

No, I don't want it to be just below, I want it to just not always be on top...like be able to have it below or above.  However, it is a step closer to know that the opposite is true, so a balance should be possible, right?

Thanks for the suggestion though.

You might be able to use a Combo layout for what you want .... I don't know though as I use the IM Layout.  smile

How would you do that? I haven't had time to google it yet, but I thought I may as well reply, and ask, right? tongue  Thanks for the suggestion, I hope that would work.

Well, as far as I understand it, the XMonad.Layout.Combo hook allows you to combine different layouts.  I am just spit-balling here though, as I don't know if you could achieve what you want with different layouts combined.

http://www.xmonad.org/xmonad-docs/xmona … Combo.html


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#171 2009-06-27 16:42:48

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: xmonad Hacking Thread

lifeafter2am wrote:

Well, as far as I understand it, the XMonad.Layout.Combo hook allows you to combine different layouts.  I am just spit-balling here though, as I don't know if you could achieve what you want with different layouts combined.

http://www.xmonad.org/xmonad-docs/xmona … Combo.html

Thanks for the link, and spit-balling is still more than I have going atm tongue  I'll give it a shot and let you know how it goes.  Thanks for the suggestion.

Maybe I'm just extremely slow when on summer holidays, or else I am just incapable of understanding the website tongue  I'm not sure on how exactly I am meant to use the CombineTwo thing in the xmonad.hs file.  Is it like CombineTwo <first layout> <second layout>?

Last edited by lswest (2009-06-28 15:18:10)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#172 2009-06-29 08:53:49

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: xmonad Hacking Thread

Well, just as an update on the combo layout suggestion: XMonad doesn't recognize XMonad.Layout.Combo as a proper module, so I can't get any further, and I'm not really looking to create a new layout where things are floated all the time, just that if I choose to float a window to have it go both above and below a window.  I'll probably see if DWM or another tiling manager offers that, otherwise I'll probably end up with Awesome again.  Thanks for the suggestions though, I'm sure that, given enough time, we could figure something out tongue  I'm in the middle of a move right now, so I don't have that kind of time though tongue

Thanks again,
Lswest


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#173 2009-06-29 11:38:34

sw2wolf
Member
From: China
Registered: 2009-06-08
Posts: 99
Website

Re: xmonad Hacking Thread

sw2wolf wrote:

>>In firefox, open the "Organize Bookmark window" -> Restore bookmark from a file, then the confire dialog will be hidden by the "Organize Bookmark window" ,  I have to use mouse to move the "Organize Bookmark window" to discover the "confirm dialog".

up to now, i have not found any answer.  Doesnot it mean it cannot be fixed ?

UP, hope it can be fixed


e^(π⋅i) + 1 = 0

Offline

#174 2009-06-29 15:11:36

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: xmonad Hacking Thread

lswest wrote:

Well, just as an update on the combo layout suggestion: XMonad doesn't recognize XMonad.Layout.Combo as a proper module, so I can't get any further, and I'm not really looking to create a new layout where things are floated all the time, just that if I choose to float a window to have it go both above and below a window.  I'll probably see if DWM or another tiling manager offers that, otherwise I'll probably end up with Awesome again.  Thanks for the suggestions though, I'm sure that, given enough time, we could figure something out tongue  I'm in the middle of a move right now, so I don't have that kind of time though tongue

Thanks again,
Lswest

import XMonad.Layout.Combo

Works in my xmonad.hs file.  Do you have the xmonad-contrib package installed?


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#175 2009-07-06 21:10:11

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: xmonad Hacking Thread

Hello smile

I'd just like to share my XMonad and dzen config:

dzen.jpg
my standard view with just the most important things

dzenstats.jpg
my stats bar (toggled on/off by Mod-s)

You can see the config files here (XMonad) and here (dzen).

Last edited by caminoix (2009-07-06 21:24:32)

Offline

Board footer

Powered by FluxBB