add configs
This commit is contained in:
parent
614c275b42
commit
774894486f
29 changed files with 106 additions and 2 deletions
BIN
components/battery.o
Normal file
BIN
components/battery.o
Normal file
Binary file not shown.
BIN
components/cat.o
Normal file
BIN
components/cat.o
Normal file
Binary file not shown.
BIN
components/cpu.o
Normal file
BIN
components/cpu.o
Normal file
Binary file not shown.
BIN
components/datetime.o
Normal file
BIN
components/datetime.o
Normal file
Binary file not shown.
BIN
components/disk.o
Normal file
BIN
components/disk.o
Normal file
Binary file not shown.
BIN
components/entropy.o
Normal file
BIN
components/entropy.o
Normal file
Binary file not shown.
BIN
components/hostname.o
Normal file
BIN
components/hostname.o
Normal file
Binary file not shown.
BIN
components/ip.o
Normal file
BIN
components/ip.o
Normal file
Binary file not shown.
BIN
components/kernel_release.o
Normal file
BIN
components/kernel_release.o
Normal file
Binary file not shown.
BIN
components/keyboard_indicators.o
Normal file
BIN
components/keyboard_indicators.o
Normal file
Binary file not shown.
BIN
components/keymap.o
Normal file
BIN
components/keymap.o
Normal file
Binary file not shown.
BIN
components/load_avg.o
Normal file
BIN
components/load_avg.o
Normal file
Binary file not shown.
BIN
components/netspeeds.o
Normal file
BIN
components/netspeeds.o
Normal file
Binary file not shown.
BIN
components/num_files.o
Normal file
BIN
components/num_files.o
Normal file
Binary file not shown.
BIN
components/ram.o
Normal file
BIN
components/ram.o
Normal file
Binary file not shown.
BIN
components/run_command.o
Normal file
BIN
components/run_command.o
Normal file
Binary file not shown.
BIN
components/swap.o
Normal file
BIN
components/swap.o
Normal file
Binary file not shown.
BIN
components/temperature.o
Normal file
BIN
components/temperature.o
Normal file
Binary file not shown.
BIN
components/uptime.o
Normal file
BIN
components/uptime.o
Normal file
Binary file not shown.
BIN
components/user.o
Normal file
BIN
components/user.o
Normal file
Binary file not shown.
|
|
@ -219,3 +219,33 @@
|
|||
return bprintf("%d", v & 0xff);
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *
|
||||
vol_perc_pw(const char *sink)
|
||||
{
|
||||
FILE *fp;
|
||||
char buf[64], cmd[64];
|
||||
double v;
|
||||
|
||||
if (esnprintf(cmd, sizeof(cmd), "wpctl get-volume %s", sink) < 0)
|
||||
return NULL;
|
||||
|
||||
if (!(fp = popen(cmd, "r"))) {
|
||||
warn("popen '%s':", cmd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!fgets(buf, sizeof(buf), fp)) {
|
||||
pclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
pclose(fp);
|
||||
|
||||
if (strstr(buf, "[MUTED]"))
|
||||
return "mute";
|
||||
|
||||
if (sscanf(buf, "Volume: %lf", &v) != 1)
|
||||
return NULL;
|
||||
|
||||
return bprintf("%d%%", (int)(v * 100 + 0.5));
|
||||
}
|
||||
|
|
|
|||
BIN
components/volume.o
Normal file
BIN
components/volume.o
Normal file
Binary file not shown.
BIN
components/wifi.o
Normal file
BIN
components/wifi.o
Normal file
Binary file not shown.
Loading…
Reference in a new issue