/ de-omarchy / bin / omarchy-install-and-launch
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
22 lines · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# omarchy:summary=Install a packaged app and launch it once it finishes
# omarchy:args=<display-name> <packages> <desktop-id>
# omarchy:examples=omarchy install and launch Cursor cursor-bin cursor

name="${1-}"
packages="${2-}"
desktop_id="${3-}"

if [[ -z $name || -z $packages || -z $desktop_id ]]; then
  echo "Usage: omarchy-install-and-launch <display-name> <packages> <desktop-id>" >&2
  exit 1
fi

printf -v install_message '%q' "Installing ${name}..."
printf -v desktop_id_arg '%q' "$desktop_id"

# The subshell keeps & from backgrounding the package installation too.
exec omarchy-launch-floating-terminal-with-presentation \
  "echo ${install_message}; omarchy-pkg-add ${packages} && (setsid uwsm-app -- gtk-launch ${desktop_id_arg} >/dev/null 2>&1 &)"