aboutsummaryrefslogtreecommitdiffstats
path: root/wire-desktop
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-03-20 18:33:03 +0100
committerMattias Andrée <m@maandree.se>2026-03-20 18:33:03 +0100
commit0ef0abf62c0a9f1c083ae00f39b4149d4b8e98cb (patch)
tree85dc151bac93a19e95916424974eee4b249ac340 /wire-desktop
parentUse yellow colour on hostname if logged in remotely (diff)
downloaddotfiles-0ef0abf62c0a9f1c083ae00f39b4149d4b8e98cb.tar.gz
dotfiles-0ef0abf62c0a9f1c083ae00f39b4149d4b8e98cb.tar.bz2
dotfiles-0ef0abf62c0a9f1c083ae00f39b4149d4b8e98cb.tar.xz
Use gasroot instead of asroot when not in foreground
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rwxr-xr-xwire-desktop/mount-wire6
-rwxr-xr-xwire-desktop/umount-wire7
2 files changed, 11 insertions, 2 deletions
diff --git a/wire-desktop/mount-wire b/wire-desktop/mount-wire
index a6dde57..776792c 100755
--- a/wire-desktop/mount-wire
+++ b/wire-desktop/mount-wire
@@ -3,7 +3,11 @@
if mountpoint -q -- "${HOME}/.var/opt/wire/WireCrypt.d"; then
printf '%s\n' 'mount-wire: already mounted' >&2
elif test -e /dev/mapper/WireCrypt; then
- asroot env WIRE_DIR="${HOME}/.var/opt/wire" sh -ec \
+ asroot=asroot
+ if ! isfg; then
+ asroot=gasroot
+ fi
+ $asroot env WIRE_DIR="${HOME}/.var/opt/wire" sh -ec \
'mount -- /dev/mapper/WireCrypt "${WIRE_DIR}/WireCrypt.d"'
else
gpg --decrypt -- "${HOME}/.var/opt/wire/WireCrypt.key" | \
diff --git a/wire-desktop/umount-wire b/wire-desktop/umount-wire
index 796ea05..ce7f0c0 100755
--- a/wire-desktop/umount-wire
+++ b/wire-desktop/umount-wire
@@ -1,6 +1,11 @@
#!/bin/dash
-asroot env \
+asroot=asroot
+if ! isfg; then
+ asroot=gasroot
+fi
+
+$asroot env \
WIRE_DIR="${HOME}/.var/opt/wire" \
WIRE_DEV="$(losetup | sed 's/\s\+/ /g' | cut -d ' ' -f 1,6 | \
sed -n 's#\(/[^ ]*\) '"$(realpath -- "${HOME}/.var/opt/wire/WireCrypt.img")"'$#\1#p' | sed 1q)" \