#!/bin/bash

# omarchy:summary=Launch 1Password or start its installer when missing.

set -e

# 1Password reads the display scale itself, the way Electron apps do, and comes
# up oversized next to every other window on a scaled monitor. The packaged
# .desktop pins it too; this covers the hotkey, which runs the binary directly.
if omarchy-cmd-present 1password; then
  exec setsid uwsm-app -- 1password --force-device-scale-factor=1
else
  exec omarchy-launch-floating-terminal-with-presentation omarchy-install-service-1password
fi
