robm / dzen Goto Github PK
View Code? Open in Web Editor NEWDzen is a general purpose messaging, notification and menuing program for X11.
License: MIT License
Dzen is a general purpose messaging, notification and menuing program for X11.
License: MIT License
I'm using fluxbox WM and dzen 0.8.5.
I have a shell script that detects new windows opening on other workspaces than the current. What I want to do is optionally press enter and go to that workspace.
This is a snippet of the code I've been testing:
DIFF="2"
DZEN="dzen2 -x 0 -y $(($Y-25)) -w 70 -h 25 -l 1 -bg black -fg gray -e 'key_Return=exit:9'"
(echo "[ $DIFF ]"; sleep 15) | $DZEN
When the window pops up it doesn't have focus and pressing enter just goes to the terminal.
If I click the mouse on it and then press enter it doesn't change.
Hi,
This is my xmonad.hs whch calls dzen2 two times: https://pastebin.com/BDdbT0ZY
The right Bar works, the left Bar disappears after some seconds after login and if pressing keys for window layouts in xmonad. With the -p -e parameters, it does not vanish but does not show any content after all. I have no clue where the problem might be. OS is OpenBSD, xmonad 0.11.1, dzen2 0.9.5
Dzen2 used to stick to the screen even when apps were fullscreened. I liked to be able to do that because I have the temps and memory and such in a dzen2 bar at all times. Unless there's a way to make this happen that I'm unaware of?
After calling inline command ^hide(), one line on top of the window is kept visible. Is there way to get rid of this?
This is referencing the issue on google code reported earlier by someone else and seems to have been lost in the transition to github. I have this same problem.
I hope you can add it to the wiki.
I was looking at the menu option (i.e. -m
) control flow since it's the only option with an optional argument and noticed it doesn't process the option correctly when given a v
argument.
For example, the following example from the Examples section in the README returns the usage information rather than creating a vertical mode (using version 0.8.5-7):
dzen2 -p -l 4 -m v < file
dzen seems to align the content of the main window vertically. I would like the text to stick to the top edge of dzen, without any margin. In the following screenshot, you can see that there's a 1px gap between the text and the top edge of the screen.
This bar uses FONT='--terminus------70------' and a height of 12.
I can think of two reasonable ways this gap could be eliminated:
The reason why I would like this is because the physical screen I use has a gap from the top most line of pixels to the actual screen bezel. The gap at the top of dzen is unneccessary and actually throws off the visual alignment downwards. Even increasing the height of dzen doesn't help much since - visually/physically - the text will always sit too low compared to the physical screen bezel and the bottom edge of dzen.
Seeing the latest commit is from 2 years back, can I assume this project is dead? A shame, since now we have just Lemonbar left if I'm right.
Font switches on XFT build leak. I think I sent you a mail about this way back.
in draw.c before 155, add if(dzen.font.xftfont) XftFontClose(dzen.dpy, dzen.font.xftfont); to fix.
Consider this example:
dzen2 \
-fg black \
-w 300 \
-h 30 \
-l 3 \
-p \
-m \
-e 'onstart=uncollapse,grabkeys,scrollhome;button4=scrollup;key_k=scrollup;button5=scrolldown;key_j=scrolldown;key_Escape=ungrabkeys,exit;button1=ungrabkeys,menuprint,exit;key_Return=ungrabkeys,menuprint,exit' <<EOF
TITLE
aaa
bbb
ccc
ddd
eee
EOF
Which produces a menu named TITLE with three entries visible at a time that can be scrolled either with a mouse-like device, or with j
/k
(and then selected either with the left button or with Return
).
Now, if we hover a mouse over the menu, the entry below the mouse pointer will get highlighted. However, if we then start scrolling, the highlight will be gone, so it won't be possible to tell, which menu entry is currently selected (obviously, until we click on it).
Same if scrolling with keys, except no highlight will be present at all (and when pressing Return
, the first visible entry will be selected1).
So, am I missing some configuration here, or nothing can be done, and this is probably a bug? :)
Which also leads to another problematic side-effect: if in this example we scroll with keyboard, then the last entry we are able to select is ccc
, while entries ddd
and eee
are simply inaccessible. ↩
benalb@t410 ~
dzen2 -v
dzen-0.9.5-svn, (C)opyright 2007-2009 Robert Manea
Enabled optional features: XFT XINERAMA
crontab -l
0 */4 * * * export DISPLAY=:0 && echo "something something, something" | dzen2 -fg black -bg white -geometry 500x80 -p -e 'button1=exit'
While the same command in a terminal will work as expected, showing in the screen a white rectangle with the "something" text, and when clicked, disappears, when invoked by cron, it segfaults, thought it also shows the rectangle and respond to the click.
I managed to get a core dump and a backtrace with gdb:
https://pastebin.com/qLHk4d1W
It's not possible to use multiple fonts in dzen2 :-(
Should be able to say xft:Font Awesome:size=9,xft:Fira Sans:size=9
and it should try showing characters from the first font if they exist there, otherwise try the second font, etc.
Here's how st does it. And here's xmobar.
if you load up a browser with this page http://pastebin.com/47jj8C1n you'll get a listing of your home directory in the dzen title bar: http://i.imgur.com/5ElKK.png
:/ I'm pretty sure it shouldn't work like that. Maybe it's something I've done wrong?
I have a script which opens dzen2 and accepts a single key (and then does something and exits). If I use event string:
entertitle=grabkeys;enterslave=grabkeys;onstart=uncollapse,grabkeys
then it works fine when I invoke the script from a shell. But when I invoke the script from xbindkeys, it does not do the grabkeys. I have to manually
move the mouse out and into the window (activating enterslave/entertitle) to get it to read the key. My kludge fix was to do this:
entertitle=grabkeys;enterslave=grabkeys;onstart=uncollapse,grabkeys,exec:xdotool mousemove 960 0 sleep 0.2 mousemove 900 35
which moves it for me (activating enterslave/entertitle). The sleep is required. Sleeping 0.1 does not work.
So I wonder if this a bug in the program, or is there something I did wrong regarding grabkeys such that it did not work from xbindkeys?
Hi,
I obsorved some strange behaviour of dzen regarding the click events: If I click at an area that launches a programm or switches the workspace or whatever, it works just fine, but if I click again a second, third, … time w/o having moved the mouse, nothing happens.
To make it work again, I first have to leave the area of dzen with the mouse and then click again on the desired item. That doesn't happen always, i.e. it's not totally reproducable, but sometimes, and this whole behaviour doesn't seem to go away…
Anybody knows what's going on here? Btw. this issue occurs on three different machines/systems.
This command generates a 3-item horizontal menu, with "menuprint" sending the left-click choice to stdout:
echo -e "xterm\nxeyes\nxfontsel" | dzen2 -x 450 -y 450 -w 250 -l 3 -m h -sa c -p -e "button1=menuprint;button3=exit:13"
If I left-click on each item in turn, I get
xterm
xeyes
xfontsel
In the following command, stdout is piped to sed:
echo -e "xterm\nxeyes\nxfontsel" | dzen2 -x 450 -y 450 -w 250 -l 3 -m h -sa c -p -e "button1=menuprint;button3=exit:13" | sed 's/xeyes/aaaaa/'
Clicking on each item in turn gives
xterm
aaaaa
xfontsel
But not all downstream processes accept stdout the way sed does in the example. Neither
echo -e "xterm\nxeyes\nxfontsel" | dzen2 -x 450 -y 450 -w 250 -l 3 -m h -sa c -p -e "button1=menuprint;button3=exit:13" | xclip
nor
echo -e "xterm\nxeyes\nxfontsel" | dzen2 -x 450 -y 450 -w 250 -l 3 -m h -sa c -p -e "button1=menuprint;button3=exit:13" | xsel
sends the menu choice to the X clipboard.
Any suggestions about what's going on here? Many thanks in advance.
I just discover dzen because notify-send was broken and I'm very happy with it. IMO it just lack on 1 features:
progress bar
with a -b and a number between 0 and 100 to display only a part of the bar in the fg color and the rest in the bg color
could be awesome for a lot of cases like displaying volume, display loading, compilation status, battery and much more
There was a crash reported on Fedora, can you please take a look?
Bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1076054
I get a segfault when clicking on a menu item with this command:
echo -e "^fg(yellow)menu^fg()\none\ntwo\nthree\nfour\nfive\nsix\n" | ./dzen2 -l 7 -x 400 -y 200 -w 200 -p -m -e 'onstart=uncollapse;button1=menuprint'
From what I can see the crash is happening at line 458 in action.c
That's as far as I've been able to figure it out so far.
subj
just to say that a couple of commits are available there for some time, mostly some cleanups and use of dpy-independant X11 functions.
https://gitorious.org/drzraf/dzen/commits/
Add:
^scrollup(n)
^scrolldown(n)
This ability is available as scrollup:n action for events, but not during "runtime".
e.g. #aaa
becomes #a0a0a0
instead of #aaaaaa
displaying xpm files with the ^i(path)
command
causes xorg RAM usage to grow excessively
(eventually consuming several GB on my system)
until the script is terminated which releases the memory
I see no leak for xbm files
I have both key_Return=menuprint;
and button1=menuprint;
as events. Pressing button1 works as it should, but pressing Return will only work the first time. After that, nothing appears on stdout if I press Return again.
My version is dzen-0.9.5-svn
Any chance of tagging a release? It would greatly help in updating dzen ports (in my case to OpenBSD), since 'master.zip' holds no version info and managing versions based on specific commits is a bit of a PITA.
available here (migrated with svn2git)
https://gitorious.org/drzraf/dzen/
I accidentially ran something like dzen2 -fn "$FONT"
without setting $FONT and dzen2 crashed.
To reproduce, just try this:
$ dzen2 -fn ''
Segmentation fault
Currently, if the tags ^p(_LEFT)
, ^p(_CENTER)
or ^p(_RIGHT)
are used, only the cursor is moved. This causes all following text to be drawn after the cursor rather than it being centered or right justified.
If this is intended functionality, then I would like to suggest adding a center and right-justify tag.
Hello,
using dzen by following this : https://brandonio21.com/2015/04/building-a-volume-popup-using-dzen2/
when im changing volume by holding key, multiple windows are displaying and its showing ugly shadows.
Is there a way to get rid of this with a flag or something?
Hi,
Im pretty happy with dzen and its scriptable capabilties. Aside from a general menu-like program, I also use it as a statusbar. I have however struggled with alignment issues.
Im aware (at least I believe so) that ^p()
and even ^p(_LEFT/_RIGHT/_CENTER)
are calculated relative to the current cursor position on the dzen instance. So, this isnt necessarily the best option if one is aiming to have a bar with left, center and right aligned text/icons.
Im also aware of the undocumented ^ba($bar_width, _LEFT/_CENTER/_RIGHT)
option. However, if I was to run
echo "^ba(1920,_LEFT)Left^ba(1920,_CENTER)Center" | dzen2 -w 1920 -ta l -p
Things don't go as planned. Its hard to know why or if I am using it incorrectly since there isnt much to read on. But it seems that this justification of text is always relative to the current cursor position.
Im also aware of textwidth
, where one could sample the width in pixels of a given string with a given font. That way knowing the width of ones text, together with the usage of absolute positioning of pa()
, it then becomes feasible a proper alignment of a statusbar.
However, using different fonts through fn()
, especially nerd/patched/powerline fonts, I at least have not been successfully able to find pixelwidths of different texts that are patched with icons. It may well be due to the fact that textwidth
may only accept X logical font description of fonts and apparently icon patched fonts do not fall into that configuration.
Therefore alignment ends up hard coded which is a bit of a bummer.
I was wondering if a veteran user or mantainer or anyone knows about undocumented features or solutions to properly align a dzen statusbar which contains different fonts and/or with icons, could enlighten me.
See the following input strings:
^r(5x6)^p(;5)^r(5x6)
^r(5x8)^p(;4)^r(5x8)
^r(5x12)^p(;2)^r(5x12)
All of them draw two rectangles at the same height. The y-position to achieve this (apart from leaving the positioning out obviously) seems very random. This makes it impossible to draw vertical progress bars.
I'm making a system menu with dzen for bspwm. I directly use onstart=grabbeys event to receive kb events and then dispatch them (with kb_XX events after that) and manage the output in the bash script.
SEL=$(echo " [l]ock e[x]it re[b]oot [p]oweroff " | dzen2 -p $TIMEOUT -w 400 -h 28 -x 100 -e "onstart=grabkeys;key_Escape=exit;key_l=print:l,exit;key_x=print:x,exit;key_b=print:b,exit;key_p=print:p,exit;")
But bspwm doesn't seem to let dzen keep the keyboard focus. On other WM/DM dzen keeps keyboard focus, with bspwm it doesn't. Is there a workaround ?
This is really an almost insignificant issue, but I thought I would note that the replacement text, VERSION
, within the control flow for the version (i.e. -v
) option, is not defined.
Is it possible to add a border around the window? I am using this for notifications and right now I am making one slightly larger one to go underneath. It would be great to have a feature where you can specify a border width and a colour.
I've noticed that there seem to be no font fallback mechanism.
Maybe dzen2 could either:
-fn "Font1,Font2,Font3"
...?
Hello!
All cyrillic characters are displayed as rectangles with terminus-font:
echo "hello world кириллицав" | dzen2 -fn '-*-terminus-medium-*-*-*-22-*-*-*-*-*-koi8-u' -p -x 500 -y 1000 -w 500
Tested with:
community/terminus-font 4.36-2
aur/terminus-cyrillic 4.38-1
aur/terminus-font-td1 4.38-1
community/dzen2 0.9.5git-1
aur/dzen2-xft-xpm-xinerama-svn 271-2
aur/dzen2-svn 271-3
In urxvt/roxterm symbols displayed correctly.
Sorry for my poor english.
Hello,
I was testing some fonts on dzen2 and I've found that this font: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1
isn't showing correctly on dzen2. Instead a bigger bold font is displayed. Even using -misc-fixed-medium-r-normal--13-*-*-*-*-*-*-*
has the same result.
Both -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1
and -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
are displayed correctly.
Wuold be possible to include an event MouseHover and MouseLeave in an especific area like ^ca()?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.