Skip to content

Commit

Permalink
poc(waybar): add spacestatus to waybar
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenhoenle committed Aug 4, 2024
1 parent 60c85a7 commit 5b76d39
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 3 additions & 2 deletions home/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ in
curl
dnsutils

insomnia
bruno

screenfetch
neofetch
Expand All @@ -45,12 +45,13 @@ in
podman-compose

pkgs.spotify

pkgs.jetbrains.idea-community-bin
] ++ (if osConfig.ruben.host.work then [
# work applications
pkgs.teams-for-linux
pkgs.postman
pkgs.dbeaver-bin
pkgs.jetbrains.idea-community-bin
pkgs.thunderbird
] else [
# private applications
Expand Down
4 changes: 2 additions & 2 deletions home/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
};

# git remotes
github = {
"github.com" = {
hostname = "github.com";
port = 22;
};
Expand All @@ -49,7 +49,7 @@
port = 22;
identityFile = [ "~/.ssh/id_ed25519_sk" ];
};
gitlab = {
"gitlab.com" = {
hostname = "gitlab.com";
port = 22;
};
Expand Down
9 changes: 9 additions & 0 deletions home/sway/waybar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# connecting
"network"
"custom/vpn"
"custom/spacestatus"
"bluetooth"
# media
"idle_inhibitor"
Expand Down Expand Up @@ -48,6 +49,14 @@
fi
'';
};
"custom/spacestatus" = {
interval = 10;
tooltip = false;
format = "SPACESTATUS: {}";
exec = pkgs.writeShellScript "spacestatus-waybar" ''
${pkgs.curl}/bin/curl -s https://spaceapi.sfz-aalen.space/api/spaceapi.json | ${pkgs.jq}/bin/jq '.state.open'
'';
};
"custom/nixstore" = {
exec = "${pkgs.coreutils}/bin/du -sh /nix/store | ${pkgs.gnused}/bin/sed 's/\\([0-9]\\+[A-Z]\\+\\).*/\\1/'";
interval = 300;
Expand Down
2 changes: 2 additions & 0 deletions home/sway/waybar/waybar.css-style.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ in
/* Each module */
#custom-nixstore,
#custom-vpn,
#custom-spacestatus,
#custom-clipboard,
#custom-dnd,
#bluetooth,
Expand All @@ -84,6 +85,7 @@ in
/* Joined modules */
#custom-nixstore,
#custom-vpn,
#custom-spacestatus,
#custom-dnd,
#bluetooth,
#battery,
Expand Down

0 comments on commit 5b76d39

Please sign in to comment.