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

@ -15,9 +15,9 @@
PREFIX = $(HOME) PREFIX = $(HOME)
MANPREFIX = $(PREFIX)/local MANPREFIX = $(PREFIX)/local
BIN = ZZZ browser credentials fetch flac2ogg imgresize invidious \ BIN = ZZZ browser credentials fetch flac2ogg imgresize invidious \
plumb pstsrv riot-web-ui rfcopen screenshot sekrit tor-browser \ plumb pstsrv rfcopen screenshot sekrit w3m-copy-link
w3m-copy-link
MAN1 = sekrit.1 MAN1 = sekrit.1
BROWSER_LINKS = tor-browser
all: $(BIN) all: $(BIN)
@ -27,10 +27,14 @@ clean:
install: all install: all
mkdir -p $(PREFIX)/bin mkdir -p $(PREFIX)/bin
cp -f $(BIN) $(PREFIX)/bin cp -f $(BIN) $(PREFIX)/bin
cd $(PREFIX)/bin && chmod 555 $(BIN) for t in $(BROWSER_LINKS); do \
rm -f $(PREFIX)/bin/$$t; \
ln $(PREFIX)/bin/browser $(PREFIX)/bin/$$t; \
done
cd $(PREFIX)/bin && chmod 555 $(BIN) $(BROWSER_LINKS)
mkdir -p $(MANPREFIX)/man/man1 mkdir -p $(MANPREFIX)/man/man1
cp -f $(MAN1) $(MANPREFIX)/man/man1 cp -f $(MAN1) $(MANPREFIX)/man/man1
cd $(MANPREFIX)/man/man1 && chmod 444 $(MAN1) cd $(MANPREFIX)/man/man1 && chmod 444 $(MAN1)
uninstall: uninstall:
cd $(PREFIX)/bin && rm -f $(BIN) cd $(PREFIX)/bin && rm -f $(BIN) $(BROWSER_LINKS)

View File

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

View File

@ -1,15 +0,0 @@
#!/bin/sh
# browser
# Written in 2019 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
scp ~/.Xauthority _riot_web_ui@localhost:
ssh -n _riot_web_ui@localhost -- \
env DISPLAY=${DISPLAY:-:0} /usr/local/bin/firefox "$@"

View File

@ -1,15 +0,0 @@
#!/bin/sh
# tor-browser
# Written in 2019 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# 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/tor-browser "$@"