#!/usr/bin/env bash echo "-- initiate -- " date echo "" tui_name=$1 if [[ -z ${tui_name} ]]; then echo "Usage: $(basename "$0") [tui-name]" exit 1 fi # TODO: # popup centered, dim-around using hypr, 70% size # objective: on-click, open corresponding application # must be a single-instance # must be uwsm # flow: # * user clicks the icon on waybar # * sh check for alive instance # * if ANY INSTANCE ALIVE and INSTANCE IS SAME, focus using hyprctl # * elif ANY INSTANCE ALIVE and INSTANCE IS DIFFERENT, exit the previous instance and launch the new one # * else launch normally launch() { echo "[LOG: $(date)] launching..." } checker() { echo "[LOG: $(date)] checking..." } wrapper() { echo "[LOG: $(date)]" exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.hakase."${tui_name}" } run() { launch checker } run