You are not logged in.

#26 2011-07-27 06:21:47

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: SOLVED:Dmenu not launching correctly in Xmonad

I still can't get it to work but it seems like I can't get it to spawn anything. Do I need to import anything in particular for spawn? I've already got XMonad and XMonad.Core but it still doesn't want to work D:.

Offline

#27 2011-07-27 22:37:49

mjdwitt
Member
From: Indiana University, USA
Registered: 2011-02-14
Posts: 27
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

iamsmrt wrote:

I still can't get it to work but it seems like I can't get it to spawn anything. Do I need to import anything in particular for spawn? I've already got XMonad and XMonad.Core but it still doesn't want to work D:.

Can you post your ~/.xmonad/xmonad.hs?  I'm not going to be the best help myself since I don't know much about Haskell, but perhaps I'll spot something or, more likely, someone more knowledgeable will.

Offline

#28 2011-07-28 02:55:33

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: SOLVED:Dmenu not launching correctly in Xmonad

Here it is. I feel like I must not be importing the right library or something because even if I change it from "dmenu_run" to "urxvt" or something, it won't spawn anything.

--------------------------------
--------- Import Stuff ---------
--------------------------------

import XMonad
import XMonad.Core
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import System.IO
import Data.Ratio ((%))

-- Utilities
import XMonad.Util.Run (spawnPipe)

-- Hooks
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.UrgencyHook

-- Layout
import XMonad.Layout.IM
import XMonad.Layout.Reflect
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.PerWorkspace


--------------------------------
-------- Main Function ---------
--------------------------------

main = do
  pipe <- spawnPipe "xmobar"
  xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
       { borderWidth = 2
       , terminal = "urxvt"
       , modMask = mod4Mask
--       normalBorderColor = "#005500",
       , normalBorderColor = "#000000"
       , focusedBorderColor = "#00aa00"
       
       -- keybindings
       , keys = newKeys
                              
       -- hooks, layouts                       

       , manageHook=myManage
       , layoutHook = myLayout
       , logHook = myLog pipe
       , workspaces=myWorkspaces
       }
       
--------------------------------
-------- Custom Config ---------
--------------------------------

-- Hooks
myManage = composeAll
           [ isFullscreen --> doFullFloat
             , className =? "Chromium" --> doShift "Web"
             , className =? "Firefox" --> doShift "Web"
             , className =? "Pidgin" --> doShift "IM"
             , className =? "Xfce4-notifyd" --> doF W.focusDown
             , appName =? "ncmpcpp" --> doShift "Music" ]
           
           <+> manageDocks <+> manageHook defaultConfig

myLog h = dynamicLogWithPP $ xmobarPP
             { ppOutput = hPutStrLn h
               , ppCurrent = xmobarColor "#429942" "" . wrap "/" "/"
               , ppUrgent = xmobarColor "#CC0033" "" . wrap "[" "]"
               , ppTitle =  shorten 25
               , ppSep =  "<fc=#AFAF87> | </fc>"
             }
             
-- Layout
myLayout = avoidStruts $ onWorkspace "IM" myIM  $ smartBorders tiled ||| smartBorders (Mirror tiled) ||| noBorders Full
  where
    tiled = ResizableTall 1 (2/100) (1/2) []
    
myIM = reflectHoriz $ withIM (1%4) (Title "Buddy List") $ Tall 2 (3/100) (1/2)
    
-- Workspaces
myWorkspaces = ["Main", "Web", "IM", "Music", "5", "6", "7", "8", "9"]

--------------------------------
--------- Custom Keys ----------
--------------------------------

myKeys conf@(XConfig {XMonad.modMask = modMask}) = 
  [ ((modMask, xK_o), sendMessage ToggleStruts)
  , ((modMask, xK_p), spawn "dmenu_run") ]

newKeys x  = M.union (keys defaultConfig x) (M.fromList (myKeys x))

Offline

#29 2011-08-03 00:37:48

Jabrick
Member
Registered: 2011-05-13
Posts: 79

Re: SOLVED:Dmenu not launching correctly in Xmonad

I am having the same problem. Hope it gets fixed soon!

Offline

#30 2011-08-04 14:23:42

gadget3000
Member
Registered: 2010-05-11
Posts: 23

Re: SOLVED:Dmenu not launching correctly in Xmonad

Jabrick wrote:

I am having the same problem. Hope it gets fixed soon!

You can solve it by using EZConfig to replace your keybindings.

It basically consists of:

import XMonad.Util.EZConfig
main = do
{<THIS BIT ISNT IMPORTANT AS LONG AS `additionalKeys` IS AFTER MAIN>
}
`additionalKeys`
             [((mod4Mask,  xK_p ), spawn "dmenu_run")
             , <ANY OTHER KEY BINDINGS>
             ]

If you are struggling to do it then post your xmonad.hs.

Offline

#31 2011-08-04 14:35:53

securitybreach
Member
From: In front of my computers
Registered: 2007-11-18
Posts: 416
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

gadget3000 wrote:
Jabrick wrote:

I am having the same problem. Hope it gets fixed soon!

You can solve it by using EZConfig to replace your keybindings.

It basically consists of:

import XMonad.Util.EZConfig
main = do
{<THIS BIT ISNT IMPORTANT AS LONG AS `additionalKeys` IS AFTER MAIN>
}
`additionalKeys`
             [((mod4Mask,  xK_p ), spawn "dmenu_run")
             , <ANY OTHER KEY BINDINGS>
             ]

If you are struggling to do it then post your xmonad.hs.

Thanks Gadget3000 but I am still having issues with my configuration:

╔═ comhack@Cerberus 09:38 AM
╚═══ ~-> xmonad --recompile
Error detected while loading xmonad configuration file: /home/comhack/.xmonad/xmonad.hs

xmonad.hs:17:8:
    Could not find module `XMonad.Util.EZConfig':
      Use -v to see a list of the files searched for.

Please check the file for errors.

xmonad: xmessage: executeFile: does not exist (No such file or directory)

Here is my ~/.xmonad/xmonad.hs: http://pastebin.com/CpsbT8wE

Thanks

BTW Dmenu launches fine via the console.

Last edited by securitybreach (2011-08-04 15:19:07)


"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website      Configs
Forum Admin: Bruno's All Things Linux   
securitybreach<a>archlinux.us

Offline

#32 2011-08-04 16:05:25

mjdwitt
Member
From: Indiana University, USA
Registered: 2011-02-14
Posts: 27
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

Do you have xmonad-contrib installed?  EZConfig is a part of the contrib package.

Offline

#33 2011-08-04 18:11:38

securitybreach
Member
From: In front of my computers
Registered: 2007-11-18
Posts: 416
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

mjdwitt wrote:

Do you have xmonad-contrib installed?  EZConfig is a part of the contrib package.

Yup:

╔═ comhack@Cerberus 01:03 PM 
╚═══ ~-> pacman -Qi xmonad-contrib
Name           : xmonad-contrib
Version        : 0.9.2-2.1
URL            : http://xmonad.org/
Licenses       : BSD
Groups         : None
Provides       : None
Depends On     : ghc=7.0.3-2  xmonad=0.9.2-2.1  sh
                 haskell-x11=1.5.0.0  haskell-x11-xft=0.3
                 haskell-utf8-string=0.3.6
Optional Deps  : None
Required By    : None
Conflicts With : None
Replaces       : None
Installed Size : 21999.00 K
Packager       : Unknown Packager
Architecture   : x86_64
Build Date     : Wed 22 Jun 2011 02:51:34 PM CDT
Install Date   : Mon 25 Jul 2011 09:57:23 AM CDT
Install Reason : Explicitly installed
Install Script : Yes
Description    : Add-ons for xmonad

"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website      Configs
Forum Admin: Bruno's All Things Linux   
securitybreach<a>archlinux.us

Offline

#34 2011-08-04 20:04:15

mjdwitt
Member
From: Indiana University, USA
Registered: 2011-02-14
Posts: 27
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

What does your xmonad.hs look like now?  I'm assuming you've altered it since your first post in this thread.

Offline

#35 2011-08-04 20:12:23

securitybreach
Member
From: In front of my computers
Registered: 2007-11-18
Posts: 416
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

mjdwitt wrote:

What does your xmonad.hs look like now?  I'm assuming you've altered it since your first post in this thread.

Well I have tried the various tips suggested but here is the latest with Gadget3000's suggestion:

import XMonad hiding (Tall)
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.HintedTile
import XMonad.Layout.LayoutHints (layoutHints)
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Util.Run(spawnPipe)
 
import System.Exit
import System.IO
import Data.Monoid
 
import qualified XMonad.StackSet as W
import qualified Data.Map        as M
import XMonad.Util.EZConfig
 
myBorderWidth   = 1
main = do
    xmproc <- spawnPipe "/usr/bin/xmobar /home/comhack/.xmobarcc"
    xmonad $ defaultConfig {
        terminal           = "urxvt -tr",
        modMask            = mod1Mask,
        workspaces         = ["Net", "Screen]", "Mail", "4", "5", "6", "7", "8", "9"],
        normalBorderColor  = "#000000",
        focusedBorderColor = "#838B8B",
        manageHook         = composeAll [],
        borderWidth        = myBorderWidth,
        keys               = myKeys,
        focusFollowsMouse  = False,
        layoutHook         = myLayout,
        logHook            = dynamicLogWithPP $ xmobarPP 
                           {  ppOutput = hPutStrLn xmproc,
                              ppTitle = xmobarColor "green" "" . shorten 60,
                              ppHiddenNoWindows = xmobarColor "grey" ""
                                     }
    }

          
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
 
    [ ((modMask              , xK_Return   ), spawn $ XMonad.terminal conf)
    , ((modMask .|. shiftMask, xK_c        ), kill)
    , ((modMask              , xK_space    ), sendMessage NextLayout)
    , ((modMask .|. shiftMask, xK_space    ), setLayout $ XMonad.layoutHook conf)
    , ((modMask              , xK_n        ), refresh)
    `additionalKeys`
             [((mod4Mask,  xK_p ), spawn "dmenu_run")
             ]
    , ((modMask              , xK_Tab      ), windows W.focusDown)
    , ((modMask              , xK_j        ), windows W.focusDown)
    , ((modMask              , xK_k        ), windows W.focusUp)
    , ((modMask              , xK_m        ), windows W.focusMaster)
    , ((modMask .|. shiftMask, xK_Return   ), windows W.swapMaster)
    , ((modMask .|. shiftMask, xK_j        ), windows W.swapDown)
    , ((modMask .|. shiftMask, xK_k        ), windows W.swapUp)
    , ((modMask              , xK_h        ), sendMessage Shrink)
    , ((modMask              , xK_l        ), sendMessage Expand)
    , ((modMask              , xK_t        ), withFocused $ windows . W.sink)
    , ((modMask              , xK_comma    ), sendMessage (IncMasterN 1))
    , ((modMask              , xK_period   ), sendMessage (IncMasterN (-1)))
    , ((modMask .|. shiftMask, xK_q        ), io (exitWith ExitSuccess))
    , ((modMask              , xK_q        ), spawn "xmonad --recompile; xmonad --restart")
    , ((modMask              , xK_F2       ), shellPrompt defaultXPConfig)
    , ((0                    , 0x1008ff30  ), shellPrompt defaultXPConfig)
    , ((0                    , 0x1008ff13  ), spawn "amixer -q set Master 2dB+")
    , ((0                    , 0x1008ff11  ), spawn "amixer -q set Master 2dB-")
    , ((0                    , 0x1008ff12  ), spawn "amixer -q set Master toggle")
    , ((0                    , 0x1008ff16  ), spawn "cmus-remote --prev")
    , ((0                    , 0x1008ff17  ), spawn "cmus-remote --next")
    , ((0                    , 0x1008ff14  ), spawn "cmus-remote --pause")
    , ((0                    , 0x1008ff5b  ), spawn "urxvt -e screen -rd cmus")
    , ((modMask              , xK_Print    ), spawn "scrot -e 'mv $f ~/Screenshots'")
    ]
    ++
 
    [((m .|. modMask, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
 
    ++
 
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
 
myLayout = avoidStruts $ tiled ||| wideTiled ||| Full
  where
     tiled = HintedTile nmaster delta ratio Center Tall
     wideTiled = HintedTile nmaster delta ratio Center Wide
     nmaster = 1
     ratio   = 1/2
     delta   = 3/100

Last edited by securitybreach (2011-08-04 20:15:16)


"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website      Configs
Forum Admin: Bruno's All Things Linux   
securitybreach<a>archlinux.us

Offline

#36 2011-08-06 20:43:02

mjdwitt
Member
From: Indiana University, USA
Registered: 2011-02-14
Posts: 27
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

    , ((modMask .|. shiftMask, xK_space    ), setLayout $ XMonad.layoutHook conf)
    , ((modMask              , xK_n        ), refresh)
    `additionalKeys`
             [((mod4Mask,  xK_p ), spawn "dmenu_run")
             ]
    , ((modMask              , xK_Tab      ), windows W.focusDown)
    ,

I don't use EZConfig myself so I may be wrong, but I don't believe that how you used it there is how it is supposed to be done.  The other configs using additionalKeys that I have seen all define the additionalKeys list immediately following the xmonad block, like this:

main = do
    xmproc <- spawnPipe "/usr/bin/xmobar /home/comhack/.xmobarcc"
    xmonad $ defaultConfig {
        terminal           = "urxvt -tr",
        -- more statements
        modMask            = mod1Mask
    }'additionalKeys' 
     [ -- key bindings
     ]

Also, I believe the purpose of using EZConfig and additionalKeys is so that you do not have to define a more complex list like the one in which you have your additionalKeys statement embedded.  The one entry you have inside of additionalKeys does appear to be correct.  You could try moving your addtionalKeys statement so that it does something like the code above here, or you could just removing the additionalKeys syntax altogther to change the first block of code in this post to look like this:

    , ((modMask .|. shiftMask, xK_space    ), setLayout $ XMonad.layoutHook conf)
    , ((modMask              , xK_n        ), refresh)
    , ((modMask              , xK_p        ), spawn "dmenu_run")   -- no more additionalKeys statement enclosing this binding here
    , ((modMask              , xK_Tab      ), windows W.focusDown)
    ,

Offline

#37 2011-08-08 01:01:26

mgmuscari
Member
Registered: 2011-08-08
Posts: 1

Re: SOLVED:Dmenu not launching correctly in Xmonad

I've been having this problem too... I've tried a few different solutions, including rolling dmenu back a few versions. Nothing has worked for me.

I would like to note, however, that if I log in, then suspend my system, then wake it back up, the mod+p shortcut launches dmenu with no problems whatsoever.

Perhaps it's having trouble figuring out which display to appear on? Maybe a xinerama conflict or similar?

Offline

#38 2011-08-08 03:04:34

securitybreach
Member
From: In front of my computers
Registered: 2007-11-18
Posts: 416
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

mjdwitt wrote:

Also, I believe the purpose of using EZConfig and additionalKeys is so that you do not have to define a more complex list like the one in which you have your additionalKeys statement embedded.  The one entry you have inside of additionalKeys does appear to be correct.  You could try moving your addtionalKeys statement so that it does something like the code above here, or you could just removing the additionalKeys syntax altogther to change the first block of code in this post to look like this:

    , ((modMask .|. shiftMask, xK_space    ), setLayout $ XMonad.layoutHook conf)
    , ((modMask              , xK_n        ), refresh)
    , ((modMask              , xK_p        ), spawn "dmenu_run")   -- no more additionalKeys statement enclosing this binding here
    , ((modMask              , xK_Tab      ), windows W.focusDown)
    ,

Thanks a lot. I finally got it working by installing xmonad-darcs/xmonad-contrib-darcs and modifying my /.xmonad/xmonad.hs:

import XMonad hiding (Tall)
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.HintedTile
import XMonad.Layout.LayoutHints (layoutHints)
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Util.Run(spawnPipe)
 
import System.Exit
import System.IO
import Data.Monoid
 
import qualified XMonad.StackSet as W
import qualified Data.Map        as M
import XMonad.Util.EZConfig
 
myBorderWidth   = 1
main = do
    xmproc <- spawnPipe "/usr/bin/xmobar /home/comhack/.xmobarcc"
    xmonad $ defaultConfig {
        terminal           = "urxvt -tr",
        modMask            = mod1Mask,
        workspaces         = ["Net", "Screen]", "Mail", "4", "5", "6", "7", "8", "9"],
        normalBorderColor  = "#000000",
        focusedBorderColor = "#838B8B",
        manageHook         = composeAll [],
        borderWidth        = myBorderWidth,
        keys               = myKeys,
        focusFollowsMouse  = False,
        layoutHook         = myLayout,
        logHook            = dynamicLogWithPP $ xmobarPP 
                           {  ppOutput = hPutStrLn xmproc,
                              ppTitle = xmobarColor "green" "" . shorten 60,
                              ppHiddenNoWindows = xmobarColor "grey" ""
                                     }
    }

          
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
 
    [ ((modMask              , xK_Return   ), spawn $ XMonad.terminal conf)
    , ((modMask .|. shiftMask, xK_c        ), kill)
    , ((modMask              , xK_space    ), sendMessage NextLayout)
    , ((modMask .|. shiftMask, xK_space    ), setLayout $ XMonad.layoutHook conf)
    , ((modMask              , xK_n        ), refresh)
    , ((modMask              , xK_p        ), spawn "dmenu_run")   -- no more additionalKeys statement enclosing this binding here
    , ((modMask              , xK_Tab      ), windows W.focusDown)
    , ((modMask              , xK_j        ), windows W.focusDown)
    , ((modMask              , xK_k        ), windows W.focusUp)
    , ((modMask              , xK_m        ), windows W.focusMaster)
    , ((modMask .|. shiftMask, xK_Return   ), windows W.swapMaster)
    , ((modMask .|. shiftMask, xK_j        ), windows W.swapDown)
    , ((modMask .|. shiftMask, xK_k        ), windows W.swapUp)
    , ((modMask              , xK_h        ), sendMessage Shrink)
    , ((modMask              , xK_l        ), sendMessage Expand)
    , ((modMask              , xK_t        ), withFocused $ windows . W.sink)
    , ((modMask              , xK_comma    ), sendMessage (IncMasterN 1))
    , ((modMask              , xK_period   ), sendMessage (IncMasterN (-1)))
    , ((modMask .|. shiftMask, xK_q        ), io (exitWith ExitSuccess))
    , ((modMask              , xK_q        ), spawn "xmonad --recompile; xmonad --restart")
    , ((modMask              , xK_F2       ), shellPrompt defaultXPConfig)
    , ((0                    , 0x1008ff30  ), shellPrompt defaultXPConfig)
    , ((0                    , 0x1008ff13  ), spawn "amixer -q set Master 2dB+")
    , ((0                    , 0x1008ff11  ), spawn "amixer -q set Master 2dB-")
    , ((0                    , 0x1008ff12  ), spawn "amixer -q set Master toggle")
    , ((0                    , 0x1008ff16  ), spawn "cmus-remote --prev")
    , ((0                    , 0x1008ff17  ), spawn "cmus-remote --next")
    , ((0                    , 0x1008ff14  ), spawn "cmus-remote --pause")
    , ((0                    , 0x1008ff5b  ), spawn "urxvt -e screen -rd cmus")
    , ((modMask              , xK_Print    ), spawn "scrot -e 'mv $f ~/Screenshots'")
    ]
    ++
 
    [((m .|. modMask, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
 
    ++
 
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
 
myLayout = avoidStruts $ tiled ||| wideTiled ||| Full
  where
     tiled = HintedTile nmaster delta ratio Center Tall
     wideTiled = HintedTile nmaster delta ratio Center Wide
     nmaster = 1
     ratio   = 1/2
     delta   = 3/100

Thanks again!


BTW The xmonad-darcs and the xmonad-contrib-darcs packages are completely screwed up right now because of the latest update. I basically had to remove most of the haskell deps because they were already included in the recent ghc update.

Last edited by securitybreach (2011-08-08 03:06:53)


"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website      Configs
Forum Admin: Bruno's All Things Linux   
securitybreach<a>archlinux.us

Offline

#39 2011-08-21 15:14:14

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: SOLVED:Dmenu not launching correctly in Xmonad

I could not get i running. Launching dmenu_run from a terminal works,
the problems seems to be that xmonad is still expecting the old dmenu
version (when i downgrade, everything works just fine).

Given that this thread is already a few days old, i dare to ask, why isn't
xmonad updated to deal with the new version of dmenu?

Anyway, i don't know haskell and could not understand all the huge config
files posted here. The config file posted by gadget3000 didn't work either.

So for the time being, can somebody please post a minimal *working*
config file?

Offline

#40 2011-08-21 15:29:21

gammel.holte
Member
Registered: 2010-02-01
Posts: 53

Re: SOLVED:Dmenu not launching correctly in Xmonad

I think that this is as minimal as it can get if you ignore the modMask and terminal lines. I've been using xmonad since 2 months ago, so take it with a grain of salt. You need to install xmonad-contrib to get it working. FYI this is my current xmonad.hs file.

HTH,

import XMonad
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.Run(spawnPipe)

main = do
  xmonad $ defaultConfig
    { modMask = mod4Mask
    , terminal = "urxvt"
    } `additionalKeys` myKeyBindings

myKeyBindings = [((mod4Mask, xK_p), spawn "dmenu_run")]

Last edited by gammel.holte (2011-08-21 15:30:00)

Offline

#41 2011-08-21 16:18:25

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: SOLVED:Dmenu not launching correctly in Xmonad

Thank you for your reply, it doesn't work for me however.
Since i don't have a Windows key on my keyboard, i had to alter it a bit:
I removed the modMask = mod4Mask line and the 4 on the last line.
Now it looks like this:

import XMonad
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.Run(spawnPipe)

main = do
  xmonad $ defaultConfig
      { terminal = "urxvt"
      } `additionalKeys` myKeyBindings

myKeyBindings = [((modMask, xK_p), spawn "dmenu_run")]

and i get the following error, when i try to compile it:

xmonad.hs:8:26:
    Couldn't match expected type `Foreign.C.Types.CUInt'
                with actual type `XConfig l0 -> KeyMask'
    Expected type: [((ButtonMask, KeySym), X ())]
      Actual type: [((XConfig l0 -> KeyMask, KeySym), m0 ())]
    In the second argument of `additionalKeys', namely `myKeyBindings'
    In the second argument of `($)', namely
      `defaultConfig {terminal = "urxvt"} `additionalKeys` myKeyBindings'

Offline

#42 2011-08-21 17:06:41

securitybreach
Member
From: In front of my computers
Registered: 2007-11-18
Posts: 416
Website

Re: SOLVED:Dmenu not launching correctly in Xmonad

@MickeyKnox  I ended up installing the darcs versions of xmonad, xmonad-contrib and xmonad-utils from AUR. No matter what I did I continued to get errors until I installed the newer darcs versions. Here is my xmonad.hs if you want to reference it:

import XMonad hiding (Tall)
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.HintedTile
import XMonad.Layout.LayoutHints (layoutHints)
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Util.Run(spawnPipe)
 
import System.Exit
import System.IO
import Data.Monoid
 
import qualified XMonad.StackSet as W
import qualified Data.Map        as M
import XMonad.Util.EZConfig
 
myBorderWidth   = 1
main = do
    xmproc <- spawnPipe "/usr/bin/xmobar /home/comhack/.xmobarcc"
    xmonad $ defaultConfig {
        terminal           = "urxvt",
        modMask            = mod1Mask,
        workspaces         = ["Net", "Screen", "Work", "4", "5", "6", "7", "8", "9"],
        normalBorderColor  = "#000000",
        focusedBorderColor = "#838B8B",
        manageHook         = composeAll [],
        borderWidth        = myBorderWidth,
        keys               = myKeys,
        focusFollowsMouse  = True,
        layoutHook         = myLayout,
        logHook            = dynamicLogWithPP $ xmobarPP 
                           {  ppOutput = hPutStrLn xmproc,
                              ppTitle = xmobarColor "green" "" . shorten 60,
                              ppHiddenNoWindows = xmobarColor "grey" ""
                                     }
    }

          
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
 
    [ ((modMask              , xK_Return   ), spawn $ XMonad.terminal conf)
    , ((modMask .|. shiftMask, xK_c        ), kill)
    , ((modMask              , xK_space    ), sendMessage NextLayout)
    , ((modMask .|. shiftMask, xK_space    ), setLayout $ XMonad.layoutHook conf)
    , ((modMask              , xK_n        ), refresh)
    , ((modMask              , xK_p        ), spawn "dmenu_run")   -- no more additionalKeys statement enclosing this binding here
    , ((modMask              , xK_Tab      ), windows W.focusDown)
    , ((modMask              , xK_j        ), windows W.focusDown)
    , ((modMask              , xK_k        ), windows W.focusUp)
    , ((modMask              , xK_m        ), windows W.focusMaster)
    , ((modMask .|. shiftMask, xK_Return   ), windows W.swapMaster)
    , ((modMask .|. shiftMask, xK_j        ), windows W.swapDown)
    , ((modMask .|. shiftMask, xK_k        ), windows W.swapUp)
    , ((modMask              , xK_h        ), sendMessage Shrink)
    , ((modMask              , xK_l        ), sendMessage Expand)
    , ((modMask              , xK_t        ), withFocused $ windows . W.sink)
    , ((modMask              , xK_comma    ), sendMessage (IncMasterN 1))
    , ((modMask              , xK_period   ), sendMessage (IncMasterN (-1)))
    , ((modMask .|. shiftMask, xK_q        ), io (exitWith ExitSuccess))
    , ((modMask              , xK_q        ), spawn "xmonad --recompile; xmonad --restart")
    , ((modMask              , xK_F2       ), shellPrompt defaultXPConfig)
    , ((0                    , 0x1008ff30  ), shellPrompt defaultXPConfig)
    , ((0                    , 0x1008ff13  ), spawn "amixer -q set Master 2dB+")
    , ((0                    , 0x1008ff11  ), spawn "amixer -q set Master 2dB-")
    , ((0                    , 0x1008ff12  ), spawn "amixer -q set Master toggle")
    , ((0                    , 0x1008ff16  ), spawn "cmus-remote --prev")
    , ((0                    , 0x1008ff17  ), spawn "cmus-remote --next")
    , ((0                    , 0x1008ff14  ), spawn "cmus-remote --pause")
    , ((0                    , 0x1008ff5b  ), spawn "urxvt -e screen -rd cmus")
    , ((modMask              , xK_Print    ), spawn "scrot -e 'mv $f ~/Screenshots'")
    ]
    ++
 
    [((m .|. modMask, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
 
    ++
 
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
 
myLayout = avoidStruts $ tiled ||| wideTiled ||| Full
  where
     tiled = HintedTile nmaster delta ratio Center Tall
     wideTiled = HintedTile nmaster delta ratio Center Wide
     nmaster = 1
     ratio   = 1/2
     delta   = 3/100

Hope this helps....


"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website      Configs
Forum Admin: Bruno's All Things Linux   
securitybreach<a>archlinux.us

Offline

#43 2011-08-22 10:47:59

gammel.holte
Member
Registered: 2010-02-01
Posts: 53

Re: SOLVED:Dmenu not launching correctly in Xmonad

MickeyKnox wrote:

Thank you for your reply, it doesn't work for me however.
Since i don't have a Windows key on my keyboard, i had to alter it a bit:
I removed the modMask = mod4Mask line and the 4 on the last line.

I don't know any Haskell, but just from pure intuition it seems that you can't remove the number. Otherwise, you'll get a type error.

Try using mod1Mask (the default modMask).

HTH.

Offline

#44 2011-08-23 10:31:35

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: SOLVED:Dmenu not launching correctly in Xmonad

Thanks a bunch, gammel.holte. That did the trick.

However, i still think xmonad should be updated, to
work with the new dmenu out of the box.

Offline

#45 2011-08-23 11:58:32

gammel.holte
Member
Registered: 2010-02-01
Posts: 53

Re: SOLVED:Dmenu not launching correctly in Xmonad

You are welcome.

I also think that XMonad should be updated. In fact, they were already aware that this bug existed last time I had a look at their bug tracker.

Probably their development version has already fixed the issue. The problem is that XMonad moves fast, but not as fast as suckless (dmenu). Few distros are rolling-release like Arch, so it is quite likely that not many people is experiencing our problem.

Best,

Offline

Board footer

Powered by FluxBB