added lots

This commit is contained in:
fwastring 2026-04-27 14:46:44 +02:00
parent 14205e371f
commit 1dd4440047
14 changed files with 595 additions and 224 deletions

View file

@ -59,6 +59,7 @@ let
"upower"
"custom/tailscale"
"custom/netbird"
"custom/bitwarden"
"network"
"clock"
]
@ -69,6 +70,7 @@ let
"bluetooth"
"custom/tailscale"
"custom/netbird"
"custom/bitwarden"
"network"
"clock"
];
@ -189,6 +191,20 @@ let
return-type = "json";
interval = 5;
};
"custom/bitwarden" = {
exec = "/home/fw/.config/waybar/scripts/bitwarden.sh --status";
on-click = "/home/fw/.config/waybar/scripts/bitwarden.sh --toggle";
exec-on-event = true;
format = "BW {icon} {text}";
format-icons = {
connected = "";
stopped = "";
};
tooltip = true;
return-type = "json";
interval = 5;
};
};
waybarStyle = ''
@ -238,7 +254,8 @@ let
#upower,
#network,
#custom-tailscale,
#custom-netbird {
#custom-netbird,
#custom-bitwarden {
background: @base;
border: none;
border-radius: 5px;
@ -305,6 +322,7 @@ let
#upower,
#custom-tailscale,
#custom-netbird,
#custom-bitwarden,
#network {
background: @peach;
color: @base;
@ -755,6 +773,68 @@ with lib;
'';
executable = true;
};
xdg.configFile."waybar/scripts/bitwarden.sh" = {
text = ''
#!${pkgs.bash}/bin/bash
PATH=${
lib.makeBinPath [
pkgs.coreutils
pkgs.procps
pkgs.bitwarden-desktop
]
}
BITWARDEN_SSH_SOCK="''${HOME}/.bitwarden-ssh-agent.sock"
is_socket_active() {
[[ -S "$BITWARDEN_SSH_SOCK" ]]
}
show_status() {
if is_socket_active; then
echo "{\"text\":\"\",\"class\":\"connected\",\"alt\":\"connected\",\"tooltip\":\"Bitwarden SSH agent socket is active: $BITWARDEN_SSH_SOCK\"}"
else
echo "{\"text\":\"\",\"class\":\"stopped\",\"alt\":\"stopped\",\"tooltip\":\"Bitwarden SSH agent socket is inactive: $BITWARDEN_SSH_SOCK\"}"
fi
}
open_bitwarden() {
bitwarden >/dev/null 2>&1 &
show_status
}
stop_bitwarden() {
pkill -x bitwarden >/dev/null 2>&1 || true
show_status
}
toggle_bitwarden() {
if is_socket_active; then
stop_bitwarden
else
open_bitwarden
fi
}
case "$1" in
--status)
show_status
;;
--open)
open_bitwarden
;;
--toggle)
toggle_bitwarden
;;
*)
echo "Usage: $0 {--status|--open|--toggle}"
exit 1
;;
esac
'';
executable = true;
};
};
# catppuccin.waybar = {
# enable = true;