add default.nix & simplify status

This commit is contained in:
Maddie H 2022-07-12 14:17:33 +01:00
parent bd098fbe58
commit 8fa746d747
No known key found for this signature in database
GPG Key ID: 63900F0992F8C7B3
3 changed files with 18 additions and 11 deletions

View File

@ -1,7 +1,7 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
/* interval between updates (in ms) */ /* interval between updates (in ms) */
const unsigned int interval = 500; const unsigned int interval = 1000;
/* text to show if no value can be retrieved */ /* text to show if no value can be retrieved */
static const char unknown_str[] = "n/a"; static const char unknown_str[] = "n/a";
@ -65,14 +65,14 @@ static const char unknown_str[] = "n/a";
*/ */
static const struct arg args[] = { static const struct arg args[] = {
/* function format argument */ /* function format argument */
{ run_command, " [ %s ]", "sb-volume" }, { run_command, " %s |", "sb-volume" },
{ wifi_perc, " [  %s%% ]", "wlp3s0" }, /* { wifi_perc, "  %s%% |", "wlp3s0" }, */
{ disk_perc, " [  %s%% ]", "/" }, { disk_perc, "  %s%% |", "/" },
{ ram_perc, " [  %s%% ]", NULL }, { ram_perc, "  %s%% |", NULL },
{ cpu_perc, " [  %s%% ]", NULL }, { cpu_perc, "  %s%% |", NULL },
{ temp, " [  %s°C ]", "/sys/class/thermal/thermal_zone2/temp" }, { temp, "  %s°C |", "/sys/class/thermal/thermal_zone2/temp" },
{ uptime, " [  %s ]", NULL }, { uptime, "  %s |", NULL },
{ kernel_release, " [  %s ]", NULL }, { kernel_release, "  %s |", NULL },
{ datetime, " [  %s ]", "%a %d %b" }, { datetime, "  %s |", "%a %d %b" },
{ datetime, " [  %s ]", "%I:%M:%S %p" }, { datetime, "  %s ", "%I:%M:%S %p" },
}; };

4
default.nix Normal file
View File

@ -0,0 +1,4 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = [ pkgs.gnumake pkgs.pkg-config pkgs.xorg.libX11 ];
}

View File

@ -79,6 +79,9 @@ const char *uid(void);
/* volume */ /* volume */
const char *vol_perc(const char *card); const char *vol_perc(const char *card);
/* media */
const char *media_mpd_stat(void);
/* wifi */ /* wifi */
const char *wifi_perc(const char *interface); const char *wifi_perc(const char *interface);
const char *wifi_essid(const char *interface); const char *wifi_essid(const char *interface);