#endif /* !__OpenBSD__ */
case OBJ_execpi:
case OBJ_execi:
-#ifdef X11
case OBJ_execibar:
+#ifdef X11
case OBJ_execigraph:
case OBJ_execigauge:
#endif
case OBJ_apcupsd_loadbar:
case OBJ_apcupsd_loadgraph:
case OBJ_apcupsd_loadgauge:
-#endif
+#endif /* X11 */
case OBJ_apcupsd_charge:
case OBJ_apcupsd_timeleft:
case OBJ_apcupsd_temp:
scan_bar(arg, w, h);
}
}
-#endif
+#endif /* X11 */
/* strip a leading /dev/ if any, following symlinks first
*
END OBJ(execgraph, 0)
SIZE_DEFAULTS(graph);
obj->data.s = strndup(arg ? arg : "", text_buffer_size);
+#endif /* X11 */
END OBJ(execibar, 0)
int n;
SIZE_DEFAULTS(bar);
} else {
obj->data.execi.cmd = strndup(arg + n, text_buffer_size);
}
+#ifdef X11
END OBJ(execigraph, 0)
int n;
SIZE_DEFAULTS(graph);
100, 1, showaslog, tempgrad);
}
}
+#endif /* X11 */
OBJ(execibar) {
if (current_update_time - obj->data.execi.last_update
>= obj->data.execi.interval) {
barnum = get_barnum(p);
if (barnum >= 0.0) {
- obj->f = 255 * barnum / 100.0;
+ obj->f = barnum;
}
obj->data.execi.last_update = current_update_time;
}
- new_bar(p, obj->a, obj->b, round_to_int(obj->f));
+#ifdef X11
+ if(output_methods & TO_X) {
+ new_bar(p, obj->a, obj->b, round_to_int(obj->f * 2.55));
+ } else {
+#endif /* X11 */
+ if(!obj->a) obj->a = DEFAULT_BAR_WIDTH_NO_X;
+ new_bar_in_shell(p, p_max_size, round_to_int(obj->f), obj->a);
+#ifdef X11
+ }
+#endif /* X11 */
}
+#ifdef X11
OBJ(execigraph) {
if (current_update_time - obj->data.execi.last_update
>= obj->data.execi.interval) {