Difference between revisions of "Dzen"

From ArchWiki
Jump to: navigation, search
m (Enabling Xft support for dzen: spelling)
m (Dzen & Conky)
Line 40: Line 40:
  
 
== Dzen & Conky ==
 
== Dzen & Conky ==
Conky can be used to pipe information directly to dzen for output in a statusbar.   
+
[[Conky]] can be used to pipe information directly to dzen for output in a statusbar.   
 
This can be done with Conky in the Extra repository and also with [http://aur.archlinux.org/packages.php?do_Details=1&ID=11884&O=0&L=0&C=0&K=conky-cli&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd conky-cli], a stripped-down version of the Conky status utility from [[AUR | AUR]] . <br>
 
This can be done with Conky in the Extra repository and also with [http://aur.archlinux.org/packages.php?do_Details=1&ID=11884&O=0&L=0&C=0&K=conky-cli&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd conky-cli], a stripped-down version of the Conky status utility from [[AUR | AUR]] . <br>
 
The following example displays the the loadavg values in red and the current time in the default dzen foreground colour:
 
The following example displays the the loadavg values in red and the current time in the default dzen foreground colour:

Revision as of 18:32, 19 May 2011

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Dzen#)
Template:I18n links start

Template:I18n entry Template:I18n links end

Introduction

From the dzen website:

"Dzen is a general purpose messaging, notification and menuing program for X11. It was designed to be scriptable in any language and integrate well with window managers like dwm, wmii and xmonad though it will work with any window manager."

See also the Arch Linux forum thread.

Installation

dzen is available from the community repository:

# pacman -S dzen2

And also in the AUR, you can find dzen2-xft-xpm-xinerama-svn 267-2.
This version has all the bells & whistles enabled in the PKGBUILD. With Xft and XPM support you can use nice fonts and xpm images in your bar.

Tips & Tricks

Using custom fonts with Dzen

If you wish to use custom fonts with dzen2 (like the popular Terminus font), you need to add the path to your local fonts folder in xorg.conf.

Section "Files"
     ...
     FontPath     "/usr/share/fonts/local"
     ...
EndSection

If you do not have permission or do not want to change xorg.conf, you may add this to ~/.xinitrc:

xset +fp /usr/share/fonts/local
xset fp rehash

Dzen & Conky

Conky can be used to pipe information directly to dzen for output in a statusbar. This can be done with Conky in the Extra repository and also with conky-cli, a stripped-down version of the Conky status utility from AUR .
The following example displays the the loadavg values in red and the current time in the default dzen foreground colour:

~/.conkyrc:

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

TEXT
^fg(\#ff0000)${loadavg 1 2 3} ^fg()${time %a %b %d %I:%M%P}


~/bin/dzconky:

#!/bin/sh

FG='#aaaaaa'
BG='#1a1a1a'
FONT='-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*'
conky | dzen2 -e - -h '16' -w '600' -ta r -fg $FG -bg $BG -fn $FONT

Simply execute dzconky in your startup scripts.

Enabling Xft support for dzen

Note: You need to install libxft package.

As of revision 241 (development), dzen2 has optional support for Xft. To enable Xft, you should build dzen2 with these options: (edit Template:Filename)

## Option: With Xinerama and XPM and XFT
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lXinerama -lXpm `pkg-config --libs xft`
CFLAGS = -Wall -Os ${INCS} -DVERSION=\"${VERSION}\" -DDZEN_XINERAMA -DDZEN_XPM -DDZEN_XFT `pkg-config --cflags xft`

To check libxft support, you can use this command:

  echo "hello world" | dzen2 -fn 'Times New Roman' -p