Xmonad.hs file: I need a template, but the official one gives errors

I just installed Xmonad and I am LOVING it, but I need some help setting up an xmonad.hs file. I created one in ~/.xmonad/xmonad.hs and looked for a well-commented template since I don't know any Haskell (or any programming language, for that matter). This is the one I copied to the file:
http://www.haskell.org/haskellwiki/Xmon … _xmonad.hs
Which gives:
-- xmonad example config file.
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
-- Normally, you'd only override those defaults you care about.
import XMonad
import System.Exit
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-- The preferred terminal program, which is used in a binding below and by
-- certain contrib modules.
myTerminal = "xterm"
-- Width of the window border in pixels.
myBorderWidth = 1
-- modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
-- ("right alt"), which does not conflict with emacs keybindings. The
-- "windows key" is usually mod4Mask.
myModMask = mod1Mask
-- The mask for the numlock key. Numlock status is "masked" from the
-- current modifier status, so the keybindings will work with numlock on or
-- off. You may need to change this on some systems.
-- You can find the numlock modifier by running "xmodmap" and looking for a
-- modifier with Num_Lock bound to it:
-- > $ xmodmap | grep Num
-- > mod2 Num_Lock (0x4d)
-- Set numlockMask = 0 if you don't have a numlock key, or want to treat
-- numlock status separately.
myNumlockMask = mod2Mask
-- The default number of workspaces (virtual screens) and their names.
-- By default we use numeric strings, but any string may be used as a
-- workspace name. The number of workspaces is determined by the length
-- of this list.
-- A tagging example:
-- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
-- Border colors for unfocused and focused windows, respectively.
myNormalBorderColor = "#dddddd"
myFocusedBorderColor = "#ff0000"
-- Default offset of drawable screen boundaries from each physical
-- screen. Anything non-zero here will leave a gap of that many pixels
-- on the given edge, on the that screen. A useful gap at top of screen
-- for a menu bar (e.g. 15)
-- An example, to set a top gap on monitor 1, and a gap on the bottom of
-- monitor 2, you'd use a list of geometries like so:
-- > defaultGaps = [(18,0,0,0),(0,18,0,0)] -- 2 gaps on 2 monitors
-- Fields are: top, bottom, left, right.
myDefaultGaps = [(0,0,0,0)]
-- Key bindings. Add, modify or remove key bindings here.
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
-- launch a terminal
[ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
-- launch dmenu
, ((modMask, xK_p ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
-- launch gmrun
, ((modMask .|. shiftMask, xK_p ), spawn "gmrun")
-- close focused window
, ((modMask .|. shiftMask, xK_c ), kill)
-- Rotate through the available layout algorithms
, ((modMask, xK_space ), sendMessage NextLayout)
-- Reset the layouts on the current workspace to default
, ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
-- Resize viewed windows to the correct size
, ((modMask, xK_n ), refresh)
-- Move focus to the next window
, ((modMask, xK_Tab ), windows W.focusDown)
-- Move focus to the next window
, ((modMask, xK_j ), windows W.focusDown)
-- Move focus to the previous window
, ((modMask, xK_k ), windows W.focusUp )
-- Move focus to the master window
, ((modMask, xK_m ), windows W.focusMaster )
-- Swap the focused window and the master window
, ((modMask, xK_Return), windows W.swapMaster)
-- Swap the focused window with the next window
, ((modMask .|. shiftMask, xK_j ), windows W.swapDown )
-- Swap the focused window with the previous window
, ((modMask .|. shiftMask, xK_k ), windows W.swapUp )
-- Shrink the master area
, ((modMask, xK_h ), sendMessage Shrink)
-- Expand the master area
, ((modMask, xK_l ), sendMessage Expand)
-- Push window back into tiling
, ((modMask, xK_t ), withFocused $ windows . W.sink)
-- Increment the number of windows in the master area
, ((modMask , xK_comma ), sendMessage (IncMasterN 1))
-- Deincrement the number of windows in the master area
, ((modMask , xK_period), sendMessage (IncMasterN (-1)))
-- toggle the status bar gap
, ((modMask , xK_b ),
modifyGap (\i n -> let x = (XMonad.defaultGaps conf ++ repeat (0,0,0,0)) !! i
in if n == x then (0,0,0,0) else x))
-- Quit xmonad
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
-- Restart xmonad
, ((modMask , xK_q ),
broadcastMessage ReleaseResources >> restart "xmonad" True)
++
-- mod-[1..9], Switch to workspace N
-- mod-shift-[1..9], Move client to workspace N
[((m .|. modMask, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
++
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
[((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)]]
-- Mouse bindings: default actions bound to mouse events
myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
-- mod-button1, Set the window to floating mode and move by dragging
[ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w))
-- mod-button2, Raise the window to the top of the stack
, ((modMask, button2), (\w -> focus w >> windows W.swapMaster))
-- mod-button3, Set the window to floating mode and resize by dragging
, ((modMask, button3), (\w -> focus w >> mouseResizeWindow w))
-- you may also bind events to the mouse scroll wheel (button4 and button5)
-- Layouts:
-- You can specify and transform your layouts by modifying these values.
-- If you change layout bindings be sure to use 'mod-shift-space' after
-- restarting (with 'mod-q') to reset your layout state to the new
-- defaults, as xmonad preserves your old layout settings by default.
-- The available layouts. Note that each layout is separated by |||,
-- which denotes layout choice.
myLayout = tiled ||| Mirror tiled ||| Full
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 1/2
-- Percent of screen to increment by when resizing panes
delta = 3/100
-- Window rules:
-- Execute arbitrary actions and WindowSet manipulations when managing
-- a new window. You can use this to, for example, always float a
-- particular program, or have a client always appear on a particular
-- workspace.
-- To find the property name associated with a program, use
-- > xprop | grep WM_CLASS
-- and click on the client you're interested in.
-- To match on the WM_NAME, you can use 'title' in the same way that
-- 'className' and 'resource' are used below.
myManageHook = composeAll
[ className =? "MPlayer" --> doFloat
, className =? "Gimp" --> doFloat
, resource =? "desktop_window" --> doIgnore
, resource =? "kdesktop" --> doIgnore ]
-- Whether focus follows the mouse pointer.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
-- Status bars and logging
-- Perform an arbitrary action on each internal state change or X event.
-- See the 'DynamicLog' extension for examples.
-- To emulate dwm's status bar
-- > logHook = dynamicLogDzen
myLogHook = return ()
-- Now run xmonad with all the defaults we set up.
-- Run xmonad with the settings you specify. No need to modify this.
main = xmonad defaults
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
-- No need to modify this.
defaults = defaultConfig {
-- simple stuff
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
borderWidth = myBorderWidth,
modMask = myModMask,
numlockMask = myNumlockMask,
workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
defaultGaps = myDefaultGaps,
-- key bindings
keys = myKeys,
mouseBindings = myMouseBindings,
-- hooks, layouts
layoutHook = myLayout,
manageHook = myManageHook,
logHook = myLogHook
So I copied all this into my new xmonad.hs file and then restarted xmonad with mod+q, but a window popped up giving me this error:
Error detected while loading xmonad configuration file: /home/agi/.xmonad/xmonad.hs
on the commandline:
Warning: -no-recomp is deprecated: Use -fforce-recomp instead
xmonad.hs:141:10: Not in scope: `modifyGap'
xmonad.hs:141:38: Not in scope: `XMonad.defaultGaps'
xmonad.hs:273:8: Not in scope: `defaultGaps'
Please check the file for errors.
I'm not exactly sure what any of this means. If someone could help me decipher this or, better yet, post a better (well-commented so I can understand it) default xmonad.hs file that I can use, that would be great.

Alright! I've got xmonad almost set up! One major thing I still want to do is add some sort of pager-like display in the top left of xmobar. Just to show workspaces 1-9 and highlight the one I'm in (giving a preview of my windows or telling me which ones I have windows in would be great, but not absolutely necessary).
I can't find anything (that I understand) online. Help?
Here's my xmonad.hs:
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
myManageHook = composeAll
[ className =? "Gimp" --> doFloat
main = do
xmproc <- spawnPipe "/path/to/xmobarbinary /home/jgoerzen/.xmobarrc"
-- make sure to edit paths to xmobar and .xmobarrc to match your system.
-- If xmobar is in your $PATH, with config ~/.xmobarrc you don't need the
-- xmobar path or config file, use: xmproc <- spawnPipe "xmobar"
xmonad $ defaultConfig
{ manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
, modMask = mod1Mask
} `additionalKeys`
[ ((mod1Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
, ((controlMask, xK_Print), spawn "scrot -s")
, ((0, xK_Print), spawn "scrot")
and here's my xmobarrc:
Config { font = "-Misc-Fixed-Bold-R-Normal--13-120-75-75-C-70-ISO8859-1"
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 90
, commands = [ Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Swap [] 10
, Run Date "%a %b %_d %l:%M" "date" 10
, Run StdinReader
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %cpu% | %memory% * %swap% <fc=#ee9a00>%date%</fc> |"

Similar Messages

  • I accidentally deleted my Acrobat 9 from my MAC and need to reinstall but the install file isn't there.

    I accidentally deleted my Acrobat 9 from my MAC and need to reinstall but the install file isn't there.

    That is the gmail server which has nothing to do with your iphone or Apple.
    contact gmail.

  • I can't download the Adobe Edge Reflow. The file's downloading is successfull but the file doesn't go to my Creative Cloud so I can't install the programme. I have already install the Photoshop CC and the Reflow Plug-in for Photoshop. May I ask help? :) T

    I can't download the Adobe Edge Reflow. The file's downloading is successfull but the file doesn't go to my Creative Cloud so I can't install the programme. I have already install the Photoshop CC and the Reflow Plug-in for Photoshop.

    Hello
    1. I am running on Windows 8.1
    2. When running the installer file from https://creative.adobe.com/products/download/reflow I get the following choice
    I click "OK" which doesn't do anything for me (CC is off).
    I turn CC on and run the installer again. I get the following window that within few settings disappears:
    Then - just for half a second it says "Launching Creative Cloud desktop" and then it brings CC to front, and that's all.
    RF still not there.
    3. I spoke ta support agent on the Adobe chat on Friday. He looked into my computer for an hour. Uninstalled After Effects (after failing to update it). For some reason all apps disappeared from the list. They then reappeared after he opened PS.
    This morning After Effects is still showing up in my system and is operational.
    Weird.
    4. At the end the agent suggested maybe Firewall is the problem here. Trying that out now.

  • I have downloaded a music file through a downloader . But the file is not found in the captured in music player . How can I locate the physical location and move the file . I cannot do via itunes also .

    I have downloaded a music file through a downloader . But the file is not found in the captured in music player . How can I locate the physical location and move the file . I cannot do via itunes also .

    Exactly what do you mean by a 'downloader'?
    Thanks
    Pete

  • I purchased FCPX via itunes in 2011, I need to reinstall, but the purchase is no longer listed.

    I purchased FCPX via itunes in 2011, I need to reinstall, but the purchase is no longer listed in itunes purchases, any suggestions

    laser147 wrote:
    I purchased FCPX via itunes in 2011, I need to reinstall, but the purchase is no longer listed in itunes purchases, any suggestions
    You certainly could not have bought FCPX via itunes. It can only be purchased using the Mac App Store. If you are indeed looking in iTunes, you won't find it. Start the Mac App Store application - it is right there in the Apple menu on your mac = make sure you are logged in with the same Apple ID used to purchase it and it should be there for you.

  • Copies are very bad, just faint lines. i thought i needed new ink but the printer works fine

    copies are very bad, just faint lines. I thought I needed new ink but the printer works fine

    copies are very bad, just faint lines. I thought I needed new ink but the printer works fine

  • Hi, i want to sinc my iphone with my new pc, i want to transfer music , but the old one musiz will be deseaper from my iphone, what i need to do, thanks

    hi, i want to sinc my iphone with my new pc, i want to transfer music , but the old one musiz will be deseaper from my iphone, what i need to do, thanks

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • I have a cooliris wall embedded in a website I built. IE shows it but Foxfire doesn't. I've looked for an add-on but the cooliris one goes to its own wall. I updated to ff4 but no difference. Is there a plug in I need?

    I have a cooliris wall embedded in a website I built. IE shows it but Foxfire doesn't. I've looked for an add-on but the cooliris one goes to its own wall. I updated to ff4 but no difference.

    I want all my devices to be on a password related internet but the double nat on my TC makes weird things happen and slow.  I try bridge mode but the internet doesn't work.
    You building supplied internet is a cheap service that is without proper routable addresses..
    Therefore to use more than one IP you MUST have double NAT.. sorry there is no choice..
    Slow that is because you are sharing internet with every other person in the building.. get your own broadband service.
    Bridge will not work.. it cannot work because the building only has private IP addressing. And they only give you a single address.
    You can put a password on the wireless.. go to the airport utility and put in a password.
    Other than that I don't understand what password you expect.
    Can I get an explanation of what bridge mode is?
    No NAT.. means the TC becomes a dumb Wireless AP and switch.. works fine with a cable modem router.. or any broadband router but useless with your building system.
    Can I get suggestions on what I should do to use the TC as a wireless device to spread the same wireless device my apartment is broadcasting?
    Double NAT, and set your own wireless names. There is no alternative.. sorry.

  • HT203167 I bought two audio books on iTunes but they will not play. My old books play without issue but the new ones do not.

    I bought two audio books on iTunes but they will not play. My old books play without issue but the new ones do not.

    Did you copy your actual iTunes content from your computer before reinstalling iTunes, or did you just copy your iTunes library which only contains the pointers to your songs / books locations ?
    You might, depending upon your country and if they are still in your country's store, be able to redownload your music purchases and your ibooks via the Purchased link under Quick Links on the right-hand side of the iTunes store homepage - you will need to delete the entries from your library (where you are getting the 'unable to locate' messages) before they will potentially show with the cloud icon against them in Purchased for redownloading.
    Or copy them from your backup of your downloads/library and add them to your iTunes library via File > Add To Library

  • TS1702 i've an iphone 3.1.3. sometimes, i have problems opening all the apps i downloaded in the past 4 months. other apps would open but the recent ones will begin to boot and then close itself. once, it persisted for over a week. pls help as am frustrat

    i've an iphone 3.1.3. sometimes, i have problems opening all the apps i downloaded in the past 4 months. other apps would open but the recent ones will begin to boot and then close itself. once, it persisted for over a week. it staarted again this evening, pls help as am frustrated. NB- i checked for apps update but all my apps are up-to-date. CT

    Try the usual steps: restart, reset, restore.
    http://support.apple.com/kb/HT1430
    http://support.apple.com/kb/HT1414
    If restoring using a backup doesn't help, try restoring the iPhone to factory settings and try for a while with just the Apple-included apps, to make sure it's not an issue with a third-party app. If it still has problems, it may have a hardware problem and will need to be sent to Apple.
    Regards.

  • I have a mid year 2007 24 inch iMac and will be purchasing a new 27 inch Retina iMac, what is the easiest way to transfer the data and files from my old machine to the new one?

    I have a mid year 2007 24 inch iMac and will be purchasing a new 27 inch Retina iMac, what is the easiest way to transfer the data and files from my old machine to the new one?

    Following up on this thread,
    I have a new iMac on the way and my current is from 2008, never had a problem but I am sure there are internal issues that I would prefer not to transfer.
    I have no issues other then the slowness in certain programs and that is the main reason to buy a new one.
    Programs like numbers and pages seem to take a longer time to open after I update to Yosemite.
    I only use 272GB of 500 GB, my memory is 4GB and I am upgrading to 8Gb and bought the 4.0 processor.
    Question:
    Is there a way to manually transfer items or would that be a waste of time in that if there are issues they could be anywhere and would transfer anyway?

  • I'm trying to create a list using CustomSchemalXml property in ListCreationInformation object in CSOM. But, the code throws an error "Invalid List Schema".

    I'm trying to create a list using CustomSchemalXml  property in ListCreationInformation object in CSOM. But, the code throws an error "Invalid List Schema". Any pointers on how to set the CustomSchemalXml property?
    Sri

    Hi Lakshmanan,
    Thanks for your reply.
    I checked this post and there was no solution to the problem there. I undersand we cannot create a list based on custom template in CSOM, but what I'm looking for is how of form xml and set it to CustomSchemalXml
     property, so that everytime when I want to create a list with similar content types and stuff, I can just set the
    CustomSchemalXml  property. 
    Sri

  • HT201320 when I go to do updates the window pops up apple id password I no longer have this email Ive tried to add a new email but the old one is still showing up. I don't know where or what to do now, can you help?

    needing help to change apple id email address. I went in settings and changed the email but the new one isn't showing up Ive called different support numbers and I changed email but it still shows up.

    If you are talking about app updates, these are permanently tied to the Apple ID used to purchase the app, regardless of the ID on your phone in Settings>Store.  The only way to stop the prompt for your older ID would be to delete these apps from your phone.  The ID in Settings>Store is the one being used for current purchases, not updates of apps purchased using a different ID.

  • One safari is fast but the other one is extremely slow while open the same website!

    When i open nrich.maths.org on my two macbook pro, one is fast but the other one is extremely slow. I traced this website on both but seemed nothing difference.
    My safaris are both version 5.1.2 (7534.52.7), os are 10.7.2, settings of safaris are same.
    I also tried some other sites but all's fast.
    Anybody have any ideas?
    Appreciate!
    Tony

    On the one that's slow...
    Go to Safari > Preferences - Extensions. If you have any installed, turn that off, quit then relaunch Safari to test.
    If it's not an extension issue, try troubleshooting the Safari .plist file.
    Go to ~/Library/Preferences. Move the com.apple.Safari.plist file from the Preferences folder to the Desktop. Qui then relaunch Safari to test. If Safari speeds up, move that .plist file to the Trash. If not, move it back to the Preferences folder.
    Empty the Safari cache more often. From the Safari menu bar click Safari > Empty Cache
    If that doesn't help, back to the menu bar, click Safari > Reset Safari. Select the top 5 buttons, click Reset.
    ~ (Tilde) character represents the Home folder.
    For Lion:   To find the Home folder in OS X Lion, open the Finder, hold the Option key, and choose Go > Library

  • HT204400 We were watching a movie from iTunes on our Apple TV and it froze with about 10 minutes left... just a spinning disk.  Network was fine, I could run Netflix, I could choose other content... but the movie only gives spinning disk when I go to it.

    We were watching a movie from iTunes on our Apple TV and it froze with about 10 minutes left... just a spinning disk.  Network was fine, I could run Netflix, I could choose other content via AppleTV or iTunes... but the movie only gives spinning disk when I go back to it.  I confirmed settings on AppleTV and reset the unit without any result.  iTunes indicates I have 21 hours left on the rental.  I would like to be able to finish the movie and not have to rent it again.
    Any thoughts?  Anything that needs to be done in Samsung TV settings?

    How did you verify network was fine?
    Netflix adapts to the network whereas iTunes needs a consistently solid connection. What other content did you try?
    What is your current connection via speedtest
    Go to istumbler (Mac) or netstumbler (PC) to get a report of the network
    Make sure DNS is set to automatic.

Maybe you are looking for

  • Preview will not open in Lion

    After up grading to Lion my Preview and TextEdit will not open.  So far I have: 1. Followed instructions for removing a Symlink.  When in terminal to rm ~/Downloads, I get a message saying downloads is a directory and nothing happens. 2. I have used

  • Albums in the "Pictures" app

    how do I create albums in the "Pictures" app to organize my photos

  • How to create new subtypes for OM infotype 1002?

    Gurus,             I have a requirement to create four new subtypes (to different texts ) for OM infotype HRP1002. Let me know the procedure to achieve this. I looked in subtype table T591A and T591S, but couldn't find any subtype (even the standard

  • Missing "Start Page" Tab.

    I accidentally closed the "Start Page" tab in OWB 11g Design Center. How do I get the "Start Page" tab to open when I launch Design Center? Thanks. Dan

  • Time machine deleted applications folder after restoring files

    my macbook 13 inch black would not start up. grey progress bar then would shutdown. Used time machine to restore my files. Time machine has deleted my applications folder after restoring files. how do I get them back.