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-weather = super.callPackage ./kat-weather { };
|
||||||
|
|
||||||
|
kat-gpg-status =super.callPackage ./kat-gpg-status { };
|
||||||
|
|
||||||
linuxPackagesFor = kernel:
|
linuxPackagesFor = kernel:
|
||||||
(super.linuxPackagesFor kernel).extend (_: ksuper: {
|
(super.linuxPackagesFor kernel).extend (_: ksuper: {
|
||||||
vendor-reset =
|
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
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
"idle_inhibitor"
|
"idle_inhibitor"
|
||||||
#"mpd"
|
#"mpd"
|
||||||
"network"
|
"network"
|
||||||
|
"custom/gpg-status"
|
||||||
"custom/weather"
|
"custom/weather"
|
||||||
"clock"
|
"clock"
|
||||||
"tray"
|
"tray"
|
||||||
|
|
@ -42,6 +43,11 @@
|
||||||
on-click = "xdg-open 'https://google.com/search?q=weather'";
|
on-click = "xdg-open 'https://google.com/search?q=weather'";
|
||||||
exec =
|
exec =
|
||||||
"${pkgs.kat-weather}/bin/kat-weather ${witch.secrets.profiles.sway.city} ${witch.secrets.profiles.sway.api_key}";
|
"${pkgs.kat-weather}/bin/kat-weather ${witch.secrets.profiles.sway.city} ${witch.secrets.profiles.sway.api_key}";
|
||||||
|
};
|
||||||
|
"custom/gpg-status" = {
|
||||||
|
format = "{}";
|
||||||
|
interval= 300;
|
||||||
|
exec = "${pkgs.kat-gpg-status}/bin/kat-gpg-status";
|
||||||
};
|
};
|
||||||
cpu = { format = " {usage}%"; };
|
cpu = { format = " {usage}%"; };
|
||||||
#mpd = {
|
#mpd = {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
min-height: 14px
|
min-height: 14px
|
||||||
}
|
}
|
||||||
|
|
||||||
#clock, #memory, #cpu, #temperature, #pulseaudio, #network, #mpd, #backlight, #battery, #custom-weather, #idle_inhibitor {
|
#clock, #memory, #cpu, #temperature, #pulseaudio, #network, #mpd, #backlight, #battery, #custom-weather, #custom-gpg-status, #idle_inhibitor {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
|
|
@ -58,6 +58,7 @@
|
||||||
#mpd.disconnected, #mpd.stopped { border-color: #282a36 }
|
#mpd.disconnected, #mpd.stopped { border-color: #282a36 }
|
||||||
#network { border-color: ${style.base16.color3} }
|
#network { border-color: ${style.base16.color3} }
|
||||||
#custom-weather { border-color: ${style.base16.color14} }
|
#custom-weather { border-color: ${style.base16.color14} }
|
||||||
|
#custom-gpg-status { border-color: ${style.base16.color2} }
|
||||||
#pulseaudio { border-color: ${style.base16.color2} }
|
#pulseaudio { border-color: ${style.base16.color2} }
|
||||||
#temperature { border-color: ${style.base16.color4} }
|
#temperature { border-color: ${style.base16.color4} }
|
||||||
#battery { border-color: ${style.base16.color6} }
|
#battery { border-color: ${style.base16.color6} }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue