aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_local/bin/executable_snxctl-chromium
blob: c97b02676d66fea46f124889c0ff83b3e05489f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# snxctl-chromium: `snxctl connect` with the flatpak ungoogled-chromium as
# the SAML browser. Bypasses LibreWolf's loopback HTTPS-upgrade + LNA block
# that stop snx-rs's 127.0.0.1:7779 SAML callback from completing.
#
# snxctl runs `opener::open(url)` in-process; opener on Linux execs
# `xdg-open` first. We prepend a private bin dir containing only an
# `xdg-open` shim that flatpak-runs ungoogled-chromium. No daemon
# tweaks needed — the override is scoped to this snxctl invocation.
set -eu

SHIM_DIR="$HOME/.local/share/snx-rs/bin"

if [ ! -x "$SHIM_DIR/xdg-open" ]; then
  printf '%s: missing xdg-open shim at %s\n' "${0##*/}" "$SHIM_DIR/xdg-open" >&2
  exit 1
fi

PATH="$SHIM_DIR:$PATH"
export PATH
exec snxctl connect "$@"