You are not logged in.

#1 2009-07-31 00:07:15

varicella
Member
Registered: 2009-07-31
Posts: 3

Simple Xmonad configuration help needed.

I have no idea how haskell works at all. But I simply love xmonad!

Could someone help me out with my configuration? It is currently

import XMonad
import XMonad.Config.Xfce

main = xmonad xfceConfig

smile This works pretty well for me, for the most part. However, I need a few keybinding. First, I want ctrl-alt-arrow to change desktops and I found I can do this with "XMonad.Actions.CycleWS", which I have installed and the configuration of:

 , ("M-<Left>",    prevWS )
 , ("M-<Right>",   nextWS )
 , ("M-S-<Left>",  shiftToPrev )
 , ("M-S-<Right>", shiftToNext )

However, I have no idea how to do this. Also, I would like XF86AudioRaiseVolume to execute "amixer set Master 5dB+" and XF86AudioLowerVolume to "amixer set Master 5dB-" and XF86AudioMute to "amixer set Master toggle". I know I could easily do this with xbindkeys or some other extra keybinding daemon, but I want to learn how to do this the correct way in haskell. smile Thanks!

Offline

#2 2009-07-31 00:23:05

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: Simple Xmonad configuration help needed.

Is this your whole xmonad.hs ? Anyway for the keybindings part ( for multimediakeys i use xbindkeys because i use the same xmonad.hs on my laptop plus desktop ) , but you can do it without xbindkeys wich is much nicer, less apps needed. If your keys are already reconignized as XF86AudioMute then you wouldnt have to use xmodmap. You can define keys in two various ways in XMonad with the additional keysP (Util.EZconfig ) or with keys = Mykeys

I always learn from looking into others people's configs , so here is an config from another arch user. Look for the section myKeys, and define something like :

    , ("<XF86AudioLowerVolume>", spawn amixer set Master 5dB+)

if you are interested here is my config

Further reference

Last edited by jelly (2009-07-31 00:31:09)

Offline

#3 2009-07-31 00:36:41

varicella
Member
Registered: 2009-07-31
Posts: 3

Re: Simple Xmonad configuration help needed.

Uhhhh I totally have no idea what I am doing.. I read your config and kinda tried to figure it out and I ended up with this:

import XMonad
import XMonad.Config.Xfce
import XMonad.Actions.CycleWS

main = do
        xmonad $ xfceConfig
               { keys = keys'
               }


keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    [ ("M-<Left>",    prevWS )
    , ("M-<Right>",   nextWS )
    , ("M-S-<Left>",  shiftToPrev )
    , ("M-S-<Right>", shiftToNext )
    ]

Which doesn't work, error is:

Error detected while loading xmonad configuration file: /home/mlweber/.xmonad/xmonad.hs

on the commandline:
    Warning: -no-recomp is deprecated: Use -fforce-recomp instead

xmonad.hs:11:50: Not in scope: `M.fromList'

Please check the file for errors.

edit: I forgot to mention that XF86Audio* keys are already mapped.

Last edited by varicella (2009-07-31 00:39:24)

Offline

#4 2009-07-31 10:02:21

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: Simple Xmonad configuration help needed.

You probaly need to import some stuff for key's to work. As you can see M is something wich isn't defined so you will need to define/import it:

import qualified Data.Map as M

I recommend you too take a look at MrElendings Config

Offline

Board footer

Powered by FluxBB