browser: make generic and remove redundant scripts

This commit is contained in:
Lucas 2020-07-27 21:45:43 +00:00
parent 6a795d70f0
commit 0c497ffde9
4 changed files with 24 additions and 38 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh
# browser
# Written in 2019 by Lucas
# Written in 2019-2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
@ -10,6 +10,18 @@
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
scp ~/.Xauthority _browser@localhost:
ssh -n _browser@localhost -- \
env DISPLAY=${DISPLAY:-:0} /usr/local/bin/firefox "$@"
case ${0##*/} in
tor-browser)
user=_tor_browser
browser=/usr/local/bin/tor-browser
;;
*)
user=_browser
browser=/usr/local/bin/firefox
;;
esac
dpy=${DISPLAY:-:0}
xauth extract - "$dpy" |
ssh -l "$user" localhost -- \
xauth merge - '&&' env DISPLAY="$dpy" "$browser" "$@"