summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk2
-rw-r--r--dwmstatus.c9
-rw-r--r--flake.lock25
-rw-r--r--flake.nix14
4 files changed, 43 insertions, 7 deletions
diff --git a/config.mk b/config.mk
index 0ec9e47..921a272 100644
--- a/config.mk
+++ b/config.mk
@@ -4,7 +4,7 @@ VERSION = 1.0
# Customize below to fit your system
# paths
-PREFIX = /usr
+PREFIX = ${out}
MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include
diff --git a/dwmstatus.c b/dwmstatus.c
index 3a8dc1c..34dbbf2 100644
--- a/dwmstatus.c
+++ b/dwmstatus.c
@@ -119,7 +119,6 @@ main(void)
char *tmbln;
char *ips;
char *track;
- char *temp;
char *partition;
if (!(dpy = XOpenDisplay(NULL))) {
@@ -130,20 +129,18 @@ main(void)
for (;;sleep(1)) {
avg = loadavg();
tmbln = mktimes("%a %d %b %H:%M", tzberlin);
- ips = execscript("ip a | grep 'inet ' | grep -v 127.0.0.1 | tr -s ' ' |cut -f3 -d' '");
- temp = execscript("sensors amdgpu-pci-0400 | grep edge | cut -c 16-22");
+ ips = execscript("ip a | grep 'inet ' | grep -v 127.0.0.1 | tr -s ' ' | cut -f3 -d' '");
track = execscript("mpc -h core-a.lan | head -n 1 | grep -v volume || echo");
partition = execscript("df -lh | grep cryptroot | tr -s ' ' | cut -d ' ' -f 4");
- status = smprintf(" %s | %s | %s | %s | %s",
- track, avg, temp, partition, tmbln);
+ status = smprintf(" %s | %s | %s | %s | %s ",
+ track, ips, avg, partition, tmbln);
setstatus(status);
free(avg);
free(tmbln);
free(ips);
free(track);
- free(temp);
free(partition);
free(status);
}
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..686cf9d
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,25 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1699065553,
+ "narHash": "sha256-j8UmH8fqXcOgL6WrlMcvV2m2XQ6OzU0IBucyuJ0vnyQ=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "8ab9c53eee434651ce170dee1d9727b974e9a6b6",
+ "type": "github"
+ },
+ "original": {
+ "id": "nixpkgs",
+ "type": "indirect"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..9a423d2
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,14 @@
+{
+ outputs = {
+ self,
+ nixpkgs,
+ }:
+ with nixpkgs.legacyPackages.x86_64-linux; {
+ packages.x86_64-linux.default = stdenv.mkDerivation {
+ name = "dwmstatus";
+ src = ./.;
+ buildInputs = [xorg.libX11.dev];
+ };
+ formatter.x86_64-linux = alejandra;
+ };
+}