473 current 2025-07-09 20:14:48 25.05.20250424.f771eb4 6.12.24 *
This commit is contained in:
@@ -62,7 +62,7 @@ foreground = ${colors.foreground}
|
|||||||
;font-5 = Unifont:size=64:antialias=false;1
|
;font-5 = Unifont:size=64:antialias=false;1
|
||||||
|
|
||||||
; modules-left = date battery cpu memory coretemp pulseaudio-control network bluetooth cmus
|
; modules-left = date battery cpu memory coretemp pulseaudio-control network bluetooth cmus
|
||||||
modules-left = date battery cpu memory coretemp pulseaudio-control network bluetooth cmus
|
modules-left = date battery cpu memory coretemp pulseaudio-control network bluetooth tailscale cmus
|
||||||
modules-center = title
|
modules-center = title
|
||||||
; modules-right = pomodoro xkeyboard bspwm
|
; modules-right = pomodoro xkeyboard bspwm
|
||||||
modules-right = xkeyboard bspwm
|
modules-right = xkeyboard bspwm
|
||||||
|
|||||||
@@ -29,6 +29,16 @@
|
|||||||
format-foreground = ${colors.theme}
|
format-foreground = ${colors.theme}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
tailscaleScript = pkgs.callPackage ./scripts/tailscale.nix {};
|
||||||
|
tctl = ''
|
||||||
|
[module/tailscale]
|
||||||
|
type = custom/script
|
||||||
|
interval = 15
|
||||||
|
exec = ${tailscaleScript}/bin/bluetooth-ctl
|
||||||
|
label-foreground = ${colors.foreground}
|
||||||
|
format-foreground = ${colors.theme}
|
||||||
|
'';
|
||||||
|
|
||||||
ip = "/run/current-system/sw/bin/ip";
|
ip = "/run/current-system/sw/bin/ip";
|
||||||
grep = "/run/current-system/sw/bin/grep";
|
grep = "/run/current-system/sw/bin/grep";
|
||||||
awk = "/run/current-system/sw/bin/awk";
|
awk = "/run/current-system/sw/bin/awk";
|
||||||
@@ -99,7 +109,7 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
package = mypolybar;
|
package = mypolybar;
|
||||||
config = ./config.ini;
|
config = ./config.ini;
|
||||||
extraConfig = bctl + internets + mon;
|
extraConfig = bctl + internets + mon + tctl;
|
||||||
# my savior: https://www.reddit.com/r/NixOS/comments/v8ikwq/polybar_doesnt_start_at_launch/
|
# my savior: https://www.reddit.com/r/NixOS/comments/v8ikwq/polybar_doesnt_start_at_launch/
|
||||||
script = ''
|
script = ''
|
||||||
# echo "none"
|
# echo "none"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ in
|
|||||||
then
|
then
|
||||||
echo "%{F#2193ff}"
|
echo "%{F#2193ff}"
|
||||||
else
|
else
|
||||||
echo "%{F#2193ff} %{F#ffffff}[$device]"
|
echo "%{F#2193ff} %{F#ffffff}[$device]"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
''
|
''
|
||||||
|
|||||||
15
home/programs/polybar/scripts/tailscale.nix
Normal file
15
home/programs/polybar/scripts/tailscale.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{pkgs, ...}: let
|
||||||
|
# bctl = "/run/current-system/sw/bin/bluetoothctl";
|
||||||
|
# sctl = "/run/current-system/sw/bin/systemctl";
|
||||||
|
# grep = "/run/current-system/sw/bin/grep";
|
||||||
|
# wc = "/run/current-system/sw/bin/wc";
|
||||||
|
tailscale = "/run/current-system/sw/bin/tailscale";
|
||||||
|
rg = "/etc/profiles/per-user/synchronous/bin/rg";
|
||||||
|
hostname = "/run/current-system/sw/bin/hostname";
|
||||||
|
ip = "/run/current-system/sw/bin/ip";
|
||||||
|
cut = "/run/current-system/sw/bin/cut";
|
||||||
|
awk = "/run/current-system/sw/bin/awk";
|
||||||
|
in
|
||||||
|
pkgs.writeShellScriptBin "tailscale-ctl" ''
|
||||||
|
tailscale status | rg "$(hostname)" &> /dev/null && echo "%{F#2193ff}🔗 [$(ip addr show tailscale0 | rg "inet " | awk '{print $2}' | cut -d'/' -f1 )]" || echo ""
|
||||||
|
''
|
||||||
Reference in New Issue
Block a user