aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-01-04 22:52:22 +0100
committerPatrick Spek <p.spek@tyil.nl>2020-01-04 22:52:22 +0100
commit8e0810966369796ce9e1b98cce85ed858357cfdd (patch)
tree866fd62994d6a8b77ea57ff4a10f54949e04ae34
parent7eaa516aecfb59b10f38a5c3652ed55adcd20792 (diff)
Add wrapper for Signal
-rw-r--r--.gitignore1
-rwxr-xr-x.local/bin/signal51
2 files changed, 52 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 6c30d49..ac23a72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,7 @@
!/.local/bin/mkchecksums
!/.local/bin/mkpasswd
!/.local/bin/new
+!/.local/bin/signal
!/.local/bin/ta
!/.local/bin/uncolor
!/.local/bin/up
diff --git a/.local/bin/signal b/.local/bin/signal
new file mode 100755
index 0000000..8653bde
--- /dev/null
+++ b/.local/bin/signal
@@ -0,0 +1,51 @@
+#! /usr/bin/env sh
+
+main()
+{
+ # Handle opts
+ opts "$@"
+ shift "$OPTS"
+ unset OPTS
+
+ # Show help
+ [ "$OPT_HELP_ONLY" ] && usage && exit 0
+
+ export TMPDIR=${XDG_CACHE_HOME:-$HOME/.local/tmp}
+
+ exec signal-desktop
+}
+
+opts()
+{
+ OPTS=0
+
+ while getopts ":h" opt
+ do
+ case "$opt" in
+ h) OPT_HELP_ONLY=1 ;;
+ *)
+ printf "Invalid option passed: %s\n" "$OPTARG" >&2
+ ;;
+ esac
+ done
+
+ unset opt
+}
+
+usage()
+{
+ cat <<EOF
+Usage:
+ $(basename "$0") -h
+
+Wrapper for signal[-desktop]. This starts the Signal desktop client, but
+applying some fixes here and there to make it actually start. Daily reminder
+that Electron is a cancer on our society, and people using it should be
+receiving electro-shock therapy.
+
+Options:
+ -h Show this help text and exit.
+EOF
+}
+
+main "$@"