You are not logged in.

#451 2011-05-16 16:40:58

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

Re: xmonad Hacking Thread

Thank you very much thayer and Mr.Elendig for the great support! Your input was very helpful and so where the links! I have got my keys working as I want them. smile
I will post my final code just for anybody else who might be having a similar problem.
Cheers!

module Main (main) where

import XMonad

import qualified Data.Map as M
import Graphics.X11.Xlib
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.XMonad

main :: IO ()
main = xmonad $ defaultConfig { keys = newKeys }

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

myKeys conf@(XConfig {XMonad.modMask = modm}) =
             [ ((0 , 0x1008ff12), spawn "amixer -q sset Master toggle"   ) --XF86AudioToggleVolume
             , ((0 , 0x1008ff11), spawn "amixer -q sset Master 2- un mute") --XF86AudioLowerVolume
             , ((0 , 0x1008ff13), spawn "amixer -q sset Master 2+ unmute") --XF86AudioRaiseVolume
             ]

Offline

#452 2011-06-01 11:31:08

mklappstuhl
Member
Registered: 2010-11-14
Posts: 5

Re: xmonad Hacking Thread

After using xmonad for a few weeks I found a few little annoyances which probably can be easily fixed.

  1. When a program opens a dialog ("Save as" for example) and I have several windows in fullscreen mode in the background the topmost window gets lowered one layer. This always happens when I focus a floating window.

  2. I were not able to get Dzen completely working. As I understood it I need to have multiple instances of dzen to show workspaces and clock etc. I tried to merge in the dzen configuration that I found in some xmonad configs in the xmonad wiki but that didn't quite work. Currently the the problem is this:

    xmonad.hs:70:40:
        Couldn't match expected type `GHC.IO.Handle.Types.Handle'
                    with actual type `XConfig l0
                                      -> IO
                                           (XConfig
                                              (XMonad.Layout.LayoutModifier.ModifiedLayout
                                                 XMonad.Hooks.ManageDocks.AvoidStruts l0))'
        In the first argument of `myDzenPP', namely `dzen'
        In the second argument of `($)', namely `myDzenPP dzen'
        In the expression: dynamicLogWithPP $ myDzenPP dzen                                                      

    Strangely "dzen" should be of type IO Handle since it is set with this command

    dzen <- spawnPipe myStatusBar

    and spawnPipe should return an IO Handle...

  3. Because xmonad isn't a DE there are not much of file type associations to default programs. As probably everyone of you has to deal with that: How do you set this up? (A few keywords might be enough)

Thanks for any help smile
I have a copy of my xmonad config here: https://gist.github.com/378fd12feaf94127393b

Offline

#453 2011-06-01 11:46:20

count-corrupt
Member
From: Germany
Registered: 2009-02-01
Posts: 112

Re: xmonad Hacking Thread

mklappstuhl wrote:

I were not able to get Dzen completely working. As I understood it I need to have multiple instances of dzen to show workspaces and clock etc. I tried to merge in the dzen configuration that I found in some xmonad configs in the xmonad wiki but that didn't quite work. Currently the the problem is this:

xmonad.hs:70:40:
    Couldn't match expected type `GHC.IO.Handle.Types.Handle'
                with actual type `XConfig l0
                                  -> IO
                                       (XConfig
                                          (XMonad.Layout.LayoutModifier.ModifiedLayout
                                             XMonad.Hooks.ManageDocks.AvoidStruts l0))'
    In the first argument of `myDzenPP', namely `dzen'
    In the second argument of `($)', namely `myDzenPP dzen'
    In the expression: dynamicLogWithPP $ myDzenPP dzen                                                      

Strangely "dzen" should be of type IO Handle since it is set with this command

dzen <- spawnPipe myStatusBar

You are referencing the handle out of scope. What happens after main, happens inside the IO monad. Your definition of the loghook happens in pure code. You can pass the handle as a parameter to myConfig and from there to logHook'. That means giving your logHook' and myConfig functions a parameter of type IO Handle and pass it on.

Offline

#454 2011-06-03 21:32:39

ratzfatz
Member
From: KL, Germany
Registered: 2011-06-03
Posts: 30

Re: xmonad Hacking Thread

thayer wrote:

My current (Xmonad 0.9) configs can be found at github:  http://github.com/thayerwilliams

2007-12-12 screenshot and xmonad.hs:
http://cinderwick.ca/projects/screenshots/thumb-20071212-2442186510.png

Hallo,

what's that for a file browser, and what's the style of it? How did you chanched the style of the windows? It's a very fancy configuration!

regards ratzfatz


The common language in modern science is broken english wink

Offline

#455 2011-06-04 16:19:41

zyxon
Member
From: Hungary
Registered: 2010-08-31
Posts: 36
Website

Re: xmonad Hacking Thread

Hi. I've been using xmonad for a week now, and overall I'm satisfied with it for the most part smile. This is the first tiling wm I ever tried, and I like this way of managing my desktop. Haskell is really mindfucking, but once you get used to it, it works. Ideas/improvements are welcome. This is my github repo, to which I upload my latests configurations. I use cinderwick's 'vimbrant' color settings. My irssi theme is 'redhead'.  My config is based on Aeva's xmonad settings.

This is my config:

v_OHgyc_A.jpg

xmonad.hs

-- Imports {{{

import XMonad
import System.Exit
import System.IO
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-- actions
import XMonad.Actions.CycleWS
import XMonad.Actions.GridSelect
-- layouts
import XMonad.Layout.Grid
import XMonad.Layout.NoBorders
import XMonad.Layout.Spacing
import XMonad.Layout.ResizableTile
import XMonad.Layout.StackTile
-- hooks
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Hooks.UrgencyHook
-- utils
import XMonad.Util.EZConfig
import XMonad.Util.Run

-- }}}
-- The basics {{{

myTerminal      = "urxvt"
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
myBorderWidth   = 2
myModMask       = mod4Mask
myWorkspaces    = ["1:www","2:chat","3:dev","4:music","5:file","6:etc"]
myNormalBorderColor = "white"
myFocusedBorderColor = "#f92672"
--myBar = xmobar


-- Key bindings {{{

myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
 
    -- launch a terminal
    [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
 
    -- launch dmenu    
    , ((modm,               xK_p     ), spawn "exe= `dmenu_path | dmenu -nb '#101010' -nf '#f92672' -sb '#f92672' -sf '#101010'` && eval \"exec $exe\"")

    -- dmenu_path | dmenu -nb 101010 -nf f92672 -sb f92672 -sf 101010

    -- close focused window
    , ((modm .|. shiftMask, xK_c     ), kill)
 
     -- Rotate through the available layout algorithms
    , ((modm,               xK_space ), sendMessage NextLayout)
 
    --  Reset the layouts on the current workspace to default
    , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
 
    -- Resize viewed windows to the correct size
    , ((modm,               xK_n     ), refresh)
 
    -- Select an application from a grid
    , ((modm,               xK_e     ), goToSelected defaultGSConfig)

    -- Move focus to the next window
    , ((modm,               xK_Tab   ), windows W.focusDown)
 
    -- Move focus to the next window
    , ((modm,               xK_j     ), windows W.focusDown)
 
    -- Move focus to the previous window
    , ((modm,               xK_k     ), windows W.focusUp  )
 
    -- Move focus to the master window
    , ((modm,               xK_m     ), windows W.focusMaster  )
 
    -- Swap the focused window and the master window
    , ((modm,               xK_Return), windows W.swapMaster)
 
    -- Swap the focused window with the next window
    , ((modm .|. shiftMask, xK_j     ), windows W.swapDown  )
 
    -- Swap the focused window with the previous window
    , ((modm .|. shiftMask, xK_k     ), windows W.swapUp    )
 
    -- Shrink the master area
    , ((modm,               xK_h     ), sendMessage Shrink)
 
    -- Expand the master area
    , ((modm,               xK_l     ), sendMessage Expand)
 
    -- Push window back into tiling
    , ((modm,               xK_t     ), withFocused $ windows . W.sink)
 
    -- Increment the number of windows in the master area
    , ((modm              , xK_comma ), sendMessage (IncMasterN 1))
 
    -- Deincrement the number of windows in the master area
    , ((modm              , xK_period), sendMessage (IncMasterN (-1)))
 
    -- Toggle the status bar gap
    -- Use this binding with avoidStruts from Hooks.ManageDocks.
    -- See also the statusBar function from Hooks.DynamicLog.
    --
    , ((modm              , xK_b     ), sendMessage ToggleStruts)

    -- Lock screen with xscreensaver
    , ((modm .|. shiftMask, xK_z     ), spawn "xscreensaver-command -lock")
 
    -- Quit xmonad
    , ((modm .|. shiftMask, xK_q     ), io (exitWith ExitSuccess))
 
    -- Restart xmonad
    , ((modm              , xK_q     ), spawn "xmonad --recompile; xmonad --restart")

    , ((modm              , xK_Right ), nextWS)

    , ((modm              , xK_Left  ), prevWS)

    ]
    ++
 
    --
    -- mod-[1..9], Switch to workspace N
    -- mod-shift-[1..9], Move client to workspace N
    --
    [ ((m .|. modm, k), windows $ f i)
        | (i, k) <- zip (myWorkspaces) [xK_1 .. xK_8]
        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
    ]

-- }}}
-- Mouse bindings {{{

myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
    [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
                                       >> windows W.shiftMaster))
    , ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
    , ((modm, button3), (\w -> focus w >> mouseResizeWindow w
                                       >> windows W.shiftMaster))
    ]

-- }}}
-- Hooks & Layouts {{{

myLayoutHook = spacing 10 $ smartBorders$ avoidStruts$ (tiled ||| Mirror tiled ||| full)
  where
    tiled = Tall nmaster delta ratio 
    nmaster = 1
    ratio = 1/2 
    delta = 3/100
    full = Full

myManageHook = ( composeAll . concat $
    [ [className =? "Gimp"           --> doFloat] -- float
    , [className =? "MPlayer"        --> doFloat]
    , [className =? "Pidgin"         --> doFloat]
    , [className =? "Chromium"       --> doShift "1:www"] --shift
    , [className =? "Firefox"        --> doShift "1:www"]
    , [className =? "Namoroka"       --> doShift "1:www"]
    , [className =? "Opera"          --> doShift "1:www"]
    , [className =? "Thunar"         --> doShift "4:file"]
    , [className =? "Pidgin"         --> doShift "2:chat"]
    , [className =? "MPlayer"        --> doShift "6:misc"]
    , [className =? "ncmpcpp"        --> doShift "7:music"]
    , [resource  =? "desktop_window" --> doIgnore] -- ignore
    , [resource  =? "kdesktop"       --> doIgnore]
    ])

    where

        role    = stringProperty "WM_WINDOW_ROLE"
        name    = stringProperty "WM_NAME"

--myLogHook = return ()

-- }}}
-- Main {{{

main = do
    xmproc <- spawnPipe "/usr/bin/xmobar /home/zyxon/.xmobarrc"
    xmonad $ defaultConfig {
       -- the basics
        terminal = myTerminal,
        focusFollowsMouse = myFocusFollowsMouse,
        borderWidth = myBorderWidth,
        modMask = myModMask,
        workspaces = myWorkspaces,
        normalBorderColor = myNormalBorderColor,
        focusedBorderColor = myFocusedBorderColor,
--    statusBar = myBar,
       -- keybinds
        keys = myKeys,
        mouseBindings = myMouseBindings,
       -- hooks & layouts
        layoutHook = avoidStruts $ myLayoutHook,
        manageHook = manageDocks <+> manageHook defaultConfig,
    logHook = dynamicLogWithPP xmobarPP
                        { ppOutput = hPutStrLn xmproc
                        , ppTitle = xmobarColor "#56c2d6" "" . shorten 20
            , ppCurrent = xmobarColor "#56c2d6" "" . wrap "[[" "]]"
            , ppHidden = xmobarColor "white" "#161616" . wrap "[" "]"
                  , ppHiddenNoWindows = xmobarColor "#444444" "#161616" . wrap "[" "]"
            , ppSep = " | "
                        }

--        startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
    }

-- }}}

.xmobarrc

Config { font = "-*-fixed-medium-r-*-*-18-*-*-*-*-*-*-*"
       , bgColor = "#101010"
       , fgColor = "#f92672"
       , position = Top
       , lowerOnStart = True
       , commands = [ Run Weather "LHBP" ["-t","<station>:<tempC>C","-L","18","-H","25","--normal","#56c2d6","--high","#56c2d6","--low","#56c2d6"] 36000
                    , Run Network "eth0" ["-L","0","-H","32","--normal","#56c2d6","--high","#56c2d6"] 10
                    , Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10
                    , Run Cpu ["-L","3","-H","50","--normal","#56c2d6","--high","#56c2d6", "--low", "#56c2d6"] 10
                    , Run Memory ["-t","Mem: <usedratio>%","--normal","#56c2d6","--high","#56c2d6", "--low", "#56c2d6"] 10
                    , Run Swap ["--normal","#56c2d6","--high","#56c2d6", "--low", "#56c2d6"] 10
                    , Run Com "uname" ["-s","-r"] "" 36000
                    , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
            , Run StdinReader
                    ]
       , sepChar = "%"
       , alignSep = "}{"
       , template = "%StdinReader% | %cpu% | %memory% * %swap% | %eth0% }{ %LHBP% | %date%" }

Offline

#456 2011-06-04 20:28:31

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

Re: xmonad Hacking Thread

ratzfatz wrote:
thayer wrote:

My current (Xmonad 0.9) configs can be found at github:  http://github.com/thayerwilliams

2007-12-12 screenshot and xmonad.hs:
http://cinderwick.ca/projects/screenshots/thumb-20071212-2442186510.png

Hallo,

what's that for a file browser, and what's the style of it? How did you chanched the style of the windows? It's a very fancy configuration!

regards ratzfatz

@ratzfatz: I think at the time I was using Thunar, but it could be Nautilus. I think the icon theme was 'monochrome' or something like that; either way it was a standard GTK+ icon pack so it changed the icons in all GTK+ applications, not just the file manager.

@zyxon: nice setup!


thayer williams ~ cinderwick.ca

Offline

#457 2011-06-05 10:24:13

ratzfatz
Member
From: KL, Germany
Registered: 2011-06-03
Posts: 30

Re: xmonad Hacking Thread

Hello,

i have some trouble to configure my xmonad.hs - I want add those features.

1.) I want to float all vlc windows (open file-window, etc...), but not the "main-vlc-window"

2.) I want to float the exaile and the thunderbird-window, give them a predefined size (best way: height and width in pixel) and I want to shown them on all screens. I want to have a shortcut to hide this windows - and the same shortcut to show them if they are hidden.


Here you can find my current xmonad.hs http://www.wuala.com/ratzfatz/%C3%B6ffentlich/

Thanks for your advice!


The common language in modern science is broken english wink

Offline

#458 2011-06-05 14:15:10

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

Re: xmonad Hacking Thread

Hi is there a way to fake a workspace/window focus, since i want to launch rdesktop in the background, now if i launch it , i have to go to the workspace where i auto move it to and then it laucnhes. I tried xdotool windowactivate 1234323 but that swtiches to the workspace whichi don't want.

Offline

#459 2011-06-06 18:26:07

ratzfatz
Member
From: KL, Germany
Registered: 2011-06-03
Posts: 30

Re: xmonad Hacking Thread

thayer wrote:

Hello,

me again wink Can you give me several instructions to install your bar? It's brilliant!!! Never worked with concky or dzen before.

Thanks


The common language in modern science is broken english wink

Offline

#460 2011-06-06 19:48:50

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

Re: xmonad Hacking Thread

ratzfatz wrote:
thayer wrote:

Hello,

me again wink Can you give me several instructions to install your bar? It's brilliant!!! Never worked with concky or dzen before.

Thanks

Most of the details are in the config files at: github.com/thayerwilliams

You'll need to install: conky, xdotool, stalonetray and dzen2-xft-xpm-xinerama-svn (that last one is available from the AUR).

Take a look at my .xinitrc file in msi-dotfiles (my github repo) to see how I launch stuff; also, .stalonetrayrc has the systray preferences.  Dzen and conky are controlled by the xmonad.hs; all of that stuff is in the msi-xmonad repo.  Many of those files have comments in them to explain what they do.


thayer williams ~ cinderwick.ca

Offline

#461 2011-06-08 08:44:09

ratzfatz
Member
From: KL, Germany
Registered: 2011-06-03
Posts: 30

Re: xmonad Hacking Thread

Hello,

the awful reality is, that I'm not a archlinux user (my next distribution - I promise). In fact I using ubuntu (I'm not using linux for a long time), becouse I wanted a preconfigured system to getting started. But I can't find a useful XMonad-Community except this. Now I have proplems to install the package dzen2-xft-xpm-xinerama-svn - is there any way to get it for ubuntu?

A other promlem. Have a look on this line of my xmonad.hs

 kileL = avoidStruts $ smartBorders $ withIM (0.43)  (Role "MainWindow#1") $ tabLayout

The window will be put on the left side with the size 43 % of the screen. Is there a way to set the size (width) not relative to the size of the screen (width in pixels or something like that)

regards Michael


The common language in modern science is broken english wink

Offline

#462 2011-06-08 14:40:54

count-corrupt
Member
From: Germany
Registered: 2009-02-01
Posts: 112

Re: xmonad Hacking Thread

ratzfatz wrote:

But I can't find a useful XMonad-Community except this. Now I have proplems to install the package dzen2-xft-xpm-xinerama-svn - is there any way to get it for ubuntu?

Maybe not the package in that very configuration but you can compile your own. Check out the dzen svn repository and look at the file config.mk. It's very well documented. Bascially you just need to uncomment the lines you need for your desired configuration. There are three main features: XPM, XFT and xinerama. XPM allows you to use colored images with dzen, xinerama enables xinerama support (you don't say, I know) and XFT enables the use of freetype fonts.

Offline

#463 2011-06-09 08:31:46

Sakura
Member
Registered: 2010-05-06
Posts: 20

Re: xmonad Hacking Thread

Hey all!

First of all, awesome thread! A lot of useful suggestions and tips in here. You'll note that I incorporated quite a bit of them in my configuration. smile

I do have a few questions, though. Here is a screenshot of my configuration. It's still a work in progess and far from complete, however I have two problems that I have not been able to solve. The first one is that urxvt seems to have lost its focus border. It's strange because every single other application seems to have it. And the second problem, and perhaps the most frustrating, is the spaces that urxvt leaves on the bottom and right. I've tried everything to get rid of them, and read up on hinting and what could possibly be causing them, but I can't make heads or tails out of the situation. I'm kind of OCD so seeing this small imperfection really bothers me. What I'd like is for the urxvt window to expand and cover everything like I've seen in other configs. Any suggestions at all would be really appreciated!

Here are relevant configs (all a work in progress):

.Xdefaults

urxvt*background:   black
urxvt*foreground:   grey
urxvt*scrollBar:    false
urxvt*font:         xft:Bitstream Vera Sans Mono:size=8
urxvt*depth:        32
urxvt*background:   rgba:0000/0000/0000/dddd

xmonad.hs

import XMonad
import XMonad.Core

import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.Man

import XMonad.Layout
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.Gaps

import XMonad.Layout.Spacing

import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.SetWMName
import XMonad.Layout.LayoutHints

import XMonad.Util.EZConfig
import XMonad.Util.Run
import Graphics.X11.Xlib
import qualified Data.Map as M
import System.IO

main = do
   myStatusBarPipe <- spawnPipe myStatusBar
   conkyBar <- spawnPipe myConkyBar
   xmonad $ myUrgencyHook $ defaultConfig
      { terminal = "urxvt"
      , normalBorderColor  = myInactiveBorderColor
      , focusedBorderColor = myActiveBorderColor
      , manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
      , layoutHook = avoidStruts $ myLayoutHook
      , startupHook = setWMName "LG3D"
      , logHook = dynamicLogWithPP $ myDzenPP myStatusBarPipe
      , modMask = mod4Mask
      , keys = myKeys
      , workspaces = myWorkspaces
     }

-- Paths
myBitmapsPath = "/home/asm/System/icons/"

-- Font
myFont = "-*-terminus-*-*-*-*-*-*-*-*-*-*-*-*"

-- Colors
myBgBgColor = "black"
myFgColor = "gray80"
myBgColor = "gray20"
myHighlightedFgColor = "white"
myHighlightedBgColor = "gray40"

myActiveBorderColor = "gray90"
myInactiveBorderColor = "gray20"

myCurrentWsFgColor = "white"
myCurrentWsBgColor = "gray40"
myVisibleWsFgColor = "gray80"
myVisibleWsBgColor = "gray20"
myHiddenWsFgColor = "gray80"
myHiddenEmptyWsFgColor = "gray50"
myUrgentWsBgColor = "brown"
myTitleFgColor = "white"

myUrgencyHintFgColor = "white"
myUrgencyHintBgColor = "brown"

-- dzen general options
myDzenGenOpts = "-fg '" ++ myFgColor ++ "' -bg '" ++ myBgColor ++ "' -fn '" ++ myFont ++ "' -h '20'"

-- Status Bar
myStatusBar = "dzen2 -w 650 -ta l " ++ myDzenGenOpts

-- Conky Bar
myConkyBar = "conky -c ~/.conky_bar | dzen2 -x 650 -w 716 -ta r " ++ myDzenGenOpts

-- Layouts
myLayoutHook = smartBorders $ (tiled ||| Mirror tiled ||| Full)
  where
    tiled = ResizableTall nmaster delta ratio []
    nmaster = 1
    delta = 3/100
    ratio = 1/2

-- Workspaces
myWorkspaces =
   [
      (wrapBitmap "arch.xbm") ++ "home ",
      (wrapBitmap "bug_02.xbm") ++ "prog ",
      (wrapBitmap "fox.xbm") ++ "www ",
      (wrapBitmap "dish.xbm") ++ "irc ",
      (wrapBitmap "note.xbm") ++ "music "
   ]
   where
      wrapBitmap bitmap = "^p(5)^i(" ++ myBitmapsPath ++ bitmap ++ ")^p(5)"

-- Urgency hint configuration
myUrgencyHook = withUrgencyHook dzenUrgencyHook
    {
      args = [
         "-x", "0", "-y", "576", "-h", "20", "-w", "1024",
         "-ta", "r",
         "-fg", "" ++ myUrgencyHintFgColor ++ "",
         "-bg", "" ++ myUrgencyHintBgColor ++ ""
         ]
    }

myManageHook = composeAll
   [ className =? "Gimp" --> doFloat ]

-- Prompt config
myXPConfig = defaultXPConfig {
  position = Bottom,
  promptBorderWidth = 0,
  height = 15,
  bgColor = myBgColor,
  fgColor = myFgColor,
  fgHLight = myHighlightedFgColor,
  bgHLight = myHighlightedBgColor
  }

-- Union default and new key bindings
myKeys x  = M.union (M.fromList (newKeys x)) (keys defaultConfig x)

-- Add new and/or redefine key bindings
newKeys conf@(XConfig {XMonad.modMask = modm}) = [
  -- Use shellPrompt instead of default dmenu
  ((modm, xK_p), shellPrompt myXPConfig),
  -- Do not leave useless conky, dzen and xxkb after restart
  ((modm, xK_q), spawn "killall conky dzen2 xxkb; xmonad --recompile; xmonad --restart")
   ]
-- Dzen config
myDzenPP h = defaultPP {
  ppOutput = hPutStrLn h,
  ppSep = "^bg(" ++ myBgBgColor ++ ")^r(1,15)^bg()",
  ppWsSep = "",
  ppCurrent = wrapFgBg myCurrentWsFgColor myCurrentWsBgColor,
  ppVisible = wrapFgBg myVisibleWsFgColor myVisibleWsBgColor,
  ppHidden = wrapFg myHiddenWsFgColor,
  ppHiddenNoWindows = wrapFg myHiddenEmptyWsFgColor,
  ppUrgent = wrapBg myUrgentWsBgColor,
  ppTitle = (\x -> " " ++ wrapFg myTitleFgColor x),
  ppLayout  = dzenColor myFgColor"" .
                (\x -> case x of
                    "ResizableTall" -> wrapBitmap "half.xbm"
                    "Mirror ResizableTall" -> wrapBitmap "half.xbm"
                    "Full" -> wrapBitmap "full.xbm"
                )
  }
  where
    wrapFgBg fgColor bgColor content = wrap ("^fg(" ++ fgColor ++ ")^bg(" ++ bgColor ++ ")") "^fg()^bg()" content
    wrapFg color content = wrap ("^fg(" ++ color ++ ")") "^fg()" content
    wrapBg color content = wrap ("^bg(" ++ color ++ ")") "^bg()" content
    wrapBitmap bitmap = "^p(5)^i(" ++ myBitmapsPath ++ bitmap ++ ")^p(5)"

.conky_bar

gap_y -1000
background no
double_buffer yes
out_to_console yes
own_window yes
own_window_type desktop
update_interval 1.0
use_xft yes
font xft:Bitstream Vera Sans Mono

TEXT
${if_mpd_playing}^fg(\#1EFF00)^i(System/icons/phones.xbm) ^fg(\#60D152)${mpd_artist} - ${mpd_title} (${mpd_percent}%)${endif}  \
^fg(\#FAAFBA)^i(System/icons/spkr_01.xbm) ${mixer}  \
${if_match "${acpiacadapter}" == "on-line"}^fg(\#00FF00)^i(System/icons/ac_01.xbm)${if_match ${battery_percent BAT1} != 100} ${battery_percent BAT1}%${endif}${else}${if_match ${battery_percent BAT1} > 60}^fg(\#00FF00)^i(System/icons/bat_full_02.xbm)${else}${if_match ${battery_percent BAT1} > 30}^fg(\#FFFF00)^i(System/icons/bat_low_02.xbm)${else}^fg(\#FF0000)^i(System/icons/bat_empty_02.xbm)${endif}${endif} ${battery_percent BAT1}%${endif}  \
^fg(\#00FFEE)^i(System/icons/mem.xbm) ^fg(\#73E6DE)${memperc}%  \
^fg(\#FF8800)^i(System/icons/cpu.xbm) ^fg(\#DE9543)${cpu}% (${freq_g} GHz) \
${if_up eth1}^fg(\#00FF95)^i(System/icons/wifi_01.xbm) ^fg(\#00aa4a)^i(System/icons/net_down_03.xbm) ${downspeed eth1} ^fg(\#ff3333)^i(System/icons/net_up_03.xbm) ${upspeed eth1}${endif}\
^fg(\#B3B3B3)^i(System/icons/clock.xbm) ^fg(\#9E9E9E)${time %b%e %H:%M:%S}

Offline

#464 2011-06-09 08:54:08

count-corrupt
Member
From: Germany
Registered: 2009-02-01
Posts: 112

Re: xmonad Hacking Thread

Sakura wrote:

Hey all!

First of all, awesome thread! A lot of useful suggestions and tips in here. You'll note that I incorporated quite a bit of them in my configuration. smile

I do have a few questions, though. Here is a screenshot of my configuration. It's still a work in progess and far from complete, however I have two problems that I have not been able to solve. The first one is that urxvt seems to have lost its focus border. It's strange because every single other application seems to have it. And the second problem, and perhaps the most frustrating, is the spaces that urxvt leaves on the bottom and right. I've tried everything to get rid of them, and read up on hinting and what could possibly be causing them, but I can't make heads or tails out of the situation. I'm kind of OCD so seeing this small imperfection really bothers me. What I'd like is for the urxvt window to expand and cover everything like I've seen in other configs. Any suggestions at all would be really appreciated!

Urxvt without borders is a thing that happens when you set it to be transparent while using a composite manager such as xcompmgr. The problem is there since at least 18 months and nothing seems to be done about it. The rxvt people seem to blame it on the xmonad people and vice versa. Disable compositing or use fake transparency on your terminals to get rid of that. In fact, since there's nothing behind the terminal other than your wallpaper, fake transparency should do just as fine for you.
The borders problem is actually not a problem. Terminal emulators can only be resized in steps of character width and character height (horizontally and vertically respectively). So when the remaining space doesn't fit, the terminal refuses to paint into the leftover area and requests a slightly smaller size instead. Xmonad in it's basic configuration however doesn't respect this request and allocates the whole reserved space for terminals. Usually that yields ugly black borders inside the terminal window. Your configuration however uses layoutHints and hence the terminals wish for smaller size is granted. That does leave small gaps. I'm afraid there's no way around that yet, other than to try and find a terminal emulator that can deal with arbitrary window size. I have seen people deal with this by making their just the color of their borders. Then, it will look like the borders between terminals just got wider. It's a matter or preference.

Offline

#465 2011-06-09 15:51:04

X-dark
Member
From: France
Registered: 2009-10-25
Posts: 142
Website

Re: xmonad Hacking Thread

count-corrupt wrote:

Urxvt without borders is a thing that happens when you set it to be transparent while using a composite manager such as xcompmgr. The problem is there since at least 18 months and nothing seems to be done about it. The rxvt people seem to blame it on the xmonad people and vice versa. Disable compositing or use fake transparency on your terminals to get rid of that. In fact, since there's nothing behind the terminal other than your wallpaper, fake transparency should do just as fine for you.

What worked for me was to remove the depth setting from .Xdefaults.


Cedric Girard

Offline

#466 2011-06-11 04:03:16

Sakura
Member
Registered: 2010-05-06
Posts: 20

Re: xmonad Hacking Thread

count-corrupt wrote:

Urxvt without borders is a thing that happens when you set it to be transparent while using a composite manager such as xcompmgr. The problem is there since at least 18 months and nothing seems to be done about it. The rxvt people seem to blame it on the xmonad people and vice versa. Disable compositing or use fake transparency on your terminals to get rid of that. In fact, since there's nothing behind the terminal other than your wallpaper, fake transparency should do just as fine for you.
The borders problem is actually not a problem. Terminal emulators can only be resized in steps of character width and character height (horizontally and vertically respectively). So when the remaining space doesn't fit, the terminal refuses to paint into the leftover area and requests a slightly smaller size instead. Xmonad in it's basic configuration however doesn't respect this request and allocates the whole reserved space for terminals. Usually that yields ugly black borders inside the terminal window. Your configuration however uses layoutHints and hence the terminals wish for smaller size is granted. That does leave small gaps. I'm afraid there's no way around that yet, other than to try and find a terminal emulator that can deal with arbitrary window size. I have seen people deal with this by making their just the color of their borders. Then, it will look like the borders between terminals just got wider. It's a matter or preference.

That did the trick, many thanks!

Offline

#467 2011-06-11 04:08:14

borrell
Member
Registered: 2008-12-02
Posts: 31
Website

Re: xmonad Hacking Thread

Hey guys,

Just after a little help with my config (I'm not a haskell wizard by any means!)

myManageHook = composeAll
    [ className =? "MPlayer"        --> doFloat
    , className =? "Gimp"              --> doFloat
    , className =? "Npviewer.bin"   --> doFloat
    , className =? "Vlc"        --> doFloat
    , className =? "Nitrogen"    --> doFloat
    , title =? "Save File"        --> doFloat
    
    , resource  =? "desktop_window"    --> doIgnore
    , resource  =? "kdesktop"          --> doIgnore 
    
    , className =? "Chromium"    --> doShift "2:web"
    
    , className =? "Vlc"        --> viewShift "6:video"
    , className =? "URxvt"        --> viewShift "1:term"
    , className =? "MPlayer"    --> viewShift "6:video"
    ]
    where    viewShift = doF . liftM2 (.) W.greedyView W.shift

At the moment, then I open certain applications (urxvt, mplayer, vlc) they are switched to a particular workspace, and the workspace is focused on my current monitor (I have dual screens).

What I'm after is the ability to be able to shift a particular workspace to my second monitor. For example, when I start mplayer, for it to switch to workspace 6, and workspace 6 to be focused on my second monitor. At the moment, the workspace is focused on whichever screen has focus when I open mplayer. I want it to open on the second screen regardless of the currently focused screen.

I've looked around on the Xmonad docs but haven't seen anything relating to this except for XMonad.Layout.IndependentScreens. Does anyone use the IndependantScreens plugin? I'm not not entirely sure how to implement it.

Last edited by borrell (2011-06-11 04:10:43)

Offline

#468 2011-06-11 05:23:29

borrell
Member
Registered: 2008-12-02
Posts: 31
Website

Re: xmonad Hacking Thread

Also, posting this here to help anyone else with this problem:

To get the auto-type functionality working for KeePass under Xmonad, you need to make sure you have configured XMonad.Hooks.EwmhDesktops

This allows KeePass to grab the current window using xdotool and _NET_ACTIVE_WINDOW

Offline

#469 2011-06-11 09:48:05

zer
Member
Registered: 2011-04-09
Posts: 5

Re: xmonad Hacking Thread

Recently I was playing around with XMonad.Layout.Spacing.

Now I have the problem that ToggleStruts won't include the space that Spacing used up.
For example I set Spacing to 2, and  now the 2 top pixels of my bar will still be visible if I want to hide this bar with ToggleStruts.

that's my layout hook (the first line):

myLayoutHook =  smartBorders $ avoidStrutsOn[u] $ spacing 2 $ tiled ||| Mirror tiled ||| tabs ||| full

Is there a way to get around this?

Edit: is there a tag to disable BBCode? [code) decapitalizes capital characters in square brackets.

Last edited by zer (2011-06-11 09:50:48)

Offline

#470 2011-06-12 19:14:06

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

Re: xmonad Hacking Thread

borrell wrote:

Hey guys,

Just after a little help with my config (I'm not a haskell wizard by any means!)

...

What I'm after is the ability to be able to shift a particular workspace to my second monitor. For example, when I start mplayer, for it to switch to workspace 6, and workspace 6 to be focused on my second monitor. At the moment, the workspace is focused on whichever screen has focus when I open mplayer. I want it to open on the second screen regardless of the currently focused screen.

In darcs xmonad-contrib there is a module XMonad.Actions.OnScreen. It looks like this ManageHook using that module should do the right thing for your mplayer (if the other screen is actually number 1):

toScreen1 :: ManageHook
toScreen1 = doF (onScreen 1  FocusNew (liftM2 (.) W.greedyView W.shift))

If you run 0.9.2, it might just work to copy http://code.haskell.org/XMonadContrib/X … nScreen.hs  to ~/.xmonad/lib/XMonad/Actions/OnScreen.hs, then import it as usual.

Offline

#471 2011-06-13 09:09:25

ratzfatz
Member
From: KL, Germany
Registered: 2011-06-03
Posts: 30

Re: xmonad Hacking Thread

thayer wrote:
ratzfatz wrote:
thayer wrote:

Hello,

me again wink Can you give me several instructions to install your bar? It's brilliant!!! Never worked with concky or dzen before.

Thanks

Most of the details are in the config files at: github.com/thayerwilliams

You'll need to install: conky, xdotool, stalonetray and dzen2-xft-xpm-xinerama-svn (that last one is available from the AUR).

Take a look at my .xinitrc file in msi-dotfiles (my github repo) to see how I launch stuff; also, .stalonetrayrc has the systray preferences.  Dzen and conky are controlled by the xmonad.hs; all of that stuff is in the msi-xmonad repo.  Many of those files have comments in them to explain what they do.

Hallo,

thank you very much - it works now. Can I have your old configuration files?

greetings

Last edited by ratzfatz (2011-06-13 09:09:45)


The common language in modern science is broken english wink

Offline

#472 2011-06-15 14:46:29

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

Re: xmonad Hacking Thread

ratzfatz wrote:

Hallo,

thank you very much - it works now. Can I have your old configuration files?

greetings

Glad that worked out.  Feel free to take whatever configs are posted there.


thayer williams ~ cinderwick.ca

Offline

#473 2011-07-04 18:02:31

lswest
Member
From: Munich, Germany
Registered: 2008-06-14
Posts: 456
Website

Re: xmonad Hacking Thread

I'm in the process of moving over to XMonad from WMFS, and I have a few questions that I haven't been able to solve using Google.  They are:
1) Is it possible to name the workspaces using asian (japanese specifically) characters?  <XMonad fails to compile if I just insert the names into the file>[edit] Compiles fine now, must have been another error elsewhere [/edit].  On a related note: can xmobar use XFT fonts [edit] got it working [/edit]?
2) How can I get xmobar to display all the workspaces instead of just the ones with windows open?
3) My keybinding for launching urxvt doesn't seem to be working.  I assigned it to modm and return, but nothing happens when I press it.  All other keybindings work fine. [edit] Solved - I was assigning the same key combination twice [/edit]
4) How can I get stalonetray to be recognized by ManageDocks so that it's visible on all workspaces?
5) Is it possible to "mix" workspaces, like in DWM or WMFS, where you can select workspaces 1 and 3, for example?  (Not that big a deal, but I am curious)

Configs (feel free to let me know if I'm importing unnecessary stuff!):

import XMonad
import Data.Monoid
import System.Exit
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.DynamicLog
import XMonad.Actions.CycleWindows -- classic alt-tab
import XMonad.Actions.DwmPromote   -- swap master like dwm
import XMonad.Hooks.DynamicLog     -- statusbar 
import XMonad.Hooks.EwmhDesktops   -- fullscreenEventHook fixes chrome fullscreen
import XMonad.Hooks.ManageDocks    -- dock/tray mgmt
import XMonad.Hooks.UrgencyHook    -- window alert bells 
import XMonad.Layout.NoBorders     -- smart borders on solo clients
import XMonad.Util.EZConfig        -- append key/mouse bindings
import XMonad.Util.Run(spawnPipe)  -- spawnPipe and hPutStrLn
import System.IO 
 
import qualified XMonad.StackSet as W
import qualified Data.Map        as M
 
-- The main function.
main :: IO ()
main = xmonad =<< statusBar myBar myPP toggleStrutsKey conf
    where
        uhook = withUrgencyHookC NoUrgencyHook urgentConfig
        -- Command to launch the bar.
        myBar = "xmobar"
        
        -- Custom PP, configure it as you like. It determines what's being written to the bar.
        myPP = xmobarPP { ppCurrent = xmobarColor "#0c0c0c" "" . wrap "<" ">" }
        
        -- Keybinding to toggle the gap for the bar.
        toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)

        conf = uhook myConfig
        
myConfig = defaultConfig { terminal = myTerminal
                          , focusFollowsMouse  = myFocusFollowsMouse
                          , borderWidth        = myBorderWidth
                          , modMask            = myModMask
                          , workspaces         = myWorkspaces
                          , normalBorderColor  = myNormalBorderColor
                          , focusedBorderColor = myFocusedBorderColor
                        
                          --key bindings
                          , keys               = myKeys
                          , mouseBindings      = myMouseBindings
                        
                          --hooks, layouts
                          , layoutHook         = myLayout
                          , manageHook         = myManageHook
                        
                        }


urgentConfig = UrgencyConfig { suppressWhen = Focused, remindWhen = Dont } 
-- yes, these are functions; just very simple ones
-- that accept no input and return static values
myTerminal    = "urxvt"
myModMask     = mod4Mask -- Win key or Super_L
myBorderWidth = 1
-- Whether focus follows the mouse pointer.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
-- 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    = ["命令","文書","話","ウェブ","日本語","六","七","八","音楽"]
myWorkspaces    = ["1","2","3","4","5","6","7","8","9"]
 
-- Border colors for unfocused and focused windows, respectively.
--
myNormalBorderColor  = "#000000"
myFocusedBorderColor = "#0c0c0c"
myLayout = avoidStruts $ smartBorders ( tiled ||| mtiled ||| full )
  where
    full    =  Full
    mtiled  =  Mirror tiled
    tiled   =  Tall 1 (5/100) (2/(1+(toRational(sqrt(5)::Double))))
myManageHook = composeAll
    [ className =? "MPlayer"        --> doFloat
    , className =? "Gimp"           --> doFloat
    , className =? "skype"          --> doFloat
    , className =? "Pidgin"         --> doFloat
    , className =? "Pidgin"         --> doFloat
    , resource  =? "desktop_window" --> doIgnore
    , resource  =? "kdesktop"       --> doIgnore 
    , manageDocks
    ]
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
 
    -- mod-button1, Set the window to floating mode and move by dragging
    [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
                                       >> windows W.shiftMaster))
 
    -- mod-button2, Raise the window to the top of the stack
    , ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
 
    -- mod-button3, Set the window to floating mode and resize by dragging
    , ((modm, button3), (\w -> focus w >> mouseResizeWindow w
                                       >> windows W.shiftMaster))
 
    -- you may also bind events to the mouse scroll wheel (button4 and button5)
    ]
-- Key bindings. Add, modify or remove key bindings here.
--
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
 
    -- launch a terminal
    [ ((modm, xK_Return), spawn  "urxvt")
 
    -- launch dmenu
    , ((modm,               xK_p     ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
 
    -- launch gmrun
    , ((modm .|. shiftMask, xK_p     ), spawn "gmrun")
 
    -- close focused window
    , ((modm .|. shiftMask, xK_c     ), kill)
 
     -- Rotate through the available layout algorithms
    , ((modm,               xK_space ), sendMessage NextLayout)
 
    --  Reset the layouts on the current workspace to default
    , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
 
    -- Resize viewed windows to the correct size
    , ((modm,               xK_n     ), refresh)
 
    -- Move focus to the next window
    , ((modm,               xK_Tab   ), windows W.focusDown)
 
    -- Move focus to the next window
    , ((modm,               xK_j     ), windows W.focusDown)
 
    -- Move focus to the previous window
    , ((modm,               xK_k     ), windows W.focusUp  )
 
    -- Move focus to the master window
    , ((modm,               xK_m     ), windows W.focusMaster  )
 
    -- Swap the focused window and the master window
    , ((modm,               xK_Return), windows W.swapMaster)
 
    -- Swap the focused window with the next window
    , ((modm .|. shiftMask, xK_j     ), windows W.swapDown  )
 
    -- Swap the focused window with the previous window
    , ((modm .|. shiftMask, xK_k     ), windows W.swapUp    )
 
    -- Shrink the master area
    , ((modm,               xK_h     ), sendMessage Shrink)
 
    -- Expand the master area
    , ((modm,               xK_l     ), sendMessage Expand)
 
    -- Push window back into tiling
    , ((modm,               xK_t     ), withFocused $ windows . W.sink)
 
    -- Increment the number of windows in the master area
    , ((modm              , xK_comma ), sendMessage (IncMasterN 1))
 
    -- Deincrement the number of windows in the master area
    , ((modm              , xK_period), sendMessage (IncMasterN (-1)))
 
    -- Toggle the status bar gap
    -- Use this binding with avoidStruts from Hooks.ManageDocks.
    -- See also the statusBar function from Hooks.DynamicLog.
    --
    -- , ((modm              , xK_b     ), sendMessage ToggleStruts)
 
    -- Quit xmonad
    , ((modm .|. shiftMask, xK_q     ), io (exitWith ExitSuccess))
 
    -- Restart xmonad
    , ((modm              , xK_q     ), spawn "xmonad --recompile; xmonad --restart")
    --From: /usr/include/X11/XF86keysym.h
    --XF86AudioMute
    , ((0 , 0x1008FF12), spawn "dvol -t")
    --XF86AudioLowerVolume
    , ((0 , 0x1008FF11), spawn "dvol -d 5")
    --XF86AudioRaiseVolume
    , ((0 , 0x1008FF13), spawn "dvol -i 5")
    --XF86AudioPlay
    , ((0 , 0x1008FF14), spawn "ncmpcpp toggle")
    --XF86AudioStop
    , ((0 , 0x1008FF15), spawn "ncmpcpp stop")
    --XF86AudioNext
    , ((0 , 0x1008FF17), spawn "ncmpcpp next")
    --XF86AudioPrev
    , ((0 , 0x1008FF16), spawn "ncmpcpp prev")
    --XF86Launch1 :1008FF41
    , ((0 , 0x1008FF41), windows $ W.greedyView "1")
    --XF86Launch2 :1008FF42
    , ((0 , 0x1008FF42), windows $ W.greedyView "2")
    --XF86Launch3 :1008FF43
    , ((0 , 0x1008FF43), windows $ W.greedyView "3")
    --XF86Launch4 :1008FF44
    , ((0 , 0x1008FF44), windows $ W.greedyView "4")
    --XF86Launch5 :1008FF45
    , ((0 , 0x1008FF45), windows $ W.greedyView "5")
    --XF86Launch6 :1008FF46
    , ((0 , 0x1008FF46), windows $ W.greedyView "6")
    ]
    ++
 
    --
    -- mod-[1..9], Switch to workspace N
    --
    -- mod-[1..9], Switch to workspace N
    -- mod-shift-[1..9], Move client to workspace N
    --
    [((m .|. modm, 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 .|. modm, 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)]]

.xmobarrc

Config { font = "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*"
       , bgColor = "#0c0c0c"
       , fgColor = "#ffffff"
       , position = TopW L 100 
       , lowerOnStart = False 
       , commands = [ Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
                    , Run Memory ["-t","Mem: <usedratio>%"] 10
                    , Run Date "%a %b %_d %k:%M" "date" 10
                    , Run StdinReader
                    ]   
       , sepChar = "%" 
       , alignSep = "}{"
       , template = "%StdinReader% }{ %cpu% | %memory% <fc=#ee9a00>%date%</fc>"
       }

Last edited by lswest (2011-07-06 18:17:03)


Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds

Offline

#474 2011-07-06 00:05:39

hobonix
Member
From: Seattle
Registered: 2009-02-17
Posts: 31

Re: xmonad Hacking Thread

lswest wrote:

I'm in the process of moving over to XMonad from WMFS, and I have a few questions that I haven't been able to solve using Google.  They are:
1) Is it possible to name the workspaces using asian (japanese specifically) characters?  XMonad fails to compile if I just insert the names into the file.  On a related note: can xmobar use XFT fonts?

I can say that xft fonts do work. I have this in my xmbarrc:

Config { font = "xft:Georgia:Bold:pixelsize=13" }

So, I have a question about float.

I have this

myManageHook = composeAll . concat $
                [ [ className =? c --> doFloat | c <- floats]
                , [ resource =? r --> doIgnore | r <- ignore]]
 where floats = ["gnome-mplayer", "Gimp"]
       ignore = ["trayer"]

Gimp is definitely floating but gnome-mplayer doesn't. What am I doing wrong?

Last edited by hobonix (2011-07-06 00:24:34)


I think Lisp is funny, double semi-colons and unmatched parentheses crack me up.

Offline

#475 2011-07-06 09:43:28

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: xmonad Hacking Thread

hobonix:

The window id of gnome-player is:

xwininfo: Window id: 0x320001f "GNOME MPlayer"

So you should enter "GNOME MPlayer" in your floats array.

Use xwininfo to get window ids.

Offline

Board footer

Powered by FluxBB