#!/bin/sh
+print_date() {
+ # The date is printed to the status bar by default.
+ # To print the date through this script, set clock_enabled to 0
+ # in scrotwm.conf. Uncomment "print_date" below.
+ FORMAT="%a %b %d %R %Z %Y"
+ DATE=`date "+${FORMAT}"`
+ echo -n "${DATE} "
+}
+
_print_cpu() {
typeset -R4 _1=${1} _2=${2} _3=${3} _4=${4} _5=${5}
echo -n "CPU:${_1}% User${_2}% Nice${_3}% Sys${_4}% Int${_5}% Idle "
APM_DATA=`/usr/sbin/apm -alb`
fi
if [ $I -gt 2 ]; then
+ # print_date
print_cpu $REPLY
print_apm $APM_DATA
echo ""
.It Cm M-t
Toggle focused window between tiled and floating
.It Cm M-S Aq Cm Delete
-Lock scren
+Lock screen
.It Cm M-S-i
Reinitialize physical screens
.It Cm M1
such as battery life.
.It Cm bar_delay
Update frequency, in seconds, of external script that populates the status bar.
+.It Cm clock_enabled
+Enable or disable displaying the clock in the status bar. Disable by
+setting to 0 so a custom clock could be used in the bar_action script.
.It Cm spawn_term
External application that gets spawned when
.Cm M-S- Ns Aq Cm Return
int bar_extra_running = 0;
int bar_verbose = 1;
int bar_height = 0;
+int clock_enabled = 1;
pid_t bar_pid;
GC bar_gc;
XGCValues bar_gcv;
break;
case 'c':
- if (!varmatch(var, "color_focus", &i))
+ if (!strncmp(var, "clock_enabled", strlen("clock_enabled")))
+ clock_enabled = atoi(val);
+ else if (!varmatch(var, "color_focus", &i))
setscreencolor(val, i, SWM_S_COLOR_FOCUS);
else if (!varmatch(var, "color_unfocus", &i))
setscreencolor(val, i, SWM_S_COLOR_UNFOCUS);
} else
strlcpy(bar_ext, "", sizeof bar_ext);
- time(&tmt);
- localtime_r(&tmt, &tm);
- strftime(s, sizeof s, "%a %b %d %R %Z %Y", &tm);
+ if (clock_enabled == 0)
+ strlcpy(s, "", sizeof s);
+ else {
+ time(&tmt);
+ localtime_r(&tmt, &tm);
+ strftime(s, sizeof s, "%a %b %d %R %Z %Y ", &tm);
+ }
for (i = 0; i < ScreenCount(display); i++) {
x = 1;
TAILQ_FOREACH(r, &screens[i].rl, entry) {
- snprintf(loc, sizeof loc, "%s %d:%d %s %s",
- s, x++, r->ws->idx + 1, bar_ext, bar_vertext);
+ snprintf(loc, sizeof loc, "%d:%d %s%s %s",
+ x++, r->ws->idx + 1, s, bar_ext, bar_vertext);
bar_print(r, loc);
}
}