diff options
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | README.dzen | 4 | ||||
-rw-r--r-- | dzen.h | 8 | ||||
-rwxr-xr-x | gadgets/kittscanner.sh | 8 | ||||
-rw-r--r-- | main.c | 31 |
5 files changed, 42 insertions, 14 deletions
@@ -433,7 +433,10 @@ Other: the input after the command will be drawn to the title window, so it is best used only once and as first command per line. - Subject to be improved in the future. + + ^cs() clear slave window + This command must be the first and only command + per line. ^ib(VALUE) ignore background setting, VALUE can be either 1 to ignore or 0 to not ignore the bg color set diff --git a/README.dzen b/README.dzen index 9a84b59..9332164 100644 --- a/README.dzen +++ b/README.dzen @@ -434,6 +434,10 @@ Other: only once and as first command per line Subject to be improved in the future. + ^^cs() clear slave window + This command must be the first and only command + per line. + ^^ib(VALUE) ignore background setting, VALUE can be either 1 to ignore or 0 to not ignore the bg color set with ^^bg(color) @@ -124,15 +124,15 @@ void x_draw_body(void); extern void drawtext(const char *text, int reverse, int line, - int aligne); + int align); extern char * parse_line(const char * text, int linenr, int align, int reverse, int nodraw); -extern long getcolor(const char *colstr); /* returns color of colstr */ -extern void setfont(const char *fontstr); /* sets global font */ -extern unsigned int textw(const char *text); /* returns width of text in px */ +extern long getcolor(const char *colstr); /* returns color of colstr */ +extern void setfont(const char *fontstr); /* sets global font */ +extern unsigned int textw(const char *text); /* returns width of text in px */ extern void drawheader(const char *text); extern void drawbody(char *text); diff --git a/gadgets/kittscanner.sh b/gadgets/kittscanner.sh index 9059cf7..7ed186e 100755 --- a/gadgets/kittscanner.sh +++ b/gadgets/kittscanner.sh @@ -19,10 +19,8 @@ BG=black SLEEP=0.1 -#DZEN=/usr/local/bin/dzen2 -DZEN=../dzen2 -#DZENOPTS="-bg $BG -fg $INACTIVE_LED_COLOR" -DZENOPTS="-bg $BG -fg $INACTIVE_LED_COLOR -xs 1 -y 30" +DZEN=dzen2 +DZENOPTS="-bg $BG -fg $INACTIVE_LED_COLOR" #----------------------------------------------------------------------- @@ -70,4 +68,4 @@ while :; do j=`expr $j $SIGN 1` sleep $SLEEP; -done | $DZEN $DZENOPTS +done | $DZEN $DZENOPTS -h `expr $LED_HEIGHT + 4` @@ -212,8 +212,14 @@ x_draw_body(void) { static void x_check_geometry(XRectangle si) { - dzen.title_win.x += si.x; - dzen.title_win.y += si.y; + + dzen.title_win.x = dzen.title_win.x < 0 ? + si.width + dzen.title_win.x + si.x : + dzen.title_win.x + si.x; + dzen.title_win.y = dzen.title_win.y < 0 ? + si.height + dzen.title_win.y + si.y : + dzen.title_win.y + si.x; + if(dzen.title_win.x > si.x + si.width) dzen.title_win.x = si.x; @@ -500,7 +506,7 @@ handle_xev(void) { if(ev.xcrossing.window == dzen.slave_win.line[i]) x_hilight_line(i); } - if(!dzen.slave_win.ishmenu +if(!dzen.slave_win.ishmenu && ev.xcrossing.window == dzen.title_win.win) do_action(entertitle); if(ev.xcrossing.window == dzen.slave_win.win) @@ -710,6 +716,23 @@ main(int argc, char *argv[]) { init_input_buffer(); } } + else if(!strncmp(argv[i], "-geometry", 8)) { + if(++i < argc) { + int t; + unsigned int tx, ty, tw, th; + + t = XParseGeometry(argv[i], &tx, &ty, &tw, &th); + + if(t & XValue) + dzen.title_win.x = (signed int) tx; + if(t & YValue) + dzen.title_win.y = (signed int) ty; + if(t & WidthValue) + dzen.title_win.width = (signed int) tw; + if(t & HeightValue) + dzen.line_height = (signed int) th; + } + } else if(!strncmp(argv[i], "-u", 3)){ dzen.tsupdate = True; } @@ -770,7 +793,7 @@ main(int argc, char *argv[]) { eprint("dzen-"VERSION", (C)opyright 2007 Robert Manea\n"); else eprint("usage: dzen2 [-v] [-p [seconds]] [-m [v|h]] [-ta <l|c|r>] [-sa <l|c|r>]\n" - " [-x <pixel>] [-y <pixel>] [-w <pixel>] [-tw <pixel>] [-u] \n" + " [-geometry <g>] [-x <pixel>] [-y <pixel>] [-w <pixel>] [-tw <pixel>] [-u] \n" " [-e <string>] [-l <lines>] [-fn <font>] [-bg <color>] [-fg <color>]\n" #ifdef DZEN_XINERAMA " [-xs <screen>]\n" |