aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/signal51
1 files changed, 51 insertions, 0 deletions
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 "$@"