You are not logged in.

#1 2011-09-17 05:30:21

daedalus
Member
From: Mountain View
Registered: 2007-09-28
Posts: 50
Website

Fuzzy / Blurred fonts in Dzen2 - not interpreting commands.

Hey all -

I'm trying to get Dzen2 setup with XMonad, and am having some trouble.  Take a look at the screenshot, and you will notice two things:

1) All of the fonts in my dzen instance are fuzzy.
2) It isn't actually interpreting commands... it is just printing them.

201109162216421600x900s.png

I'm having trouble sorting out the problem.  Any help that anyone could provide would be wonderful.

My configs are based on Thayer's.  Here is my xmonad.hs,

--
-- File     : ~/.xmonad/xmonad.hs (for Xmonad >= 0.9)
-- Author   : Thayer Williams
-- Website  : http://cinderwick.ca/
-- Desc     : A mininal xmonad config geared towards
--            netbooks and other low-resolution devices.
--

import XMonad
import XMonad.Actions.CycleWindows -- classic alt-tab
import XMonad.Actions.CycleWS      -- cycle thru WS', toggle last WS
import XMonad.Actions.DwmPromote   -- swap master like dwm
import XMonad.Hooks.DynamicLog     -- statusbar 
import XMonad.Hooks.ManageDocks    -- dock/tray mgmt
import XMonad.Hooks.UrgencyHook    -- window alert bells 
import XMonad.Layout.Named         -- custom layout names
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                   -- hPutStrLn scope

import qualified XMonad.StackSet as W   -- manageHook rules

main = do
        status <- spawnPipe myDzenStatus    -- xmonad status on the left
        conky  <- spawnPipe myDzenConky     -- conky stats on the right
        xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig 
            { modMask            = mod4Mask
            , terminal           = "urxvtc"
            , borderWidth        = 2
            , normalBorderColor  = "#dddddd"
            , focusedBorderColor = "#0000ff"
            , workspaces = myWorkspaces
            , layoutHook = myLayoutHook
            , manageHook = manageDocks <+> myManageHook
                            <+> manageHook defaultConfig
            , logHook    = myLogHook status
            } 
            `additionalKeysP` myKeys
            `additionalMouseBindings` myButtons

-- Tags/Workspaces
-- clickable workspaces via dzen/xdotool
myWorkspaces            :: [String]
myWorkspaces            = clickable . (map dzenEscape) $ ["Bow","Port","Starboard","Stern"]
  where clickable l     = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
                            (i,ws) <- zip [1..] l,
                            let n = i ]


-- Layouts
-- the default layout is fullscreen with smartborders applied to all
myLayoutHook = avoidStruts $ smartBorders 
               ( full ||| mtiled ||| tiled )
  where
    full    = named "X" $ Full
    mtiled  = named "M" $ Mirror tiled
    tiled   = named "T" $ Tall 1 (5/100) (2/(1+(toRational(sqrt(5)::Double))))
    -- sets default tile as: Tall nmaster (delta) (golden ratio)

-- Window management
--
myManageHook = composeAll
    [ className =? "URxvt"                          --> unfloat
    , className =? "trayer"                         --> doIgnore
    , resource  =? "desktop_window"                 --> doIgnore
    , resource  =? "kdesktop"                       --> doIgnore ]
    <+> doFloat <+> manageDocks
    where unfloat = ask >>= doF . W.sink

-- Statusbar 
--
myLogHook h = dynamicLogWithPP $ myDzenPP { ppOutput = hPutStrLn h }

myDzenStatus = "dzen2 -x 0 -y 0 -w '320' -ta 'l'" ++ myDzenStyle
myDzenConky  = "conky -c ~/.xmonad/conkyrc | dzen2 -x '320' -w '550' -ta 'r'" ++ myDzenStyle
myDzenStyle  = " -h '16' -fg '#777777' -bg '#222222' -fn ''-*-terminus-*-*-*-*-11-*-*-*-*-*-*-u"

myDzenPP  = dzenPP
    { ppCurrent = dzenColor "#3399ff" "" . wrap " " " "
    , ppHidden  = dzenColor "#dddddd" "" . wrap " " " "
    , ppHiddenNoWindows = dzenColor "#777777" "" . wrap " " " "
    , ppUrgent  = dzenColor "#ff0000" "" . wrap " " " "
    , ppSep     = "     "
    , ppLayout  = dzenColor "#aaaaaa" "" . wrap "^ca(1,xdotool key super+space)· " " ·^ca()"
    , ppTitle   = dzenColor "#ffffff" "" 
                    . wrap "^ca(1,xdotool key super+k)^ca(2,xdotool key super+shift+c)"
                           "                          ^ca()^ca()" . shorten 20 . dzenEscape
    }


-- Key bindings
--
myKeys = [ ("M-b"        , sendMessage ToggleStruts              ) -- toggle the status bar gap
         , ("M1-<Tab>"   , cycleRecentWindows [xK_Alt_L] xK_Tab xK_Tab ) -- classic alt-tab behaviour
         , ("M-<Return>" , dwmpromote                            ) -- swap the focused window and the master window
         , ("M-<Tab>"    , toggleWS                              ) -- toggle last workspace (super-tab)
         , ("M-<Right>"  , nextWS                                ) -- go to next workspace
         , ("M-<Left>"   , prevWS                                ) -- go to prev workspace
         , ("M-S-<Right>", shiftToNext                           ) -- move client to next workspace
         , ("M-S-<Left>" , shiftToPrev                           ) -- move client to prev workspace
         , ("M-p"       , spawn "exe=`dmenu_run | dmenu -nb '#3f3f3f' -sb '#dcdccc' -sf '#070806'` && eval \"exec $exe\"")
         , ("M-r"        , spawn "xmonad --restart"              ) -- restart xmonad w/o recompiling
         , ("M-w"        , spawn "chromium"                      ) -- launch browser
         , ("M-S-w"      , spawn "chromium --incognito"          ) -- launch private browser
         , ("M-e"        , spawn "nautilus"                      ) -- launch file manager
         , ("C-M1-l"     , spawn "gnome-screensaver-command --lock"              ) -- lock screen
         , ("C-M1-<Delete>" , spawn "sudo shutdown -r now"       ) -- reboot
         , ("C-M1-<Insert>" , spawn "sudo shutdown -h now"       ) -- poweroff
         ]

-- Mouse bindings
--
myButtons = [ ((0, 8), (\_ -> prevWS )) -- cycle workspaces 
            , ((0, 9), (\_ -> nextWS )) -- with thumb buttons 
            ]

My conkyrc:

# ~/.conkyrc
# Thayer Williams - http://cinderwick.ca
# vim:nu:ai:si:et:ts=4:sw=4:ft=conkyrc:

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

# temp, loadavg, cpu usage, cpu freq, battery, date

TEXT
^fg(\#999999)${hwmon temp 1}°^fg()  \
^fg(\#666666)${loadavg 1}^fg()  \
^fg(\#888888)${cpu cpu1}%^fg()   ^fg(\#aaaaaa)${freq_g 1}GHz^fg()   \
^fg(\#666666)${mem}^fg()   \
^fg(\#91b8ff)${if_existing /sys/class/power_supply/BAT0/present}${battery_short BAT0} (${battery_time BAT0})${else}AC${endif}^fg()   \
${if_empty ${exec ifconfig wlan0 | grep 'inet addr:'}}^fg(\#bbbbbb)eth0^fg()  ^fg(\#d94c3d)${upspeedf eth0}k^fg()  ^fg(\#a4bc51)${downspeedf eth0}k^fg()${else}\
^fg(\#bbbbbb)${wireless_link_qual_perc wlan0}%  ${wireless_essid wlan0}^fg()  ^fg(\#d94c3d)${upspeedf wlan0}k^fg()  ^fg(\#a4bc51)${downspeedf wlan0}k^fg()${endif}   \
^fg(\#ffffff)${time %b %d %H:%M}^fg()                     

Anyway, thanks for any help that anyone can provide.

Last edited by daedalus (2011-09-17 14:29:21)

Offline

#2 2011-09-17 06:38:17

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Fuzzy / Blurred fonts in Dzen2 - not interpreting commands.

Your uploaded image has a problem:

Image Details
Filename:    201109162216421600x900s.png
Size:    56Kb
Resolution:    150 x 84

I can't really make anything out at that resolution.

As for fuzzy fonts, which font are you trying to use?


I laugh, yet the joke is on me

Offline

#3 2011-09-17 14:30:53

daedalus
Member
From: Mountain View
Registered: 2007-09-28
Posts: 50
Website

Re: Fuzzy / Blurred fonts in Dzen2 - not interpreting commands.

the sad clown wrote:

Your uploaded image has a problem:

Image Details
Filename:    201109162216421600x900s.png
Size:    56Kb
Resolution:    150 x 84

I can't really make anything out at that resolution.

As for fuzzy fonts, which font are you trying to use?

Thanks for pointing out the mistake - I really appreciate it.  I fixed the image link in the first post.

I'm trying to use terminus, which I use in my terminals without an issue.  The exact style code for dzen is:

myDzenStyle  = " -h '16' -fg '#777777' -bg '#222222' -fn ''-*-terminus-*-*-*-*-11-*-*-*-*-*-*-u"

Another thing to note is that the fonts / lack of interpreted commands are the same way for all dzen2 instances - not just with these configs in particular. I experimented with nnoell's stuff, and saw the same thing.

Last edited by daedalus (2011-09-17 14:34:08)

Offline

#4 2011-09-17 16:04:16

daedalus
Member
From: Mountain View
Registered: 2007-09-28
Posts: 50
Website

Re: Fuzzy / Blurred fonts in Dzen2 - not interpreting commands.

Okay, I've fixed the fuzzy font issue.  I needed to list the font as:

'-*-terminus-*-r-normal-*-11-*-*-*-*-*-iso8859-*'"

I am still experiencing the issue where dzen isn't interpreting the commands, however, and is merely printing the command itself.

Any ideas?

Last edited by daedalus (2011-09-17 16:04:49)

Offline

#5 2011-09-17 17:03:57

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Fuzzy / Blurred fonts in Dzen2 - not interpreting commands.

I just tested your script.  It works perfectly fine.  That means your problem is not with either conky or dzen2.  I have never used Xmonad, but clearly something in your xmonad.hs is where your problem is.  Hopefully someone who knows that wm better than I can help you with it.

Last edited by the sad clown (2011-09-17 17:05:08)


I laugh, yet the joke is on me

Offline

#6 2011-09-18 18:32:09

daedalus
Member
From: Mountain View
Registered: 2007-09-28
Posts: 50
Website

Re: Fuzzy / Blurred fonts in Dzen2 - not interpreting commands.

the sad clown wrote:

I just tested your script.  It works perfectly fine.  That means your problem is not with either conky or dzen2.  I have never used Xmonad, but clearly something in your xmonad.hs is where your problem is.  Hopefully someone who knows that wm better than I can help you with it.

Thanks so much for testing it - I really appreciate it.

Yeah, right now my workspace bar, for example, says "^a(xdo ...)a() ..." instead of interpreting that as a command to make the workspace clickable.  It's the same way in my conky bar, where some of the values are supposed to be clickable.

If there is anyone who knows Xmonad and wants to take a look at it, I would be very appreciative smile

Offline

#7 2011-09-19 00:31:54

daedalus
Member
From: Mountain View
Registered: 2007-09-28
Posts: 50
Website

Re: Fuzzy / Blurred fonts in Dzen2 - not interpreting commands.

Okay, so here is a cropped picture of what the dzen bars look like:

20110918172415972x139sc.th.png

You can see where for some of them, it prints correctly on the top bar, and for some you can still see the 'a^' function wrapper, which is actually supposed to be '^ca', but for whatever reason just fails.  In the second bar, which I placed in the middle of the screen just for debugging, you can see how totally hosed it is.

Here is my xmonad.hs:

--
-- File     : ~/.xmonad/xmonad.hs (for Xmonad >= 0.9)
-- Author   : Thayer Williams
-- Website  : http://cinderwick.ca/
-- Desc     : A mininal xmonad config geared towards
--            netbooks and other low-resolution devices.
--

import XMonad
import XMonad.Actions.CycleWindows -- classic alt-tab
import XMonad.Actions.CycleWS      -- cycle thru WS', toggle last WS
import XMonad.Actions.DwmPromote   -- swap master like dwm
import XMonad.Hooks.DynamicLog     -- statusbar 
import XMonad.Hooks.ManageDocks    -- dock/tray mgmt
import XMonad.Hooks.UrgencyHook    -- window alert bells 
import XMonad.Layout.Named         -- custom layout names
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                   -- hPutStrLn scope
import System.Posix.IO
import System.Posix.Process (executeFile, forkProcess, createSession)

import qualified XMonad.StackSet as W   -- manageHook rules

main = do
        status <- spawnPipe myDzenStatus    -- xmonad status on the left
        conky  <- spawnPipe myDzenConky     -- conky stats on the right
        xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig 
            { modMask            = mod4Mask
            , terminal           = "urxvtc"
            , borderWidth        = 2
            , normalBorderColor  = "#dddddd"
            , focusedBorderColor = "#0000ff"
            , workspaces = myWorkspaces
            , layoutHook = myLayoutHook
            , manageHook = manageDocks <+> myManageHook
                            <+> manageHook defaultConfig
            , logHook    = myLogHook status
            } 
            `additionalKeysP` myKeys
            `additionalMouseBindings` myButtons

-- Tags/Workspaces
-- clickable workspaces via dzen/xdotool
myWorkspaces            :: [String]
myWorkspaces            = clickable . (map dzenEscape) $ ["Bow","Port","Starboard","Stern"]
  where clickable l     = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
                            (i,ws) <- zip [1..] l,
                            let n = i ]


-- Layouts
-- the default layout is fullscreen with smartborders applied to all
myLayoutHook = avoidStruts $ smartBorders ( full ||| mtiled ||| tiled )
  where
    full    = named "X" $ Full
    mtiled  = named "M" $ Mirror tiled
    tiled   = named "T" $ Tall 1 (5/100) (2/(1+(toRational(sqrt(5)::Double))))
    -- sets default tile as: Tall nmaster (delta) (golden ratio)

-- Window management
--
myManageHook = composeAll
    [ className =? "URxvt"                          --> unfloat
    , className =? "trayer"                         --> doIgnore
    , resource  =? "desktop_window"                 --> doIgnore
    , resource  =? "kdesktop"                       --> doIgnore ]
    <+> doFloat <+> manageDocks
    where unfloat = ask >>= doF . W.sink

-- Statusbar 
--
myLogHook handle = dynamicLogWithPP $ myDzenPP { ppOutput = hPutStrLn handle }

myDzenStatus = "dzen2 -x '0' -y '100' -w '320' -ta 'l'" ++ myDzenStyle
myDzenConky  = "conky -c ~/.xmonad/conkyrc | dzen2 -x '320' -w '600' -ta 'r'" ++ myDzenStyle
myDzenStyle  = " -h '16' -fg '#777777' -bg '#222222' -fn '-*-terminus-*-r-normal-*-*-*-*-*-*-*-iso8859-*'"

--myDzenPP h = dzenPP
myDzenPP = dzenPP
    { ppCurrent = dzenColor "#3399ff" "" . wrap " " " "
    , ppHidden  = dzenColor "#dddddd" "" . wrap " " " "
    , ppHiddenNoWindows = dzenColor "#777777" "" . wrap " " " "
    , ppUrgent  = dzenColor "#ff0000" "" . wrap " " " "
    , ppSep     = "     "
--    , ppLayout  = dzenColor "#aaaaaa" "" . wrap "^ca(1,xdotool key super+space)· " " ·^ca()"
--   , ppTitle   = dzenColor "#ffffff" "" 
--                  . wrap "^ca(1,xdotool key super+k)^ca(2,xdotool key super+shift+c)"
--                        "                          ^ca()^ca()" . shorten 20 . dzenEscape
    }


-- Key bindings
--
myKeys = [ ("M-b"        , sendMessage ToggleStruts              ) -- toggle the status bar gap
         , ("M1-<Tab>"   , cycleRecentWindows [xK_Alt_L] xK_Tab xK_Tab ) -- classic alt-tab behaviour
         , ("M-<Return>" , dwmpromote                            ) -- swap the focused window and the master window
         , ("M-<Tab>"    , toggleWS                              ) -- toggle last workspace (super-tab)
         , ("M-<Right>"  , nextWS                                ) -- go to next workspace
         , ("M-<Left>"   , prevWS                                ) -- go to prev workspace
         , ("M-S-<Right>", shiftToNext                           ) -- move client to next workspace
         , ("M-S-<Left>" , shiftToPrev                           ) -- move client to prev workspace
         , ("M-p"       , spawn "exe=`dmenu_run | dmenu -nb '#3f3f3f' -sb '#dcdccc' -sf '#070806'` && eval \"exec $exe\"")
         , ("M-r"        , spawn "xmonad --restart"              ) -- restart xmonad w/o recompiling
         , ("M-w"        , spawn "chromium"                      ) -- launch browser
         , ("M-S-w"      , spawn "chromium --incognito"          ) -- launch private browser
         , ("M-e"        , spawn "nautilus"                      ) -- launch file manager
         , ("C-M1-l"     , spawn "gnome-screensaver-command --lock"              ) -- lock screen
         , ("C-M1-<Delete>" , spawn "sudo shutdown -r now"       ) -- reboot
         , ("C-M1-<Insert>" , spawn "sudo shutdown -h now"       ) -- poweroff
         ]

-- Mouse bindings
--
myButtons = [ ((0, 8), (\_ -> prevWS )) -- cycle workspaces 
            , ((0, 9), (\_ -> nextWS )) -- with thumb buttons 
            ]

Please help!

Offline

#8 2011-09-20 19:11:10

gotmor
Member
From: Germany
Registered: 2007-09-03
Posts: 84
Website

Re: Fuzzy / Blurred fonts in Dzen2 - not interpreting commands.

Be sure to use dzen2 from SVN as 0.8.5 doesn't support ^ca().

Offline

Board footer

Powered by FluxBB