diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-07-27 14:26:13 -0400 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-07-27 14:26:13 -0400 |
| commit | fcb37bdf9e6107f1d34ff05c8558021d67a0aeec (patch) | |
| tree | ec47e383d1cdf184443854a75ae0d5a894327fe4 | |
| parent | f2fb01a55b54dae9a5c26c7e1bae3d17c18de73e (diff) | |
| download | home-fcb37bdf9e6107f1d34ff05c8558021d67a0aeec.tar.gz | |
modules/py3status: init
| -rw-r--r-- | fw/home.nix | 6 | ||||
| -rw-r--r-- | modules/py3status/config | 94 | ||||
| -rw-r--r-- | modules/py3status/default.nix | 20 |
3 files changed, 115 insertions, 5 deletions
diff --git a/fw/home.nix b/fw/home.nix index 2be461e..422e86b 100644 --- a/fw/home.nix +++ b/fw/home.nix @@ -59,11 +59,7 @@ terminal = "foot"; }; - i3status = { - enable = true; - wireless = true; - battery = true; - }; + py3status.enable = true; qutebrowser = { enable = true; diff --git a/modules/py3status/config b/modules/py3status/config new file mode 100644 index 0000000..c731fc4 --- /dev/null +++ b/modules/py3status/config @@ -0,0 +1,94 @@ +py3status { + separator = False +} +general { + color_bad = "#ac8a8c" + color_degraded = "#aca98a" + color_good = "#cacaca" + color_orange = "#ceb188" + colors = false + interval = 60 + separator = " " +} + +order += "bluetooth airpods" +order += "bluetooth headphones" +order += "volume_status" +#order += "wireless _first_" +order += "networkmanager" +order += "battery_level" +order += "tztime local" + +battery all { + format = "bat %percentage" + format_percentage = "%.00f%s" + status_bat = "" + status_chr = "" + status_idle = "" +} + +nvidia_smi { + on_error = "hide" +} +xrandr { + on_error = "hide" +} + +tztime local { +# format = "%a, %b %e %I:%M %p" + format = "%I:%M %P" +} + +nvidia-smi { + +} +battery_level { + blocks = "" + charging_character = "" + format = "{icon}" +} + +volume_status { + format = "{icon}" + format_muted = "" + blocks = "" +} + +# generic for all devices +bluetooth { + format_device = "\?if=paired [\?if=icon=audio-headphones [\?if=connected |]|[\?if=icon=audio-headset [\?if=connected |]|[\?if=connected |]]]" +} + +bluetooth airpods { + # bluetoothctl set-alias "airpods" + format_device = "\?if=paired [\?if=alias=airpods [\?if=connected |]]" + on_click 1 = "exec bluetoothctl connect \"$(bluetoothctl devices | grep airpods | sed -E 's/Device ([^ ]+).*$/\1/g')\" && pkill -10 py3status" + on_click 3 = "exec bluetoothctl disconnect \"$(bluetoothctl devices | grep airpods | sed -E 's/Device ([^ ]+).*$/\1/g')\" && pkill -10 py3status" +} + +bluetooth headphones { + # bluetoothctl set-alias "headphones" + format_device = "\?if=paired [\?if=alias=headphones [\?if=connected |]]" + on_click 1 = "exec bluetoothctl connect \"$(bluetoothctl devices | grep headphones | sed -E 's/Device ([^ ]+).*$/\1/g')\" && pkill -10 py3status" + on_click 3 = "exec bluetoothctl disconnect \"$(bluetoothctl devices | grep headphones | sed -E 's/Device ([^ ]+).*$/\1/g')\" && pkill -10 py3status" +} + +volume master { + device = "default" + format = "vol %volume" + format_muted = "vol 0" +} + +networkmanager { + format_device = "\?if=general_type=wifi [\?if=general_connection |]|[\?if=general_connection |]" +} + +#wifi { +# blocks = "" +#} + +wireless _first_ { + format_down = "" + format_up = "" +} + diff --git a/modules/py3status/default.nix b/modules/py3status/default.nix new file mode 100644 index 0000000..01c8b96 --- /dev/null +++ b/modules/py3status/default.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.modules.py3status; +in +{ + options.modules.py3status = { + enable = lib.mkEnableOption "py3status"; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + (python3Packages.py3status.overrideAttrs (oldAttrs: { + propagatedBuildInputs = with python3Packages; [ pytz tzlocal pygobject3 ] ++ oldAttrs.propagatedBuildInputs; + })) + i3status + ]; + + xdg.configFile."i3status/config".source = ./config; + }; +} |