You are not logged in.

#1 2009-06-20 19:48:13

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Can't adjust trayer height in xmonad

I have been following this guide: http://haskell.cs.yale.edu/haskellwiki/ … figuration to get my xmonad setup working, and I've got xmobar pretty much how I like it. Now all I have to do to complete my status bar is add trayer the system tray, but I can't seem to adjust the height to match xmobar's. I'm not sure the exact height of xmobar, but I'm guessing it's about 8 pixels. Trayer seems to be sticking out one or two pixels, no matter how much I change the height option.

I'm starting trayer by putting this in my ~/.xinitrc:

trayer --edge top --align right --SetDockType true --SetPartialStrut true \
 --expand true --widthtype percent --width 10 --transparent true --alpha 0  --tint 0x1c1d1f --heighttype pixel --height 6 &

I've got the color right, now it's just the height I need to fix.

Here's a screenshot of the problem. It looks very slight but bothers me when windows won't cover that little bit. It also just doesn't look right.
trayerheightproblem.png?t=1245527253

Last edited by Allamgir (2009-06-20 19:48:34)


дɭɭɑӎɠїɾ

Offline

#2 2009-06-20 23:33:01

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Can't adjust trayer height in xmonad

Maybe trayer can't be smaller than 8 pixels ? That's really tiny, you do know that trayer is supposed to store icons ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#3 2009-06-21 00:01:27

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Can't adjust trayer height in xmonad

That's what I was thinking. Right now I'm planning on setting up some sort of status bar arrangement that gives me all the information I need without the need for a system tray at all. All I really need is volume, network (wicd) status, and perhaps if possible I could dabble with setting up mail and some other stuff. Right now, I am using xmobar, and to my knowledge xmobar unfortunately cannot support all this (or can it?). I'm thinking of hopping on the dzen train but all the documentation is so scattered and it looks really hard. Is there a complete, well written guide to setting up and configuring dzen2 in xmonad?


дɭɭɑӎɠїɾ

Offline

#4 2009-06-21 00:32:27

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Can't adjust trayer height in xmonad

dzen2 can't really display that information on it's own. It's a "multipurpose messaging, notification and menu program", meaning it needs to get information from somewhere, then it just displays it.

In the case of Xmonad, you can pipe workspace and window info to it, and you can setup your fonts and colors. To display what you would want, you can use conky - either on it's own, or just tell it to print to stdout and pipe that to a dzen2 instance (which is the way I'm using it right now).

Here, I can give you my relevant xmonad.hs parts:

.
. [unrelevant parts of config]
.

myLogHook h = dynamicLogWithPP $ defaultPP {
              ppCurrent  = dzenColor "#ff0000" "#000000" . pad
            , ppVisible  = dzenColor "#ffffff" "#000000" . pad
            , ppHidden   = dzenColor "#ffffff" "#000000" . pad
            , ppHiddenNoWindows = dzenColor "#666666"  "#000000" . pad
            --, ppUrgent   = dzenColor "#ff0000" "#222222"
            , ppUrgent   = wrap ("") (dzenColor "#ff0000" "" "<")
            , ppSep     = " " 
            , ppWsSep    = ""
        , ppLayout   = \x -> case x of
                                        "Tall" -> "[]="
                                        "Mirror Tall" -> "TTT"
                                        "SimplestFloat" -> "><>"
                                        "Full" -> "[F]"
                                        _ -> "?"
            , ppOutput   = hPutStrLn h
            }

myStatusBar = "dzen2 -p -ta l -fn '-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*' -x 0 -y 0 -w 730 -h 18 -fg '#ffffff' -bg '#000000' -e 'onexit=ungrabmouse'"

.
. [unrelevant parts of config]
.

main = do
       din <- spawnPipe myStatusBar
       xmonad $ withUrgencyHook NoUrgencyHook
                 $ defaultConfig {

     -- simple stuff
        terminal           = myTerminal,
        focusFollowsMouse  = myFocusFollowsMouse,
        borderWidth        = myBorderWidth,
        modMask            = myModMask,
        numlockMask        = myNumlockMask,
        workspaces         = myWorkspaces,
        normalBorderColor  = myNormalBorderColor,
        focusedBorderColor = myFocusedBorderColor,

     -- key bindings
        keys               = myKeys,
        mouseBindings      = myMouseBindings,

      -- hooks, layouts
    layoutHook         = myLayout,
        manageHook         = myManageHook,
        logHook            = myLogHook din,
        startupHook        = myStartupHook
      }

This is what my conky config looks like for xmonad:

background no
out_to_console yes
out_to_x no
update_interval 2
total_run_times 0
use_spacer none

TEXT
^fg()cpu ^fg(red)$cpu% ^fg()mem ^fg(red)$memperc% ^fg()bat ^fg(red)${battery_percent BAT1}% ^fg()${time %d.%b %H:%M}

And I start Xmonad with this script:

#!/bin/bash

# Start D-BUS session
dbus-launch --sh-syntax --exit-with-session &

# Start CK session
ck-launch-session &

# Custom X settings

xsetroot -cursor_name left_ptr &
xset dmps 300 600 900 &
xset r rate 250 25 &
setxkbmap -option ctrl:nocaps &

# Restore Wallpaper
#nitrogen --restore # nitrogen
eval $(sed -r 's/feh (--bg-[[:graph:]]+) (.*)/feh \1 "\2"/' ~/.fehbg) # feh

# Keybindings
#(sleep 1 && xbindkeys) &

# Music
#(sleep 1 && mocp -S) &
(sleep 1 && mpd) &

# Other
(sleep 1 && conky -c ~/.xmonad/conkyrc-xmonad | dzen2 -p -ta r -fn '-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*' -x 970 -y 0 -w 310 -h 18 -fg '#ffffff' -bg '#000000' -e 'onexit=ungrabmouse') &
(sleep 1 && trayer --edge top --align right  --widthtype pixel --width 250 --heighttype pixel --height 18 --SetDockType true --SetPartialStrut true --transparent true --alpha 1 --tint 0x000000 --distance 0 --margin 310) &
#(sleep 2 && thunar --daemon) &
(sleep 10 && gnome-screensaver) &
export OOO_FORCE_DESKTOP="gnome"

# Window Manager
xmonad

Last edited by moljac024 (2009-06-21 00:36:21)


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#5 2009-06-21 00:40:24

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Can't adjust trayer height in xmonad

Thanks so much! Right now I'm stuck at where to start with dzen2. What do I start with? How do I change my xmonad.hs? GAH!!!!!


Anyway, I think the first thing I need to know is what all this stuff means:

dzen2 -p -ta l -fn '-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*' -x 0 -y 0 -w 730 -h 18 -fg '#ffffff' -bg '#000000' -e 'onexit=ungrabmouse

I know it's fonts and colors and stuff, but what exactly is each part? Is there a guide somewhere that tells that? Also, I don't know how to use X geometry. All I would like is for it to be left aligned, taking up the whole space on the top of the screen, and maybe 16 or 18 pixels high (as long as I know how to change that later).


Then I don't know how to get xmonad to allow space for it, but I'll just look at your config files for that kind of stuff and ask questions if I need to.


дɭɭɑӎɠїɾ

Offline

#6 2009-06-21 00:46:51

SamC
Member
From: Calgary
Registered: 2008-05-13
Posts: 611
Website

Re: Can't adjust trayer height in xmonad

Have you looked at the dzen2 wiki? For example, this will answer the questions in your latest post.

Offline

#7 2009-06-21 01:15:24

Redrazor39
Member
Registered: 2008-12-23
Posts: 108

Re: Can't adjust trayer height in xmonad

Answered

Last edited by Redrazor39 (2009-06-21 01:16:05)

Offline

#8 2009-06-21 01:19:07

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Can't adjust trayer height in xmonad

thanks for the link! I looked at that site but the dzen and xmonad page had me confused. I guess I'll scour that site a little (lot) more. I'll post with more questions if/when I have them.


дɭɭɑӎɠїɾ

Offline

#9 2009-06-21 22:42:13

Allamgir
Member
Registered: 2009-06-11
Posts: 168

Re: Can't adjust trayer height in xmonad

Alright well I got a blank dzen2 to start up at the top taking all the space like I want, but I'm having some trouble when I set it up in my xmonad.hs.

Here's what I have so far:

import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
import XMonad.Actions.FindEmptyWorkspace
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO


myTerminal ="terminal"
myNormalBorderColor  = "#000000"
myFocusedBorderColor = "#dddddd"
myManageHook = composeAll
    [ className =? "gimp"      --> doFloat] 
myStatusBar = "dzen2 -bg #1c1d1f -fg #ffffff -fn -*-terminus-*-r-normal-*-8-120-*-*-*-*-iso8859-* -x 0 -y 0 -w 1280"

main = do
    statusBarPipe  <- spawnPipe myStatusBar
    xmonad $ withUrgencyHook NoUrgencyHook $defaultConfig {
        manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
    , terminal = myTerminal
    , normalBorderColor = myNormalBorderColor
    , focusedBorderColor = myFocusedBorderColor
        , layoutHook = avoidStruts  $  layoutHook defaultConfig 
        , logHook = dynamicLogWithPP $ myPP statusBarPipe 
        } `additionalKeys`
        [ ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
        , ((0, xK_Print), spawn "scrot")
        , ((mod1Mask .|. shiftMask, xK_Return), spawn "terminal")
        , ((mod1Mask, xK_p), spawn "gmrun")
    , ((mod1Mask, xK_e), viewEmptyWorkspace)
    , ((mod1Mask .|. shiftMask, xK_e), tagToEmptyWorkspace)
        ]

myPP h = defaultPP

I keep on getting the error "The last statement in a 'do' construct must be an expression" at 34:8 (right after "main = do"). I found a thread where you were having the same problem (http://bbs.archlinux.org/viewtopic.php?id=55673)and followed your solution by adding "ppOutput   = hPutStrLn h", but that did nothing. I just went all out and copied what you had for myLogHook, but still no luck. What should I do?

EDIT: alright after looking at some sample configs I finally got dzen to start when I mod-q, but as soon as I change workspaces dzen is gone! I don't know what this could be. Am I missing something? Btw, I updated the xmonad.hs above so it's my current one now.

Last edited by Allamgir (2009-06-21 23:14:08)


дɭɭɑӎɠїɾ

Offline

Board footer

Powered by FluxBB