Wire taffybar usage menu fixes

This commit is contained in:
2026-05-01 20:15:30 -07:00
parent 030a67364e
commit 0a0024d009
4 changed files with 102 additions and 151 deletions

View File

@@ -50,7 +50,7 @@ import qualified System.Taffybar.Widget.ASUS as ASUS
import System.Taffybar.Widget.AnthropicUsage
( AnthropicUsageDisplayMode (AnthropicUsageDisplayRemaining),
AnthropicUsageStackConfig (..),
anthropicUsageStackNewWith,
anthropicUsageSectionNewWith,
defaultAnthropicUsageStackConfig,
)
import System.Taffybar.Widget.CPUMonitor (cpuMonitorNew)
@@ -60,7 +60,7 @@ import System.Taffybar.Widget.OpenAIUsage
( OpenAIUsageDisplayMode (OpenAIUsageDisplayRemaining),
OpenAIUsageStackConfig (..),
defaultOpenAIUsageStackConfig,
openAIUsageStackNewWith,
openAIUsageSectionNewWith,
)
import qualified System.Taffybar.Widget.PulseAudio as PulseAudio
import System.Taffybar.Widget.SNIMenu (withNmAppletMenu)
@@ -582,17 +582,21 @@ usageSectionWidget klass iconFile tooltip stackBuilder =
widgetSetClassGI section "usage-section"
openAIUsageWidget :: TaffyIO Gtk.Widget
openAIUsageWidget =
usageSectionWidget "openai-usage" "openai-symbol.svg" "OpenAI usage" $
openAIUsageStackNewWith
openAIUsageWidget = do
iconWidget <- liftIO $ usageLogoWidget "openai-symbol.svg" "OpenAI usage"
decorateWithClassAndBoxM "openai-usage" $
openAIUsageSectionNewWith
iconWidget
defaultOpenAIUsageStackConfig
{ openAIUsageStackDefaultDisplayMode = OpenAIUsageDisplayRemaining
}
anthropicUsageWidget :: TaffyIO Gtk.Widget
anthropicUsageWidget =
usageSectionWidget "anthropic-usage" "claude-symbol.svg" "Anthropic usage" $
anthropicUsageStackNewWith
anthropicUsageWidget = do
iconWidget <- liftIO $ usageLogoWidget "claude-symbol.svg" "Anthropic usage"
decorateWithClassAndBoxM "anthropic-usage" $
anthropicUsageSectionNewWith
iconWidget
defaultAnthropicUsageStackConfig
{ anthropicUsageStackDefaultDisplayMode = AnthropicUsageDisplayRemaining
}

220
nixos/flake.lock generated
View File

@@ -286,15 +286,15 @@
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "NixOS",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "edolstra",
"owner": "NixOS",
"repo": "flake-compat",
"type": "github"
}
@@ -304,13 +304,13 @@
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "NixOS",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "NixOS",
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
@@ -318,11 +318,11 @@
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
@@ -453,24 +453,6 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-blame-rank": {
"inputs": {
"fenix": "fenix",
@@ -614,7 +596,6 @@
"gitignore_2": {
"inputs": {
"nixpkgs": [
"imalison-taffybar",
"taffybar",
"weeder-nix",
"pre-commit-hooks",
@@ -660,7 +641,7 @@
"hercules-ci-effects_2": {
"inputs": {
"flake-parts": "flake-parts_5",
"nixpkgs": "nixpkgs_6"
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1701009247,
@@ -1160,7 +1141,9 @@
"nixpkgs": [
"nixpkgs"
],
"taffybar": "taffybar",
"taffybar": [
"taffybar"
],
"xmonad": [
"xmonad"
]
@@ -1241,10 +1224,10 @@
},
"nix": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts",
"git-hooks-nix": "git-hooks-nix",
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_3",
"nixpkgs-23-11": "nixpkgs-23-11",
"nixpkgs-regression": "nixpkgs-regression"
},
@@ -1301,7 +1284,7 @@
},
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-compat": "flake-compat_3",
"nixpkgs": [
"nixpkgs"
]
@@ -1419,22 +1402,6 @@
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1776877367,
"narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0726a0ecb6d4e08f6adced58726b95db924cef57",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1771903837,
"narHash": "sha256-jEA8WggGKtMFeNeCKq3NK8cLEjJmG6/RLUElYYbBZ0E=",
@@ -1447,7 +1414,7 @@
"url": "https://channels.nixos.org/nixos-25.11/nixexprs.tar.xz"
}
},
"nixpkgs_5": {
"nixpkgs_4": {
"locked": {
"lastModified": 1776877367,
"narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=",
@@ -1463,7 +1430,7 @@
"type": "github"
}
},
"nixpkgs_6": {
"nixpkgs_5": {
"locked": {
"lastModified": 1697723726,
"narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=",
@@ -1479,7 +1446,7 @@
"type": "github"
}
},
"nixpkgs_7": {
"nixpkgs_6": {
"locked": {
"lastModified": 1703255338,
"narHash": "sha256-Z6wfYJQKmDN9xciTwU3cOiOk+NElxdZwy/FiHctCzjU=",
@@ -1495,11 +1462,27 @@
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1730768919,
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixtheplanet": {
"inputs": {
"flake-parts": "flake-parts_4",
"hercules-ci-effects": "hercules-ci-effects_2",
"nixpkgs": "nixpkgs_7",
"nixpkgs": "nixpkgs_6",
"osx-kvm": "osx-kvm"
},
"locked": {
@@ -1543,7 +1526,7 @@
"noctalia",
"nixpkgs"
],
"systems": "systems_3",
"systems": "systems_2",
"treefmt-nix": "treefmt-nix"
},
"locked": {
@@ -1706,12 +1689,9 @@
},
"pre-commit-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat_4",
"gitignore": "gitignore_2",
"nixpkgs": [
"imalison-taffybar",
"nixpkgs"
]
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1747372754,
@@ -1799,16 +1779,17 @@
"nixified-ai": "nixified-ai",
"nixos-hardware": "nixos-hardware",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_5",
"nixpkgs": "nixpkgs_4",
"nixtheplanet": "nixtheplanet",
"noctalia": "noctalia",
"notifications-tray-icon": "notifications-tray-icon",
"org-agenda-api": "org-agenda-api",
"railbird-secrets": "railbird-secrets",
"systems": "systems_4",
"systems": "systems_3",
"taffybar": "taffybar",
"vscode-server": "vscode-server",
"xmonad": "xmonad_2",
"xmonad-contrib": "xmonad-contrib_2",
"xmonad": "xmonad",
"xmonad-contrib": "xmonad-contrib",
"xmonad-river": "xmonad-river"
}
},
@@ -1882,21 +1863,6 @@
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@@ -1911,7 +1877,7 @@
"type": "github"
}
},
"systems_4": {
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@@ -1928,24 +1894,29 @@
},
"taffybar": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3",
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"weeder-nix": "weeder-nix",
"xmonad": "xmonad",
"xmonad-contrib": "xmonad-contrib"
"xmonad": [
"xmonad"
],
"xmonad-contrib": [
"xmonad-contrib"
]
},
"locked": {
"lastModified": 1777686352,
"narHash": "sha256-r9Mt/BruZoc9bYEN9/J+VfztfXPjdiyDGoJTP7Co1yc=",
"owner": "taffybar",
"repo": "taffybar",
"rev": "8c0297965b40e84d4f8c4b7644a5364976c3ce86",
"type": "github"
"lastModified": 1777691335,
"narHash": "sha256-ckOZbjHCBs8CoKxSAEMEqNyIjT48mLWkL+tE9/bBkN0=",
"path": "/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar",
"type": "path"
},
"original": {
"owner": "taffybar",
"repo": "taffybar",
"type": "github"
"path": "/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar",
"type": "path"
}
},
"treefmt-nix": {
@@ -1996,7 +1967,6 @@
"weeder-nix": {
"inputs": {
"nixpkgs": [
"imalison-taffybar",
"taffybar",
"nixpkgs"
],
@@ -2058,7 +2028,20 @@
}
},
"xmonad": {
"flake": false,
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"nixpkgs": [
"nixpkgs"
],
"unstable": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1776502138,
"narHash": "sha256-mSOpNU1iJvfFh5uwayA6aPxneFMduNW1kG1gV2tGE+c=",
@@ -2069,29 +2052,11 @@
},
"original": {
"owner": "xmonad",
"ref": "master",
"repo": "xmonad",
"type": "github"
}
},
"xmonad-contrib": {
"flake": false,
"locked": {
"lastModified": 1769258911,
"narHash": "sha256-YGEKXs4UmS5QOIELJTdCiMzTktuue+Bd3yFoIKSHuBU=",
"owner": "xmonad",
"repo": "xmonad-contrib",
"rev": "803bc3d12bdcc512ec06856c4f119d37de1ba338",
"type": "github"
},
"original": {
"owner": "xmonad",
"ref": "master",
"repo": "xmonad-contrib",
"type": "github"
}
},
"xmonad-contrib_2": {
"inputs": {
"flake-utils": [
"flake-utils"
@@ -2146,35 +2111,6 @@
"path": "/home/imalison/Projects/xmonad-river",
"type": "path"
}
},
"xmonad_2": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"nixpkgs": [
"nixpkgs"
],
"unstable": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1776502138,
"narHash": "sha256-mSOpNU1iJvfFh5uwayA6aPxneFMduNW1kG1gV2tGE+c=",
"owner": "xmonad",
"repo": "xmonad",
"rev": "a618fb32662e44eb5d8276a3dc1925b0233e638b",
"type": "github"
},
"original": {
"owner": "xmonad",
"repo": "xmonad",
"type": "github"
}
}
},
"root": "root",

View File

@@ -172,10 +172,21 @@
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
taffybar.follows = "taffybar";
xmonad.follows = "xmonad";
};
};
taffybar = {
url = "path:/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
xmonad.follows = "xmonad";
xmonad-contrib.follows = "xmonad-contrib";
};
};
notifications-tray-icon = {
url = "github:colonelpanic8/notifications-tray-icon";
inputs = {