be.lt: show battery level in tmux
All checks were successful
flake / flake (push) Successful in 1m13s

This commit is contained in:
Jake Hillion 2024-07-17 15:58:38 +01:00
parent 13c937b196
commit 88ad6cd610
4 changed files with 15 additions and 1 deletions

View File

@ -15,6 +15,7 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
custom.defaults = true; custom.defaults = true;
custom.laptop = true;
## Impermanence ## Impermanence
custom.impermanence = { custom.impermanence = {

View File

@ -11,6 +11,7 @@
./hostinfo.nix ./hostinfo.nix
./ids.nix ./ids.nix
./impermanence.nix ./impermanence.nix
./laptop.nix
./locations.nix ./locations.nix
./resilio.nix ./resilio.nix
./services/default.nix ./services/default.nix

View File

@ -11,7 +11,14 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home-manager.users.jake.programs.tmux = { home-manager.users.jake.programs.tmux = {
enable = true; enable = true;
extraConfig = lib.readFile ./.tmux.conf;
extraConfig = lib.strings.concatLines [
(lib.readFile ./.tmux.conf)
''set -g status-right "${lib.strings.optionalString config.custom.laptop "#{battery_icon} #{battery_percentage} #{battery_remain} | "}\"#{=21:pane_title}\" %H:%M %d-%b-%y"''
];
plugins = with pkgs; lib.lists.optional config.custom.laptop tmuxPlugins.battery;
}; };
}; };
} }

5
modules/laptop.nix Normal file
View File

@ -0,0 +1,5 @@
{ pkgs, lib, config, ... }:
{
options.custom.laptop = lib.mkEnableOption "laptop";
}