From 032d7f47b4f10de56ee1bf4d798a3fb31526a02c Mon Sep 17 00:00:00 2001 From: iFargle Date: Mon, 28 Aug 2023 19:35:59 +0900 Subject: [PATCH] test --- .../gruvbox/waybar/scripts/waybar-scripts.nix | 11 +++++++++++ .../desktops/hyprland/gruvbox/waybar/waybar-conf.nix | 2 ++ .../hyprland/gruvbox/waybar/waybar-conf2.nix | 12 ++++++++++++ nixos/default.nix | 1 + 4 files changed, 26 insertions(+) create mode 100644 home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/scripts/waybar-scripts.nix diff --git a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/scripts/waybar-scripts.nix b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/scripts/waybar-scripts.nix new file mode 100644 index 00000000..881b2e34 --- /dev/null +++ b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/scripts/waybar-scripts.nix @@ -0,0 +1,11 @@ +{...}: { + home.file = { + ".config/waybar/scripts/tailscale.sh" = { + enable = true; + executable = true; + text = '' + tailscale status --json | jq -r '.BackendState' + ''; + } + } +} \ No newline at end of file diff --git a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf.nix b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf.nix index 48fe7ba2..197a55e5 100644 --- a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf.nix +++ b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf.nix @@ -1,4 +1,6 @@ { hostname, ...}: { + import = [ ./scripts/waybar-scripts.nix ]; + home.file = { # https://yewtu.be/watch?v=tWQB1NDDA9c # https://github.com/DN-debug/waybar-examples diff --git a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf2.nix b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf2.nix index 5f28053f..9af9693b 100644 --- a/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf2.nix +++ b/home-manager/hosts/nixos-laptop/desktops/hyprland/gruvbox/waybar/waybar-conf2.nix @@ -1,4 +1,6 @@ { hostname, ...}: { + import = [ ./scripts/waybar-scripts.nix ]; + home.file = { # https://yewtu.be/watch?v=tWQB1NDDA9c # https://github.com/DN-debug/waybar-examples @@ -30,11 +32,20 @@ "mpris", "idle_inhibitor", "pulseaudio", + "custom/tailscale", "network", "battery", "clock" ], + "custom/tailscale": { + "format": "VPN ", + "exec": "echo '{\"class\": \"connected\"}'", + "exec-if": "", + "return-type": "json", + "interval": 5 + } + "idle_inhibitor": { "format": "{icon}", "format-icons": { @@ -204,6 +215,7 @@ * Critical plugins state */ #cpu.critical, + #idle_inhibitor.activated, #temperature.critical, #memory.critical, #battery.critical, diff --git a/nixos/default.nix b/nixos/default.nix index db05e9fe..993402d1 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -38,6 +38,7 @@ iotop sops gnupg + jq ]; # Select internationalisation properties.