Compare commits
No commits in common. "27b258bd0ace3cad21727d0da6366f988c3e7af4" and "09c5231c8765c2bcf158292ba168eba49bcd2a0c" have entirely different histories.
27b258bd0a
...
09c5231c87
5 changed files with 16 additions and 111 deletions
1
.envrc
1
.envrc
|
@ -1 +0,0 @@
|
||||||
use flake
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,4 +2,3 @@
|
||||||
slstatus
|
slstatus
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
.direnv/
|
|
||||||
|
|
40
flake.lock
40
flake.lock
|
@ -1,40 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"flake-schemas": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1697467827,
|
|
||||||
"narHash": "sha256-j8SR19V1SRysyJwpOBF4TLuAvAjF5t+gMiboN4gYQDU=",
|
|
||||||
"rev": "764932025c817d4e500a8d2a4d8c565563923d29",
|
|
||||||
"revCount": 29,
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.2/018b3da8-4cc3-7fbb-8ff7-1588413c53e2/source.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1715668745,
|
|
||||||
"narHash": "sha256-xp62OkRkbUDNUc6VSqH02jB0FbOS+MsfMb7wL1RJOfA=",
|
|
||||||
"rev": "9ddcaffecdf098822d944d4147dd8da30b4e6843",
|
|
||||||
"revCount": 558484,
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2311.558484%2Brev-9ddcaffecdf098822d944d4147dd8da30b4e6843/018f7bf7-c7bb-7b91-bed1-833da8f9e65e/source.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/%2A.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-schemas": "flake-schemas",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
39
flake.nix
39
flake.nix
|
@ -1,39 +0,0 @@
|
||||||
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.8)
|
|
||||||
{
|
|
||||||
|
|
||||||
description = "slstatus";
|
|
||||||
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
|
|
||||||
|
|
||||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
outputs = { self, flake-schemas, nixpkgs }:
|
|
||||||
let
|
|
||||||
|
|
||||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
|
||||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
|
||||||
pkgs = import nixpkgs { inherit system; };
|
|
||||||
});
|
|
||||||
in {
|
|
||||||
|
|
||||||
schemas = flake-schemas.schemas;
|
|
||||||
|
|
||||||
|
|
||||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
|
||||||
default = pkgs.mkShell {
|
|
||||||
|
|
||||||
packages = with pkgs; [
|
|
||||||
git
|
|
||||||
nixpkgs-fmt
|
|
||||||
xorg.libX11
|
|
||||||
entr
|
|
||||||
gnumake
|
|
||||||
];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
46
src/config.h
46
src/config.h
|
@ -63,35 +63,21 @@ static const char unknown_str[] = "n/a";
|
||||||
* wifi_perc WiFi signal in percent interface name (wlan0)
|
* wifi_perc WiFi signal in percent interface name (wlan0)
|
||||||
* wifi_essid WiFi ESSID interface name (wlan0)
|
* wifi_essid WiFi ESSID interface name (wlan0)
|
||||||
*/
|
*/
|
||||||
static const struct arg _separator = {separator, " \\|/ ", NULL};
|
|
||||||
#define BAT_NAME "BAT0"
|
|
||||||
static const struct arg args[] = {
|
static const struct arg args[] = {
|
||||||
/* function format argument */
|
/* function format argument */
|
||||||
{run_command, "SP:%s ",
|
{ run_command, "SP:%s ", "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" },
|
||||||
"amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1"},
|
{ run_command, "BR:%s%% ", "xbacklight -get | awk '{printf \"%.0f\", $1}'" },
|
||||||
{run_command, "BR:%s%% ", "xbacklight -get | awk '{printf \"%.0f\", $1}'"},
|
{ cpu_perc, "CPU:%s%%|", NULL },
|
||||||
_separator,
|
{ cpu_freq, "%s ", NULL },
|
||||||
{cpu_perc, "CPU:%s%%|", NULL},
|
{ temp, "%s\u00b0C ", "/sys/class/hwmon/hwmon5/temp1_input" },
|
||||||
{cpu_freq, "%s ", NULL},
|
{ ram_perc, "RAM:%s%% ", NULL },
|
||||||
{temp, "%s\u00b0C ", "/sys/class/thermal/thermal_zone8/temp"},
|
// { netspeed_tx, " %s ^ ", "wlan0" },
|
||||||
_separator,
|
// { netspeed_rx, " %s ", "wlan0" },
|
||||||
{ram_perc, "RAM:%s%% ", NULL},
|
{ battery_perc, "BAT:%s%%", "BAT0" },
|
||||||
{swap_perc, "SWAP: %s%% ", NULL },
|
{ battery_state, "%s ", "BAT0" },
|
||||||
// { netspeed_tx, " %s ^ ", "wlan0" },
|
{ keymap, "KB:%s ", NULL },
|
||||||
// { netspeed_rx, " %s ", "wlan0" },
|
{ datetime, "TIME:%s|", "%r" },
|
||||||
_separator,
|
{ datetime, "%s ", "%a %d/%m/%Y" },
|
||||||
{battery_perc, "BAT:%s%%", BAT_NAME},
|
{ disk_used, "(/:%s|", "/" },
|
||||||
{battery_state, "%s ", BAT_NAME},
|
{ disk_used, "~:%s)", "/home" },
|
||||||
// {battery_remaining, " REM: %s", BAT_NAME},
|
|
||||||
_separator,
|
|
||||||
{keymap, "KB:%s", NULL},
|
|
||||||
_separator,
|
|
||||||
{datetime, "TIME:%s", "%r"},
|
|
||||||
_separator,
|
|
||||||
{datetime, "%s ", "%a %d/%m/%Y"},
|
|
||||||
_separator,
|
|
||||||
{disk_used, "(ROOT:%s|", "/"},
|
|
||||||
{disk_used, "HOME:%s)", "/home"},
|
|
||||||
_separator,
|
|
||||||
{uptime, "UP: %s", NULL},
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue