From: Marco Peereboom Date: Fri, 23 Jan 2009 22:50:38 +0000 (+0000) Subject: Add bar delay X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=7088da1fd1c181fdfd05a38bc5a24c4e1758aac7;p=spectrwm.git Add bar delay --- diff --git a/scrotwm.1 b/scrotwm.1 index 6656ae6..2cf3c9a 100644 --- 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 diff --git a/scrotwm.c b/scrotwm.c index 60c6161..969655c 100644 --- 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 diff --git a/scrotwm.conf b/scrotwm.conf index c00807f..46b4573 100644 --- a/scrotwm.conf +++ b/scrotwm.conf @@ -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