Displays the number of unseen messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 143, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
.TP
+\fB\*(T<\fBioscheduler\fR\*(T>\fR \*(T<\fB(disk)\fR\*(T>
+Prints the current ioscheduler used for the given disk name (i.e. e.g. "hda" or "sdb")
+
+.TP
\fB\*(T<\fBkernel\fR\*(T>\fR
Kernel version
.TP
\fB\*(T<\fBlaptop_mode\fR\*(T>\fR
-value of /proc/sys/vm/laptop_mode
+The value of /proc/sys/vm/laptop_mode
.TP
\fB\*(T<\fBloadavg\fR\*(T>\fR
<varlistentry>
<term>
+ <command><option>ioscheduler</option></command>
+ </term>
+ <option>(disk)</option>
+ <listitem>
+ Prints the current ioscheduler used for the given disk name (i.e. e.g. "hda" or "sdb")
+ <para></para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term>
<command><option>kernel</option></command>
</term>
<listitem>
<command><option>laptop_mode</option></command>
</term>
<listitem>
- value of /proc/sys/vm/laptop_mode
+ The value of /proc/sys/vm/laptop_mode
<para></para></listitem>
</varlistentry>
OBJ_ibm_brightness,
OBJ_if_up,
OBJ_if_gw,
+ OBJ_ioscheduler,
OBJ_gw_iface,
OBJ_gw_ip,
OBJ_laptop_mode,
info.gw_info.ip = 0;
}
break;
+ case OBJ_ioscheduler:
+ if(objs[i].data.s)
+ free(objs[i].data.s);
+ break;
#endif
#ifdef XMMS2
case OBJ_xmms2_artist:
blockstart[blockdepth] = object_count;
obj->data.ifblock.pos = object_count + 2;
blockdepth++;
+ END OBJ(ioscheduler, 0)
+ if (!arg) {
+ CRIT_ERR("get_ioscheduler needs an argument (e.g. hda)");
+ obj->data.s = 0;
+ } else
+ obj->data.s = strdup(arg);
END OBJ(laptop_mode, 0)
END OBJ(pb_battery, 0)
if (arg && strcmp(arg, "status") == 0) {
if_jumped = 0;
}
}
+ OBJ(ioscheduler) {
+ snprintf(p, p_max_size, "%s", get_ioscheduler(obj->data.s));
+ }
OBJ(kernel) {
snprintf(p, p_max_size, "%s", cur->uname_s.release);
}
char get_voltage(char *, size_t, char *, int, unsigned int); /* ptarjan */
void update_load_average();
int interface_up(const char *dev);
+char *get_ioscheduler(char *);
int get_laptop_mode(void);
void update_gateway_info(void);
return val;
}
+/* my system says:
+ * # cat /sys/block/sda/queue/scheduler
+ * noop [anticipatory] cfq
+ */
+char *get_ioscheduler(char *disk)
+{
+ FILE *fp;
+ char buf[128];
+
+ if (!disk)
+ return "n/a";
+
+ snprintf(buf, 127, "/sys/block/%s/queue/scheduler", disk);
+ if ((fp = fopen(buf, "r")) == NULL) {
+ return strdup("n/a");
+ }
+ while (!feof(fp)) {
+ fscanf(fp, "%127s", buf);
+ if (buf[0] == '[') {
+ buf[strlen(buf) - 1] = '\0';
+ fclose(fp);
+ return strdup(buf + 1);
+ }
+ }
+ fclose(fp);
+ return strdup("n/a");
+}
+
int interface_up(const char *dev)
{
int fd;