diff options
author | Patrick Spek <p.spek@tyil.nl> | 2020-03-02 13:53:12 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2021-08-14 11:59:32 +0200 |
commit | 2e2e29e43e99cfd647cf37a3bd864f0778118574 (patch) | |
tree | 1a4e5fef9d6523190a5deb31816494e2033c4a80 /.local | |
parent | 72af6d06ac340f029d521cdaac4cb63f2c4b3d06 (diff) |
Rewrite wrapper for Signal
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/signal | 66 |
1 files changed, 25 insertions, 41 deletions
diff --git a/.local/bin/signal b/.local/bin/signal index 452b556..bf8d198 100755 --- a/.local/bin/signal +++ b/.local/bin/signal @@ -1,53 +1,37 @@ -#! /usr/bin/env sh +#!/bin/sh + +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU Affero General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +# details. + +readonly BINS=" + /usr/bin/signal-desktop +" main() { - # Handle opts - opts "$@" - shift "$OPTS" - unset OPTS - - # Show help - [ "$OPT_HELP_ONLY" ] && usage && exit 0 - - export TMPDIR=${XDG_CACHE_HOME:-$HOME/.local/tmp} + for bin in $BINS + do + [ -x "$bin" ] || continue - mkdir -p -- "/run/user/$UID/doc/by-app/org.signal.Signal" + export TMPDIR="${XDG_CACHE_HOME:-$HOME/.local/tmp}" + mkdir -p -- "/run/user/$UID/doc/by-app/org.signal.Signal" - exec signal-desktop -} + exec "$bin" "$@" + done -opts() -{ - OPTS=0 + printf "No underlying executable found for %s:\n" "${0##*/}" >&2 - while getopts ":h" opt + for bin in $BINS do - case "$opt" in - h) OPT_HELP_ONLY=1 ;; - *) - printf "Invalid option passed: %s\n" "$OPTARG" >&2 - ;; - esac + printf "\t%s\n" "$bin" >&2 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 "$@" |