You are not logged in.

#51 2008-01-03 05:14:39

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: xmonad Hacking Thread

Roberth wrote:

Could you please explain what these lines do? they aren't logical for me.

The bit you quoted is used to show which desktop layout is currently being used; for example: Tall, Mirror or Full screen layout.  You can safely remove them, however you won't have any visual indication of what your current layout is.  If you would prefer to just have text that says "Tall", "Mirror", and "Full" respectively, you can use this instead:

(\x -> case x of
                                         "Tall" -> "Tall"
                                         "Mirror Tall" -> "Mirror"
                                         "Full" -> "Full"
                                )

Hope this helps...


thayer williams ~ cinderwick.ca

Offline

#52 2008-01-03 07:27:33

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: xmonad Hacking Thread

thayer wrote:
Roberth wrote:

Could you please explain what these lines do? they aren't logical for me.

The bit you quoted is used to show which desktop layout is currently being used; for example: Tall, Mirror or Full screen layout.  You can safely remove them, however you won't have any visual indication of what your current layout is.  If you would prefer to just have text that says "Tall", "Mirror", and "Full" respectively, you can use this instead:

(\x -> case x of
                                         "Tall" -> "Tall"
                                         "Mirror Tall" -> "Mirror"
                                         "Full" -> "Full"
                                )

Hope this helps...

Well I was asking for explanation of the whole piece of code.


Use the Source, Luke!

Offline

#53 2008-01-03 16:25:14

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: xmonad Hacking Thread

Roberth wrote:

Well I was asking for explanation of the whole piece of code.

The short explanation is that it's used to determine how your workspaces appear within the Dzen statusbar. For example, ppCurrent defines how the active workspace pager will be formatted (e.g. a white a label on a blue background with a square icon in the upper left corner).

ppVisible -- the active workspace
ppHidden -- the inactive workspaces that have applications open on them
ppHiddenNoWindows -- the inactive workspaces without any applications on them
ppSep -- visually separates the elements in the statusbar (these appear between the workspace pager, layout, and window title)
ppWsSep -- visually separates each workspace in the pager
ppLayout -- formats the name of the current layout
ppTitle -- formats the title of the active window

If you're still not sure what each line does, just play around with the settings, recompile and it will soon make sense.

The longer explanation is there are better places to get general programming knowledge than this thread.  I would suggest the Haskell wiki as a starting place.  These are also of great help:

Xmonad Core docs: http://hackage.haskell.org/packages/arc … index.html
Xmonad Contrib docs: http://hackage.haskell.org/packages/arc … index.html

In future, please try to keep your quotes short and to the point--it helps keep the thread more legible. 

Cheers

Last edited by thayer (2008-01-03 16:31:51)


thayer williams ~ cinderwick.ca

Offline

#54 2008-01-04 04:57:39

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

Re: xmonad Hacking Thread

thayer wrote:

you can use this instead:

(\x -> case x of
                                         "Tall" -> "Tall"
                                         "Mirror Tall" -> "Mirror"
                                         "Full" -> "Full"
                                )

Hope this helps...

Might I add that you allow any layouts that don't match the one you want to change (mirror tall) to match the case where nothing is changed:
(\x -> case x of
    "Mirror Tall" -> "Mirror"
    _  -> x
)

If you added different layouts later, things might asplode otherwise (but you already got warnings from ghc in using incomplete patterns?).

Offline

#55 2008-01-04 15:20:54

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: xmonad Hacking Thread

vogt wrote:

If you added different layouts later, things might asplode otherwise (but you already got warnings from ghc in using incomplete patterns?).

Thanks for that little tidbit... Thankfully it's never exploded on me (yet!), but it does hang onto the title of the last layout used when I've added more layouts (e.g. grid appears 3 times if I add two more layouts.)


thayer williams ~ cinderwick.ca

Offline

#56 2008-01-11 07:55:12

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: xmonad Hacking Thread

dimaka wrote:

It didn't help neutral I also try to use -fstype below (I thought it will make fullscreen mplayer like inactive window) but it didn't help either...
btw - other soft like swiftfox, amule works in fullscreen without borders too. So the problem for the moment is only with mplayer.

I started using xmonad today and now I am running into this problem as well.
I set mplayer to be float by default, and I'm using smartBorders.
If I make mplayer tiled and on a seperate workspace it works (tiled fullscreen), but not when it's floating.

dimaka wrote:

The simple solution is to press mod+tab, to make mplayer window inactive. I am using button's config now (where borders of inactive windows are black or disabled...)

That's not very convenient, if I want to send keypresses to mplayer it would go to another window.

EDIT
I'm starting to like everything tiled and Mod+Space to Full. You can switch around to other windows (I'm very used to that) - stay_on_top windows annoy me.

EDIT2
So I'd like to use xmonad with everything tiled, but some applications demand to be floating.
I think it's those which cannot be resized, like wine, dosbox, openmsx.
Is there anything I can do that forces those kinds of applications to start tiled?

Last edited by Gilneas (2008-01-11 11:19:28)

Offline

#57 2008-01-11 18:04:54

buttons
Member
From: NJ, USA
Registered: 2007-08-04
Posts: 620

Re: xmonad Hacking Thread

Gilneas wrote:

So I'd like to use xmonad with everything tiled, but some applications demand to be floating.
I think it's those which cannot be resized, like wine, dosbox, openmsx.
Is there anything I can do that forces those kinds of applications to start tiled?

Yep.  Took me a little while to figure it out, though.  My monadic knowledge is a bit lacking (read: wouldn't know a bind operator if it bit me in the face).

Here's an example of a ManageHook section with de-floating, done in the same style as the others to reduce confusion:

myManageHook = composeAll . concat $
                [ [ className    =? c                    --> doFloat        | c <- floatsClass]
                , [ title        =? t                    --> doFloat        | t <- floatsTitle]
                , [ resource    =? r                    --> doIgnore    | r <- ignore]
                , [ className    =? "Swiftfox-bin"        --> doF (W.shift "net") ]
                , [ className    =? "Thunderbird-bin"    --> doF (W.shift "mail") ]
                , [ resource    =? "pidgin"                --> doF (W.shift "jabber") ]
                , [ className    =? c                    --> doSink        | c <- sunken ]
                ]
            where
                floatsClass    = ["MPlayer", "Gimp-2.4", "Gimp", "Switch2", "Nitrogen", "Wine"]
                floatsTitle    = ["Swiftfox Preferences", "Add-ons", "Buddy List", "Swiftfox - Restore Previous Session"]
                ignore        = ["panel", "trayer", "gnome-panel", "desktop_window", "kicker", "kdesktop"]
                sunken        = ["Display.py"]

                doSink :: ManageHook
                doSink = ask >>= \w -> liftX (reveal w) >> doF (W.sink w)

The bolded bits are the ones you need.  They should be self-explanatory, and can be modified like the others to answer to resource or title.

Display.py is one of my own projects, which has the set_resizable flag set to False.

Last edited by buttons (2008-01-11 18:06:12)


Cthulhu For President!

Offline

#58 2008-01-12 05:35:33

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: xmonad Hacking Thread

Thanks, that works great.

Offline

#59 2008-01-15 10:06:45

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: xmonad Hacking Thread

I'm a total newbie to xmonad and I'd like to try it... I took some configs from here and trying to play with them. When I do "runhaskell Setup.lhs build -v" I get this:

[radu@eff xmonad-0.5]$ runhaskell Setup.lhs build -v
Creating dist/build (and its parents)
Creating dist/build/autogen (and its parents)
Preprocessing library xmonad-0.5...
Preprocessing executables for xmonad-0.5...
Building xmonad-0.5...
Building library...
Creating dist/build (and its parents)
Creating dist/build (and its parents)
/usr/bin/ghc -package-name xmonad-0.5 --make -hide-all-packages -i -idist/build/autogen -idist/build -i. -Idist/build -odir dist/build -hidir dist/build -stubdir dist/build -package base-3.0.0.0 -package containers-0.1.0.0 -package directory-1.0.0.0 -package process-1.0.0.0 -package X11-1.4.0 -package mtl-1.1.0.0 -package unix-2.2.0.0 -O -funbox-strict-fields -Wall -Werror -optl-Wl,-s -XCPP XMonad XMonad.Main XMonad.Core XMonad.Config XMonad.Layout XMonad.ManageHook XMonad.Operations XMonad.StackSet

XMonad.hs:24:7:
    Could not find module `XMonad.Layout.ResizableTile':
      Use -v to see a list of the files searched for.

what should I do in this case?

Offline

#60 2008-01-15 10:42:43

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: xmonad Hacking Thread

Doesn't it compile your xmonad.hs automatically? I never had to use runhaskell.

In any case, xmonad-contrib in the Community repository has the ResizableTile Layout, so you should install that.

Last edited by Gilneas (2008-01-15 18:31:01)

Offline

#61 2008-01-15 11:10:26

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: xmonad Hacking Thread

thanks for the answer. I gave up... I don't manage to understand how to install xmonad sad

Offline

#62 2008-01-15 11:24:51

barry
Member
Registered: 2007-11-27
Posts: 39

Re: xmonad Hacking Thread

As far as I'm aware you only needed to run 'runhaskell Setup.lhs build -v" for versions prior to 0.5. As of version 0.5 you can recompile Xmonad on the fly using modkey-Q.

Offline

#63 2008-01-15 13:15:29

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: xmonad Hacking Thread

ok ... I installed xmonad-darcs and xmonad-contrib-darcs from AUR... but where should I put my config now?

Offline

#64 2008-01-15 13:16:17

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: xmonad Hacking Thread

~/.xmonad/xmonad.hs

Offline

#65 2008-01-15 13:34:53

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: xmonad Hacking Thread

thanks... I'll take a look

Offline

#66 2008-01-15 13:40:15

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: xmonad Hacking Thread

You can find a nice default template here: link
It should be a lot easier to configure than the more complex scripts in this thread.

Offline

#67 2008-01-15 13:49:52

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: xmonad Hacking Thread

I can't get contrib to build neutral

Building xmonad-contrib-0.5...
ghc-6.8.1: unknown package: X11-1.4.0 (dependency of xmonad-0.5)
==> ERROR: Build Failed.
    Aborting...

Offline

#68 2008-01-15 15:14:13

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: xmonad Hacking Thread

Why not using [community] with xmonad-contrib 0.5 in it available to pacman?

Anyways I remember replacing X11-1.4.0 with just X11 in the .cabal file helped me back then. Just make sure, you have to right haskell-x11 package installed.


Hail to the thief!

Offline

#69 2008-01-15 15:31:18

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: xmonad Hacking Thread

Yeah, just a pacman -S xmonad xmonad-contrib should be enough.

Offline

#70 2008-01-15 17:26:01

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: xmonad Hacking Thread

ok. I didn't know xmonad was in the repository. I installed it and it starts, but I can't change the config. Whenever I use "ALT+Q" I get this on my console:

/home/radu/.xmonad/xmonad: executeFile: does not exist (No such file or directory)

I did a search on the forum and there was someone else who had this issue and solved it by installing the AUR darcs version.
It's really starting to get annoying for me neutral

Offline

#71 2008-01-15 17:39:12

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: xmonad Hacking Thread

I had this problem too, I didn't know what to name the file or thought it had to be executable or something.
But just place the template in ~/.xmonad/xmonad.hs and let it recompile once.
It should make a few files like xmonad, xmonad.hi, xmonad.errors, xmonad.o.
If that works well, go ahead and edit ~/.xmonad/xmonad.hs to your liking.

That's how I did it at least.

Offline

#72 2008-01-15 19:18:28

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: xmonad Hacking Thread

how should I let it recompile once? i have the simple template from the xmonad wiki in .xmonad/xmonad.hs and it seems not to work.

Offline

#73 2008-01-15 19:38:05

Don-DiZzLe
Member
From: Nederland
Registered: 2007-03-31
Posts: 233

Re: xmonad Hacking Thread

To check if u'r xmonad.hs is correct do this > ghci ~/.xmonad/xmonad.hs. if the config file has no syntax errors, u should see something like this:

ghci ~/.xmonad/xmonad.hs
GHCi, version 6.8.1: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Ok, modules loaded: Main.
Prelude Main>

For recompiling press alt-q every time u change the config file.

Offline

#74 2008-01-15 20:02:23

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: xmonad Hacking Thread

RaisedFist wrote:

Whenever I use "ALT+Q" I get this on my console:

/home/radu/.xmonad/xmonad: executeFile: does not exist (No such file or directory)

sorry for double posting.

Offline

#75 2008-01-19 21:12:30

hamlet
Member
Registered: 2007-11-25
Posts: 12

Re: xmonad Hacking Thread

Hello,
I'm not sure it's the good place but...

So i've upgraded my arch, and ghc changed of version !
And now when i do Mod+q i got :

xmonad.hs:22:17:
    Could not find module `XMonad.StackSet':
      it is not a module in the current program, or in any known package.

And when i try to reinstall xmonad :
:-(
Do i have to wait for a new version of xmonad ?

thanks

EDIT : see : http://bbs.archlinux.org/viewtopic.php?id=42539
sorry for the duplication...

Last edited by hamlet (2008-01-20 06:15:19)

Offline

Board footer

Powered by FluxBB