tiny config file gives error, please can someone take a quick look at it?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

tiny config file gives error, please can someone take a quick look at it?

jenia.ivlev

Hello.

I want to use xmobar and to switch "alt" with "super" key for xmonad key
binding.

I have therefore setup this config file (someone gave it to me, I don't
know Haskell). But it gives me errors and I can't figure out why:

import XMonad
import XMonad.Hooks.DynamicLog

    main = xmonad =<< statusBar cmd pp kb conf
      where
        cmd = "xmobar"
        pp = xmobarPP
        kb = XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
        conf = myConfig
   
    myConfig = defaultConfig { borderWidth = 2
                    , terminal = "urxvt"
    , modMask = mod4mask
                             }
   
So how do I fix this program? How do I configure xmobar to start with
xmonad (and not hide behind opened windows) and swtich "alt" with
"super"?

Thanks in advance for your time and kind concern.
jenia


Reply | Threaded
Open this post in threaded view
|

tiny config file gives error, please can someone take a quick look at it?

Brandon Allbery
On Wed, Dec 24, 2014 at 11:40 AM, jenia.ivlev <jenia.ivlev at gmail.com> wrote:

> I have therefore setup this config file (someone gave it to me, I don't
> know Haskell). But it gives me errors and I can't figure out why:
>

It would be helpful to include the full error messages.


> import XMonad
> import XMonad.Hooks.DynamicLog
>
>     main = xmonad =<< statusBar cmd pp kb conf
>

Haskell is sensitive to indentation; the fact that this and myConfig are
indented relative to the imports can itself lead to errors.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20141224/37e29e3c/attachment.html>

Reply | Threaded
Open this post in threaded view
|

tiny config file gives error, please can someone take a quick look at it?

jenia.ivlev
That's my error message. (I don't understand why I get undisplayable
characters, like that "a" with the hat).

    Error detected while loading xmonad configuration file: /home/jenia-xmonad/.xmonad/xmonad.hs
    xmonad.hs:8:45: parse error on input ?=?
    Please check the file for errors.


Reply | Threaded
Open this post in threaded view
|

tiny config file gives error, please can someone take a quick look at it?

Brandon Allbery
On Wed, Dec 24, 2014 at 12:25 PM, jenia.ivlev <jenia.ivlev at gmail.com> wrote:

> That's my error message. (I don't understand why I get undisplayable
> characters, like that "a" with the hat).
>

That looks like Unicode vs. iso8859 confusion. It was trying to print
"smart quotes".


>     Error detected while loading xmonad configuration file:
> /home/jenia-xmonad/.xmonad/xmonad.hs
>     xmonad.hs:8:45: parse error on input ?=?
>     Please check the file for errors.
>

The line indicated appears to be

        kb = XConfig {XMonad.modMask = modMask} = (modMask, xK_b)

which is in fact incorrect. I suspect it was supposed to be

        kb XConfig {XMonad.modMask = modMask} = (modMask, xK_b)

which uses record syntax in a pattern to unpack modMask from an XConfig
parameter. You might find it less confusing with parentheses:

        kb (XConfig {XMonad.modMask = modMask}) = (modMask, xK_b)

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20141224/fcdd044f/attachment.html>

Reply | Threaded
Open this post in threaded view
|

tiny config file gives error, please can someone take a quick look at it?

jenia.ivlev
Brandon Allbery <allbery.b at gmail.com>
writes:

> On Wed, Dec 24, 2014 at 12:25 PM, jenia.ivlev
> <jenia.ivlev at gmail.com> wrote:
>
>     That's my error message. (I don't understand why I get
>     undisplayable
>     characters, like that "a" with the hat).
>    
>
> That looks like Unicode vs. iso8859 confusion. It was trying to print
> "smart quotes".
>
>     Error detected while loading xmonad configuration file:
>     /home/jenia-xmonad/.xmonad/xmonad.hs
>     xmonad.hs:8:45: parse error on input ?=?
>     Please check the file for errors.
>    
>
> The line indicated appears to be
>
> kb = XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
>
> which is in fact incorrect. I suspect it was supposed to be
>
> kb XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
>
> which uses record syntax in a pattern to unpack modMask from an
> XConfig parameter. You might find it less confusing with parentheses:
>
> kb (XConfig {XMonad.modMask = modMask}) = (modMask, xK_b)

Thanks a lot. It works exept for one line:

    `, modMask = mod4mask`


The error message is the following:


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

    xmonad.hs:13:38:
        Not in scope: ?mod4mask?
        Perhaps you meant one of these:
          ?mod4Mask? (imported from XMonad),
          ?modMask? (imported from XMonad), ?mod1Mask? (imported from XMonad)
   
    Please check the file for errors.

========================================================================
Lets me repaste the config file:    
   
   
import XMonad
import XMonad.Hooks.DynamicLog

main = xmonad =<< statusBar cmd pp kb conf
  where
    cmd = "xmobar"
    pp = xmobarPP
    kb (XConfig {XMonad.modMask = modMask}) = (modMask, xK_b)
    conf = myConfig

myConfig = defaultConfig { borderWidth = 2
                         , terminal = "urxvt"
                         , modMask = mod4mask <----------- here is the mistake
                         }
========================================================================

Can you tell me please how to fix this?

Thanks again for your kind help.


Reply | Threaded
Open this post in threaded view
|

tiny config file gives error, please can someone take a quick look at it?

Brandon Allbery
On Wed, Dec 24, 2014 at 1:20 PM, jenia.ivlev <jenia.ivlev at gmail.com> wrote:

>     xmonad.hs:13:38:
>         Not in scope: ?mod4mask?
>         Perhaps you meant one of these:
>           ?mod4Mask? (imported from XMonad),
>           ?modMask? (imported from XMonad), ?mod1Mask? (imported from
> XMonad)
>

The first suggestion is the correct one.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20141224/4810a762/attachment.html>

Reply | Threaded
Open this post in threaded view
|

tiny config file gives error, please can someone take a quick look at it?

jenia.ivlev
Nice. Thanks very much.
Happy holidays and upcoming New Year.