JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Add bar delay
authorMarco Peereboom <marco@conformal.com>
Fri, 23 Jan 2009 22:50:38 +0000 (22:50 +0000)
committerMarco Peereboom <marco@conformal.com>
Fri, 23 Jan 2009 22:50:38 +0000 (22:50 +0000)
scrotwm.1
scrotwm.c
scrotwm.conf

index 6656ae6..2cf3c9a 100644 (file)
--- a/scrotwm.1
+++ b/scrotwm.1
@@ -19,7 +19,7 @@
 .Os
 .Sh NAME
 .Nm scrotwm
-.Nd is a small dynamic tiling window manager for X11.
+.Nd small dynamic tiling window manager for X11.
 .Sh SYNOPSIS
 .Nm scrotwm
 .Sh DESCRIPTION
@@ -138,6 +138,8 @@ Status bar font.
 .It Ic bar_action
 External script to populate additional information in the status bar such as
 battery life etc.
+.It Ic bar_delay
+Update frequency of external script on the status bar.
 .It Ic spawn_term
 External application that gets spawned when M-S-[Return] is used.
 .It Ic dialog_ratio
index 60c6161..969655c 100644 (file)
--- a/scrotwm.c
+++ b/scrotwm.c
@@ -147,6 +147,7 @@ char                        *bar_argv[] = { NULL, NULL };
 int                    bar_pipe[2];
 char                   bar_ext[SWM_BAR_MAX];
 sig_atomic_t           bar_alarm = 0;
+int                    bar_delay = 30;
 int                    bar_enabled = 1;
 int                    bar_extra = 1;
 int                    bar_extra_running = 0;
@@ -412,6 +413,8 @@ conf_load(char *filename)
                                asprintf(&bar_fonts[0], "%s", val);
                        else if (!strncmp(var, "bar_action", strlen("bar_action")))
                                asprintf(&bar_argv[0], "%s", val);
+                       else if (!strncmp(var, "bar_delay", strlen("bar_delay")))
+                               bar_delay = atoi(val);
                        else
                                goto bad;
                        break;
@@ -534,8 +537,7 @@ bar_update(void)
                }
        }
        XSync(display, False);
-
-       alarm(60);
+       alarm(bar_delay);
 }
 
 void
index c00807f..46b4573 100644 (file)
@@ -8,7 +8,8 @@ bar_border[1]           = rgb:00/80/80
 bar_color[1]           = black
 bar_font_color[1]      = rgb:a0/a0/a0
 bar_font               = -*-terminus-*-*-*-*-*-*-*-*-*-*-*-*
-#bar_action            = "./baraction.sh"
+#bar_action            = ./baraction.sh
+#bar_delay             = 1
 
 # spawn app
 spawn_term             = xterm