Skip to content

Commit

Permalink
cava-internal script made & added to waybar
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiahABrown committed Sep 7, 2023
1 parent d00c981 commit 21e36dd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 0 deletions home/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
imports = [
inputs.hyprland.homeManagerModules.default
./scripts
./zsh/zsh.nix
./hypr/hyprland.nix
./waybar
Expand All @@ -21,8 +22,10 @@

# User packages
home.packages = with pkgs; [
btop
htop
httpie
cava
];

}
12 changes: 12 additions & 0 deletions home/scripts/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ config, lib, pkgs, ...}:

let
cava-internal = pkgs.writeShellScriptBin "cava-internal" ''
cava -p ~/.config/cava/config | sed -u 's/;//g;s/0/▁/g;s/1/▂/g;s/2/▃/g;s/3/▄/g;s/4/▅/g;s/5/▆/g;s/6/▇/g;s/7/█/g;'
'';
in
{
home.packages = with pkgs; [
cava-internal
];
}
17 changes: 16 additions & 1 deletion home/waybar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
settings = {
mainBar = {
layer = "top";
modules-left = [ "custom/nix" "hyprland/workspaces" ];
modules-left = [ "custom/nix" "hyprland/workspaces" "custom/cava-internal"];
modules-center = [ "clock" ];
modules-right = [ "cpu" "memory" "backlight" "pulseaudio" "bluetooth" "network" "battery" ];

Expand All @@ -36,6 +36,10 @@
"10" = "十";
};
};
"custom/cava-internal" = {
"exec" = "sleep 1s && cava-internal";
"tooltip" = false;
};

"clock" = {
"format" = "<span color='#b4befe'> </span>{:%H:%M}";
Expand Down Expand Up @@ -119,6 +123,17 @@
color: #b4befe;
}
#custom-cava-internal {
padding-left: 10px;
padding-right: 10px;
padding-top: 1px;
font-family: "Hack Nerd Font";
color: #b4befe;
background-color: #11111b;
margin-top: 15px;
border-radius: 10px;
}
#workspaces button.active {
background: #11111b;
color: #b4befe;
Expand Down

0 comments on commit 21e36dd

Please sign in to comment.