mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
GPG status module for Waybar
This commit is contained in:
parent
323322f339
commit
6ead6fbfea
5 changed files with 30 additions and 1 deletions
|
|
@ -35,6 +35,8 @@ let
|
|||
|
||||
kat-weather = super.callPackage ./kat-weather { };
|
||||
|
||||
kat-gpg-status =super.callPackage ./kat-gpg-status { };
|
||||
|
||||
linuxPackagesFor = kernel:
|
||||
(super.linuxPackagesFor kernel).extend (_: ksuper: {
|
||||
vendor-reset =
|
||||
|
|
|
|||
8
pkgs/kat-gpg-status/default.nix
Normal file
8
pkgs/kat-gpg-status/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
wrapShellScriptBin,
|
||||
pkgs
|
||||
}:
|
||||
|
||||
wrapShellScriptBin "kat-gpg-status" ./kat-gpg-status.sh {
|
||||
depsRuntimePath = with pkgs; [coreutils gnupg];
|
||||
}
|
||||
12
pkgs/kat-gpg-status/kat-gpg-status.sh
Normal file
12
pkgs/kat-gpg-status/kat-gpg-status.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
gpg --card-status &> /dev/null;
|
||||
if [ $? -eq 0 ]; then
|
||||
user=" $(gpg --card-status | grep "Login data" | awk '{print $NF}')";
|
||||
else
|
||||
user=" Disconnected"
|
||||
fi
|
||||
|
||||
echo $user
|
||||
Loading…
Add table
Add a link
Reference in a new issue