diff options
author | Mattias Andrée <maandree@kth.se> | 2021-06-25 16:28:08 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-06-25 16:28:08 +0200 |
commit | 1357517ecf7706c453c1c2d37ce45f81f9c44ea1 (patch) | |
tree | 29e33991c6f2b4a0116f3e917c36029a8a3bdb49 /wire-desktop | |
parent | Check that rotd/config and libcontacts/contacts have been created (diff) | |
download | dotfiles-1357517ecf7706c453c1c2d37ce45f81f9c44ea1.tar.gz dotfiles-1357517ecf7706c453c1c2d37ce45f81f9c44ea1.tar.bz2 dotfiles-1357517ecf7706c453c1c2d37ce45f81f9c44ea1.tar.xz |
Improve signal-desktop confs and add element-desktop and wire-desktop confs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'wire-desktop')
-rw-r--r-- | wire-desktop/Makefile | 19 | ||||
-rw-r--r-- | wire-desktop/bash-aliases | 18 |
2 files changed, 37 insertions, 0 deletions
diff --git a/wire-desktop/Makefile b/wire-desktop/Makefile new file mode 100644 index 0000000..ee40a34 --- /dev/null +++ b/wire-desktop/Makefile @@ -0,0 +1,19 @@ +.POSIX: + +install: + test -f ~/.var/wire/WireCrypt.img + test -f ~/.var/wire/WireCrypt.key + mkdir -p -- ~/.var/wire/WireCrypt.d + test -e ~/.config/Wire || ln -s -- ../.var/wire/WireCrypt.d/Wire ~/.config/Wire + pacman -Qq -- asroot </dev/null >/dev/null + pacman -Qq -- gnupg </dev/null >/dev/null + pacman -Qq -- cryptsetup </dev/null >/dev/null + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/wire-desktop + ln -sf -- ~/.dotfiles/wire-desktop/bash-aliases ~/.config/bash/aliases.d/wire-desktop + +uninstall: + -unlink -- ~/.config/bash/aliases.d/wire-desktop + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/wire-desktop/bash-aliases b/wire-desktop/bash-aliases new file mode 100644 index 0000000..00cd7a1 --- /dev/null +++ b/wire-desktop/bash-aliases @@ -0,0 +1,18 @@ +# -*- shell-script -*- + +mount-wire () { + asroot env XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR}" WIRE_DIR=~/.var/wire sh -ec ' + device="$(losetup --show -f -P "${WIRE_DIR}/WireCrypt.img")" + printf "%s\n" "${device}" > "${XDG_RUNTIME_DIR}/WireCrypt" + gpg --decrypt "${WIRE_DIR}/WireCrypt.key" | cryptsetup -d - open "${device}" WireCrypt + mount /dev/mapper/WireCrypt "${WIRE_DIR}/WireCrypt.d" + ' +} + +umount-wire () { + asroot env XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR}" WIRE_DIR=~/.var/wire sh -c ' + umount "${WIRE_DIR}/WireCrypt.d" + cryptsetup close WireCrypt + losetup --detach "$(cat -- "${XDG_RUNTIME_DIR}/WireCrypt")" + ' +} |