Dzen is a general purpose messaging, notification and menuing program for X11.
Dzen is a general purpose messaging, notification and menuing program for X11.
Dzen is a general purpose messaging, notification and menuing program for X11. It was designed to be fast, tiny and scriptable in any language.
* Small, fast, very tiny set of dependencies (Xlib only by default)
* Scriptable in any language
* Sophisticated formating language - including colours, icons, graphics
* Versatile - display all sorts of information
* Interactive - user defined mouse and keyboard actions
* Optional XFT support
* Optional XINERAMA supportIn order to build dzen you need the Xlib header files.
Edit config.mk to match your local setup (dzen is installed into the /usr/local namespace by default).
Afterwards enter the following command to build and install dzen (if necessary as root):
make clean installOptionally if you want to use dzen's gadgets:
cd gadgets
make clean installNote: By default dzen will not be compiled with Xinerama and XPM support. Uncomment the respective lines in config.mk to change this.
Feature requests, patches or anything else related to dzen can be send to: rob dot manea at gmail dot com
dzen accepts a couple of options:
-fg foreground color
-bg background color
-fn font
-ta alignement of title window content
l(eft), c(center), r(ight)
-tw title window width
-sa alignment of slave window, see "-ta"
-l lines, see (1)
-e events and actions, see (2)
-m menu mode, see (3)
-u update contents of title and
slave window simultaneously, see (4)
-p persist EOF (optional timeout in seconds)
-x x position
-y y position
-h line height (default: fontheight + 2 pixels)
-w width
-xs number of Xinerama screen
-v version information
see (5) for the in-text formating language.Dzen is able to read font and color setting from X resources. As an example you can add following lines to ~/.Xresources
dzen2.font: --fixed------------* dzen2.foreground: #22EE11 dzen2.background: black
Dzen's window layout is as follows:
------------------------------------------
| Title window, single line |
`------------------------------------------´
| |
| scrollable |
| Slave window |
| multiple lines |
| lines to display simultaneously |
| controlled with the |
| '-l' option |
| |
| |
`------------------------------------------´The first line you provide to dzen always goes to the title window, all other consecutive lines will be drawn to the slave window unless you explicitly overide this with the (5) In-text formating language command ^tw().
Q1: I don't want a slave window, what to do?
A1: Do not provide the '-l' option, all lines will be displayed in the title window, this is the default behaviour.
Q2: I used the '-l' option but no slave window appears.
A2: With the default event/action handling the slave window will only be displayed if you hoover with the mouse over the title window. See "(2) Events and actions" if you'd like to change this.
Q3: If I echo some text or cat a file dzen closes itself imediatelly.
A3: There are 2 different approaches dzen uses to terminate itself, see next section "Termination".
Q4: Ok, the title and slave thing works, can I update the contents of both windows at the same time?
A4: Sure, see "(4) Simultaneous updates" or use the in-text command "^tw()" to explicitly draw to the title windwow. See section (5) for further details
Q5: Can i chnage color of my input at runtime?
A5: Yes, you can change both background and foreground colors and much more See "(5) In-Text formating language"
Q6: Can I use dzen as a menu?
A6: Yes, both vertical and horizontal menus are supported. See "(3) Menu" for further details.
dzen uses two different approaches to terminate itself:
* Timed termination: if EOF is received -> terminate
- unless the '-p' option is set
· '-p' without argument persist forever
· '-p' with argument n persist for n seconds
* Interactive termination: if mouse button3 is clicked -> terminate
- this is the default behaviour, see (2)
- in some modes the Escape key terminates too, see (2)0 - dzen received EOF 1 - some error occured, inspect the error message user defined - set with 'exit:retval' action, see (2)
Enables support for displaying multiple lines. The parameter to "-l" specifies the number of lines to be displayed.
These lines of input are held in the slave window which becomes active as soon as the pointer enters the title (default action) window.
If the mouse leaves the slave window it will be hidden unless it is set sticky by clicking with Button2 into it (default action).
Button4 and Button5 (mouse wheel) will scroll the slave window up and down if the content exceeds the window height (default action).
dzen allows the user to associate actions to events.
The command line syntax is as follows: -e 'event1=action1:option1:...option,...,action;...;event'
Every event can take any number of actions and every action can take any number of options. (By default limited to 64 each, easily changable in action.h)
An example: -e 'button1=exec:xterm:firefox;entertitle=uncollapse,unhide;button3=exit'
Meaning:
button1=exec:xterm:firefox;
on Button1 event (Button1 press on the mouse) execute xterm and
firefox.
Note: xterm and firefox are options to the exec action
entertitle=uncollapse,unhide;
on entertitle (mouse pointer enters the title window) uncollapse
slave window and unhide the title window
button3=exit
on button3 event exit dzenonstart Perform actions right after startup
onexit Perform actions just before exiting
onnewinput Perform actions if there is new input for the slave window
button1 Mouse button1 released
button2 Mouse button2 released
button3 Mouse button3 released
button4 Mouse button4 released (usually scrollwheel)
button5 Mouse button5 released (usually scrollwheel)
button6 Mouse button6 released
button7 Mouse button7 released
entertitle Mouse enters the title window
leavetitle Mouse leaves the title window
enterslave Mouse enters the slave window
leaveslave Mouse leaves the slave window
sigusr1 SIGUSR1 received
sigusr2 SIGUSR2 received
key_KEYNAME Keyboard events (*)
(*) Keyboard events:
--------------------
Every key can be bound to an action (see below). The format is:
key_KEYNAME where KEYNAME is the name of the key as defined in
keysymdef.h (usually: /usr/include/X11/keysymdef.h). The part
after 'XK_' in keysymdef.h must be used for KEYNAME.exec:command1:..:n execute all given options
menuexec executes selected menu entry
exit:retval exit dzen and return 'retval'
print:str1:...:n write all given options to STDOUT
menuprint write selected menu entry to STDOUT
collapse collapse (roll-up) slave window
uncollapse uncollapse (roll-down) slave window
togglecollapse toggle collapsed state
stick stick slave window
unstick unstick slave window
togglestick toggle sticky state
hide hide title window
unhide unhide title window
togglehide toggle hide state
raise raise window to view (above all others)
lower lower window (behind all others)
scrollhome show head of input
scrollend show tail of input
scrollup:n scroll slave window n lines up (default n=1)
scrolldown:n scroll slave window n lines down (default n=1)
grabkeys enable keyboard support
ungrabkeys disable keyboard support
grabmouse enable mouse support
only needed with specific windowmanagers, such as fluxbox
ungrabmouse release mouse
only needed with specific windowmanagers, such as fluxboxNote: If no events/actions are specified dzen defaults to:
Title only mode:
----------------
-e 'button3=exit:13'
Multiple lines and vertical menu mode:
--------------------------------------
-e 'entertitle=uncollapse,grabkeys;
enterslave=grabkeys;leaveslave=collapse,ungrabkeys;
button1=menuexec;button2=togglestick;button3=exit:13;
button4=scrollup;button5=scrolldown;
key_Escape=ungrabkeys,exit'
Horizontal menu mode:
---------------------
-e 'enterslave=grabkeys;leaveslave=ungrabkeys;
button4=scrollup;button5=scrolldown;
key_Left=scrollup;key_Right=scrolldown;
button1=menuexec;button3=exit:13
key_Escape=ungrabkeys,exit'
If you define any events/actions, there is no default behaviour,
i.e. you will have to specify _all_ events/actions you want to
use.Dzen provides two menu modes, vertical and horizontal menus. You can access these modes by adding 'v'(ertical) or 'h'(horizontal) to the '-m' option. If nothing is specified dzen defaults to vertical menus.
Vertical menu, both invocations are equivalent: dzen2 -p -l 4 -m ' is specified!
Horizontal menus have no title window, so all actions
affecting the title window will be silently discarded
in this mode.** DEPRECATED **
This option provides facilities to update the title and slave window at the same time.
The way it works is best described by an example:
Motivation:
We want to display an updating clock in the title and some log output in the slave window.
Solution:
while true; do date # output goes to the title window dmesg | tail -n 10 # output goes to the slave window sleep 1 done | dzen2 -l 10 -u
For this to work correctly it is essential to provide exactly the number of lines to the slave window as defined by the parameter to '-l'.
This feature allows to dynamically (at runtime) format the text dzen displays and control its behaviour.
Currently the following commands are supported:
Note: Doubling the '^' character ('^^') will remove the special meaning from it.
^fg(color) set foreground color
^fg() without arguments, sets default fg color
^bg(color) set background color
^bg() without arguments, sets default bg colorNo open issues yet, or sync has not completed.