fix: music-launcher
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
./hypr/animation.nix
|
||||
./hypr/misc.nix
|
||||
./hypr/input.nix
|
||||
./music.nix
|
||||
];
|
||||
wayland.windowManager.hyprland.enable = true;
|
||||
wayland.windowManager.hyprland.systemd.enable = false; # for UWSM support...
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"[workspace 1] uwsm app -- xdg-terminal-exec"
|
||||
|
||||
"[workspace special:steam silent] uwsm app -- steam"
|
||||
"music-launcher"
|
||||
"launch-music"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,18 +27,10 @@
|
||||
# --- MUSIC RULES (Jellyfin-TUI) ---
|
||||
"workspace special:music silent, title:^(jellyfin-tui)$"
|
||||
"workspace special:music silent, initialTitle:^(jellyfin-tui)$"
|
||||
"noinitialfocus, title:^(jellyfin-tui)$"
|
||||
"noinitialfocus, initialTitle:^(jellyfin-tui)$"
|
||||
"suppressevent activate, title:^(jellyfin-tui)$"
|
||||
"suppressevent activate, initialTitle:^(jellyfin-tui)$"
|
||||
|
||||
# --- CAVA RULES ---
|
||||
"workspace special:music silent, title:^(cava)$"
|
||||
"workspace special:music silent, initialTitle:^(cava)$"
|
||||
"noinitialfocus, title:^(cava)$"
|
||||
"noinitialfocus, initialTitle:^(cava)$"
|
||||
"suppressevent activate, title:^(cava)$"
|
||||
"suppressevent activate, initialTitle:^(cava)$"
|
||||
|
||||
# --- GAMING RULES ---
|
||||
# Steam Apps, Gamescope, Lutris, Heroic, and Wine/Proton apps
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
(writeShellScriptBin "music-launcher" ''
|
||||
# Launch Jellyfin TUI first
|
||||
uwsm app -- /usr/bin/env ghostty --class=jellyfin-tui --title=jellyfin-tui -e jellyfin-tui &
|
||||
|
||||
# Wait for window to appear
|
||||
sleep 0.5
|
||||
|
||||
# Focus the window to apply layout rules (Required for layoutmsg)
|
||||
# This ensures the preselect command applies to this specific window
|
||||
${pkgs.hyprland}/bin/hyprctl dispatch focuswindow title:jellyfin-tui
|
||||
|
||||
# Force the next window to be placed to the right (Side-by-Side / Horizontal)
|
||||
# Change to 'preselect d' for Top/Bottom split
|
||||
${pkgs.hyprland}/bin/hyprctl dispatch layoutmsg preselect r
|
||||
|
||||
# Launch Cava
|
||||
uwsm app -- /usr/bin/env ghostty --class=cava --title=cava -e cava &
|
||||
'')
|
||||
];
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
../modules/home/waybar.nix
|
||||
../modules/home/theme.nix
|
||||
../modules/home/gaming.nix
|
||||
../modules/home/music.nix
|
||||
inputs.walker.homeManagerModules.default
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
|
||||
@@ -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
|
||||
];
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "Hello world!"
|
||||
|
||||
exec
|
||||
|
||||
|
||||
Reference in New Issue
Block a user