aboutsummaryrefslogtreecommitdiffstats
path: root/element-desktop/bash-aliases
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-06-25 16:28:08 +0200
committerMattias Andrée <maandree@kth.se>2021-06-25 16:28:08 +0200
commit1357517ecf7706c453c1c2d37ce45f81f9c44ea1 (patch)
tree29e33991c6f2b4a0116f3e917c36029a8a3bdb49 /element-desktop/bash-aliases
parentCheck that rotd/config and libcontacts/contacts have been created (diff)
downloaddotfiles-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 'element-desktop/bash-aliases')
-rw-r--r--element-desktop/bash-aliases18
1 files changed, 18 insertions, 0 deletions
diff --git a/element-desktop/bash-aliases b/element-desktop/bash-aliases
new file mode 100644
index 0000000..b58dfbd
--- /dev/null
+++ b/element-desktop/bash-aliases
@@ -0,0 +1,18 @@
+# -*- shell-script -*-
+
+mount-element () {
+ asroot env XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR}" ELEMENT_DIR=~/.var/element sh -ec '
+ device="$(losetup --show -f -P "${ELEMENT_DIR}/ElementCrypt.img")"
+ printf "%s\n" "${device}" > "${XDG_RUNTIME_DIR}/ElementCrypt"
+ gpg --decrypt "${ELEMENT_DIR}/ElementCrypt.key" | cryptsetup -d - open "${device}" ElementCrypt
+ mount /dev/mapper/ElementCrypt "${ELEMENT_DIR}/ElementCrypt.d"
+ '
+}
+
+umount-element () {
+ asroot env XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR}" ELEMENT_DIR=~/.var/element sh -c '
+ umount "${ELEMENT_DIR}/ElementCrypt.d"
+ cryptsetup close ElementCrypt
+ losetup --detach "$(cat -- "${XDG_RUNTIME_DIR}/ElementCrypt")"
+ '
+}