Initial commit

blood
Adasauce 4 years ago
parent d0e1185f29
commit fafed3ac31
Signed by: adasauce
GPG Key ID: B4FD3151235211CB
  1. 25
      Makefile
  2. BIN
      icons/git.with.parts.png
  3. 59
      mknative
  4. 5
      runnative

@ -0,0 +1,25 @@
PREFIX?=${HOME}/.local
BINDIR?=$(PREFIX)/bin
SITEDIR?=$(BINDIR)/nativefier
SHAREDIR?=$(PREFIX)/share/mknative
ICONDIR?=$(SHAREDIR)/icons
RM?=rm -f
help:
@echo 'Makefile for mknative '
@echo ' '
@echo ' install '
@echo ' uninstall '
install:
mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(SITEDIR) $(DESTDIR)$(ICONDIR)
install -m755 mknative $(DESTDIR)$(BINDIR)/mknative
install -m755 runnative $(DESTDIR)$(BINDIR)/runnative
install -m755 icons/* $(DESTDIR)$(ICONDIR)
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/mknative
$(RM) $(DESTDIR)$(BINDIR)/runnative
.DEFAULT_GOAL := help

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

@ -0,0 +1,59 @@
#!/bin/bash
# Make a 'native app' wrapper using nativefier for a site.
usage() { echo "Usage: $0 -u -s https://example.com -n NativeExample"; exit 1; }
while getopts "us:n:" option; do
case ${option} in
u)
uninstall=1
echo "Uninstalling ..."
;;
s)
url=${OPTARG}
echo "URL: $url"
;;
n)
name=${OPTARG}
echo "Name: $name"
;;
*)
usage
;;
esac
done
if [ -n "${uninstall}" ]; then
if [ -z "${name}" ]; then
usage
fi
rm ~/.local/share/applications/$name.desktop
rm -r ~/.local/bin/nativefier/${name}-*/
exit 0
fi
if [ -z "${name}" ] || [ -z "${url}" ]; then
usage
fi
docker run --privileged -ti \
-v $HOME/.local/bin/nativefier:/target/ \
-v $HOME/.local/share/mknative/icons:/src \
jiahaog/nativefier:latest \
--name $name \
--icon /src/$name.png \
-p linux \
-a x64 \
$url \
/target/
echo "
[Desktop Entry]
Type=Application
Exec=$HOME/.local/bin/runnative $name
Icon=${HOME}/.local/share/mknative/icons/${name}.png
Terminal=false
Name=$name
" > ~/.local/share/applications/$name.desktop

@ -0,0 +1,5 @@
#!/bin/bash
site=$1
$HOME/.local/bin/nativefier/$site-linux-x64/$site &
Loading…
Cancel
Save