fix: music-launcher

This commit is contained in:
kenji
2025-12-27 22:11:03 -06:00
parent 34a0243c43
commit 59340e4d6d
7 changed files with 42 additions and 38 deletions
+40
View File
@@ -0,0 +1,40 @@
{pkgs, ...}: let
launch-music = pkgs.writeShellScriptBin "launch-music" ''
# Log output for debugging
LOGfile="/tmp/launch-music.log"
exec > >(tee -a "$LOGfile") 2>&1
echo "--- Launching Music Apps ---"
date
# Launch Jellyfin
echo "Launching jellyfin-tui..."
uwsm app -- /usr/bin/env ghostty --class=jellyfin-tui --title=jellyfin-tui -e jellyfin-tui &
PID_JELLY=$!
echo "Jellyfin launched with PID $PID_JELLY"
# Wait for window to appear
echo "Waiting for window..."
sleep 3
# Focus
echo "Focusing jellyfin-tui..."
hyprctl dispatch focuswindow title:jellyfin-tui
# Preselect Down
echo "Preselecting down..."
hyprctl dispatch layoutmsg preselect d
# Launch Cava
echo "Launching cava..."
uwsm app -- /usr/bin/env ghostty --class=cava --title=cava -e cava &
PID_CAVA=$!
echo "Cava launched with PID $PID_CAVA"
echo "Launch script completed."
'';
in {
home.packages = [
launch-music
];
}