prism-tui
A specialized wrapper for launching Terminal User Interface (TUI) applications. Instead of running a TUI command inside your current terminal, this script spawns a new, detached Ghostty terminal window specifically dedicated to that application. Crucially, it assigns a predictable Wayland app_id (window class) to this new window, enabling precise window management rules in Hyprland (e.g., forcing floating mode or specific sizing).
How it works
- ID Generation: It takes the command name (e.g.,
btop) and constructs a unique Application ID:org.prism.btop. - Terminal Check: It verifies that
ghostty(the default terminal for Prism) is installed. If not, it errors out. - Detached Launch:
- It executes
ghosttywith the--classflag set to the generated ID. - It uses the
-eflag to pass the command and all its arguments directly to the terminal. - It uses
setsidand&to run the process in the background, fully detached from the parent shell. This means closing the terminal you launched it from won't kill the TUI window.
- It executes
Dependencies
ghostty: The required terminal emulator.coreutils: Forbasename.util-linux: Forsetsid.
Usage
prism-tui <command> [arguments...]
Integration with Hyprland
The primary power of this script lies in the app_id it generates. You can use this ID in your hyprland.conf to define window rules.
Example Rule: To make all prism-tui windows float and center:
windowrule {
name = prism_tui
match:class = ^(org.prism.)(impala|bluetui)$
stay_focused = on
# Behavior
float = 1
center = 1
dim_around = 0
# Styling
size = 900 600
rounding = 15
}