From c02946aba396ad38b35438c505ae9fadc8c3aeb1 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sun, 9 Jun 2024 18:45:03 +0200 Subject: [PATCH] Add a simple wifi-indicator script --- home/modules/linux/graphical/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/home/modules/linux/graphical/default.nix b/home/modules/linux/graphical/default.nix index ebf078a..7901b89 100644 --- a/home/modules/linux/graphical/default.nix +++ b/home/modules/linux/graphical/default.nix @@ -4,6 +4,18 @@ let cfg = config.linux.graphical; vscode = with pkgs; if stdenv.isAarch64 then unstable.vscode else unstable.vscode-fhs; + + wifi-indicator = pkgs.writeScriptBin "wifi-indicator" '' + #!/usr/bin/env fish + + set wifi_output (${lib.getExe pkgs.iw} wlan0 link | rg "SSID: (.+)" --replace '🛜 $1' | string trim) + + if test -z $wifi_output + echo "❌ not connected" + else + echo $wifi_output + end + ''; in { imports = [ ./x11.nix ./wayland.nix ./alacritty.nix ]; @@ -70,6 +82,7 @@ in dex # .desktop file management, startup # sct # Display color temperature xdg-utils # Open stuff + wifi-indicator ] ++ (if pkgs.stdenv.isAarch64 then [ ] else [ gnome.cheese # Webcam check, expensive # Chat stuff