From 39a7fe223b3585287681596580c454890722d26a Mon Sep 17 00:00:00 2001 From: scouckel Date: Wed, 3 Dec 2025 04:38:34 -0600 Subject: MASSIVE waybar changes --- modules/home-manager/hypr/waybar-hyprland.nix | 88 ++++++++++++++++++++++----- modules/home-manager/spicetify.nix | 4 +- 2 files changed, 74 insertions(+), 18 deletions(-) diff --git a/modules/home-manager/hypr/waybar-hyprland.nix b/modules/home-manager/hypr/waybar-hyprland.nix index 39c79fe..e7f504d 100644 --- a/modules/home-manager/hypr/waybar-hyprland.nix +++ b/modules/home-manager/hypr/waybar-hyprland.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { programs.waybar = { @@ -10,34 +10,90 @@ position = "top"; height = 15; - modules-left = [ "hyprland/workspaces" ]; + modules-left = [ "hyprland/workspaces" "idle_inhibitor" ]; modules-center = [ "hyprland/window" ]; - modules-right = [ "pulseaudio" "battery" "clock" ]; - - "battery" = { - "bat" = "BAT2"; - "interval" = 60; - "states" = { - "warning" = 30; - "critical" = 15; - }; - "format" = "{capacity}% {icon}"; - "format-icons" = ["" "" "" "" ""]; - "max-length" = 25; + modules-right = [ "custom/spotify" "pulseaudio" "battery" "clock" ]; + + battery = { + interval = 60; + format = "{capacity}% {icon}"; + format-charging = "{capacity}% {icon}"; + format-icons = [" " " " " " " " " "]; + max-length = 25; + }; + + clock = { + format = "{:%H:%M}"; + tooltip = true; + tooltip-format = "{:%a, %b %d\nDay %j, Week %U\n%Z, UTC%z}"; }; "hyprland/window" = { on-click = "rofi -show window"; + max-length = 64; + }; + + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = " "; + deactivated = " "; + }; }; - "pulseaudio" = { + pulseaudio = { format = "{volume}% {icon}"; format-bluetooth = "{volume}% {icon}"; format-muted = ""; format-icons = { - default = ["" ""]; + default = [" " " "]; }; }; + + "custom/spotify" = { + format = "{}"; + escape = true; + exec-if = "pgrep spotify"; + interval = 1; + on-click = "playerctl --player=spotify_player,spotify play-pause"; + on-click-right = "playerctl --player=spotify_player,spotify loop track"; + on-double-click-right = "playerctl --player=spotify_player,spotify loop playlist"; + on-click-middle = "playerctl --player=spotify_player,spotify shuffle toggle"; + on-scroll-up = "playerctl --player=spotify_player,spotify next"; + on-scroll-down = "playerctl --player=spotify_player,spotify previous"; + exec = "${pkgs.writeShellScriptBin "spotifyplayer" '' + shorten() { + if [ ''${#1} -le 16 ]; then + printf "%s" "$1" + else + local truncated="''${1:0:13}" + if [ "''${truncated: -1}" = " " ]; then + truncated="''${truncated:0:12}" + fi + printf "%s…" "$truncated" + fi + } + + player_status=$(playerctl --player=spotify_player,spotify status 2> /dev/null) + artist="$(shorten "$(playerctl --player=spotify_player,spotify metadata artist)")" + title="$(shorten "$(playerctl --player=spotify_player,spotify metadata title)")" + info="$artist - $title" + + if [ "$(playerctl --player=spotify_player,spotify shuffle)" = "On" ]; then + info="$info  " + fi + + if [ "$player_status" != "Playing" ]; then + info="$info  " + fi + + if [ "$(playerctl --player=spotify_player,spotify loop)" = "Track" ]; then + info="$info 󱍸 " + fi + + echo "$info  " + ''}/bin/spotifyplayer"; + }; }; }; diff --git a/modules/home-manager/spicetify.nix b/modules/home-manager/spicetify.nix index 2181827..4b54e6a 100644 --- a/modules/home-manager/spicetify.nix +++ b/modules/home-manager/spicetify.nix @@ -11,8 +11,8 @@ in { enable = true; - theme = spicepkgs.themes.sleek; - colorScheme = "Deep"; + # theme = spicepkgs.themes.sleek; + # colorScheme = "Deep"; enabledExtensions = with spicepkgs.extensions; [ shuffle -- cgit v1.3