aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--action.c10
-rw-r--r--draw.c2
-rw-r--r--dzen.h6
-rw-r--r--main.c4
-rw-r--r--util.c68
5 files changed, 45 insertions, 45 deletions
diff --git a/action.c b/action.c
index 089f93b..ec2512a 100644
--- a/action.c
+++ b/action.c
@@ -1,5 +1,5 @@
/*
- * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+ * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
* See LICENSE file for license details.
*/
@@ -231,7 +231,7 @@ a_togglestick(char * opt[]) {
return 0;
}
-int
+static int
scroll(int n) {
if(dzen.slave_win.last_line_vis < dzen.slave_win.max_lines)
return;
@@ -334,7 +334,7 @@ a_menuexec(char * opt[]) {
return 0;
}
-int
+int
a_raise(char * opt[]) {
XRaiseWindow(dzen.dpy, dzen.title_win.win);
@@ -343,7 +343,7 @@ a_raise(char * opt[]) {
return 0;
}
-int
+int
a_lower(char * opt[]) {
XLowerWindow(dzen.dpy, dzen.title_win.win);
@@ -352,7 +352,7 @@ a_lower(char * opt[]) {
return 0;
}
-int
+int
a_scrollhome(char * opt[]) {
if(dzen.slave_win.max_lines) {
dzen.slave_win.first_line_vis = 0;
diff --git a/draw.c b/draw.c
index eb5f1f4..47ae6d3 100644
--- a/draw.c
+++ b/draw.c
@@ -155,7 +155,7 @@ drawheader(char * text) {
dzen.y = 0;
dzen.w = dzen.title_win.width;
dzen.h = dzen.line_height;
-
+
if(text)
drawtext(text, 0, -1, dzen.title_win.alignment);
XCopyArea(dzen.dpy, dzen.title_win.drawable, dzen.title_win.win,
diff --git a/dzen.h b/dzen.h
index a45b83f..d521ddc 100644
--- a/dzen.h
+++ b/dzen.h
@@ -1,7 +1,7 @@
/*
- * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
- * See LICENSE file for license details.
- */
+* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+* See LICENSE file for license details.
+*/
#include <X11/Xlib.h>
#include <X11/Xutil.h>
diff --git a/main.c b/main.c
index 3caae2d..4aa1738 100644
--- a/main.c
+++ b/main.c
@@ -176,10 +176,10 @@ x_check_geometry(XRectangle si) {
dzen.title_win.x = si.x;
if (dzen.title_win.x < si.x)
dzen.title_win.x = si.x;
-
+
if(!dzen.title_win.width)
dzen.title_win.width = si.width;
-
+
if((dzen.title_win.x + dzen.title_win.width) > (si.x + si.width))
dzen.title_win.width = si.width - (dzen.title_win.x - si.x);
if(!dzen.slave_win.width) {
diff --git a/util.c b/util.c
index d584a4a..c2f44e2 100644
--- a/util.c
+++ b/util.c
@@ -1,7 +1,7 @@
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
- * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
- * See LICENSE file for license details.
- */
+* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com>
+* See LICENSE file for license details.
+*/
#include "dzen.h"
#include <stdarg.h>
@@ -13,50 +13,50 @@
void *
emalloc(unsigned int size) {
- void *res = malloc(size);
+ void *res = malloc(size);
- if(!res)
- eprint("fatal: could not malloc() %u bytes\n", size);
- return res;
+ if(!res)
+ eprint("fatal: could not malloc() %u bytes\n", size);
+ return res;
}
void
eprint(const char *errstr, ...) {
- va_list ap;
+ va_list ap;
- va_start(ap, errstr);
- vfprintf(stderr, errstr, ap);
- va_end(ap);
- exit(EXIT_FAILURE);
+ va_start(ap, errstr);
+ vfprintf(stderr, errstr, ap);
+ va_end(ap);
+ exit(EXIT_FAILURE);
}
char *
estrdup(const char *str) {
- void *res = strdup(str);
+ void *res = strdup(str);
- if(!res)
- eprint("fatal: could not malloc() %u bytes\n", strlen(str));
- return res;
+ if(!res)
+ eprint("fatal: could not malloc() %u bytes\n", strlen(str));
+ return res;
}
void
spawn(const char *arg) {
- static char *shell = NULL;
-
- if(!shell && !(shell = getenv("SHELL")))
- shell = "/bin/sh";
- if(!arg)
- return;
- /* The double-fork construct avoids zombie processes and keeps the code
- * clean from stupid signal handlers. */
- if(fork() == 0) {
- if(fork() == 0) {
- setsid();
- execl(shell, shell, "-c", arg, (char *)NULL);
- fprintf(stderr, "dzen: execl '%s -c %s'", shell, arg);
- perror(" failed");
- }
- exit(0);
- }
- wait(0);
+ static char *shell = NULL;
+
+ if(!shell && !(shell = getenv("SHELL")))
+ shell = "/bin/sh";
+ if(!arg)
+ return;
+ /* The double-fork construct avoids zombie processes and keeps the code
+ * clean from stupid signal handlers. */
+ if(fork() == 0) {
+ if(fork() == 0) {
+ setsid();
+ execl(shell, shell, "-c", arg, (char *)NULL);
+ fprintf(stderr, "dzen: execl '%s -c %s'", shell, arg);
+ perror(" failed");
+ }
+ exit(0);
+ }
+ wait(0);
}