From 8204fe0df7268234cbc73e990b3c8cc423e26dfd Mon Sep 17 00:00:00 2001 From: Eric Lay Date: Tue, 18 Apr 2023 00:15:37 -0500 Subject: [PATCH] preparing for pkg --- PKGBUILD | 30 ++++++++++++++++++++++++++++++ fuzzy-pokedex | 12 ++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 PKGBUILD diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..743fa9b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: Eric Lay +pkgname=fuzzy-pokedex-git +_pkgname=fuzzy-pokedex +pkgver=r16.0c9b118 +pkgrel=1 +pkgdesc="A Pokedex for your terminal" +arch=('any') +url="https://github.com/ericlay/$_pkgname" +license=('GPL3') +depends=('python-beautifulsoup4' + 'fzf' + 'parallel' + 'pokemon-colorscripts-git' + 'ttf-font-nerd') +makedepends=('git') +source=("git+$url.git") +md5sums=('SKIP') + +pkgver(){ + cd "$_pkgname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +package() { + cd "$srcdir/$_pkgname" + mkdir -p "$pkgdir/usr/share/$_pkgname/pokeData" + install -Dm644 pokeData/* -t "$pkgdir/usr/share/$_pkgname/pokeData" + install -Dm755 fuzzy-pokedex -t "$pkgdir/usr/bin" + install -Dm755 pokeinfo -t "$pkgdir/usr/bin" +} diff --git a/fuzzy-pokedex b/fuzzy-pokedex index d4916ca..02a4847 100755 --- a/fuzzy-pokedex +++ b/fuzzy-pokedex @@ -11,10 +11,12 @@ help() { echo -e "\tctrl-n\tShows small sprite version\n\tctrl-b\tShows large sprite version\n\tctrl-s\tShows shiny sprite version\n\tctrl-h\tShows this help screen in preview window\n" } +### Set pokeData location +POKEDATA="/usr/share/fuzzy-pokedex/pokeData/" + ### Pokedex viewer using pokemon-colorscripts and fzf fuzzy_pokedex() { - POKEDATA="/home/ez/Git/fuzzy-pokedex/pokeData/" - pokemon-colorscripts -l | sort | + pokemon-colorscripts -l | fzf -q "$1" +m -s -i \ --cycle \ --reverse \ @@ -40,13 +42,11 @@ fuzzy_pokedex() { ### Update Pokemon stats file set update_pokeData() { - POKEINFO="/home/ez/Git/fuzzy-pokedex/pokeinfo" - POKEDATA="/home/ez/Git/fuzzy-pokedex/pokeData/" echo -e "\n\t\tWARNING!!!\n\tThis WILL take a long time\n" if [[ -n "$1" ]]; then - pokemon-colorscripts -l | sort | parallel --bar --color --retry-failed -j "$1" "$POKEINFO" {} ">" "$POKEDATA"{} + pokemon-colorscripts -l | sort | parallel --bar --color --retry-failed -j "$1" pokeinfo {} ">" "$POKEDATA"{} else - pokemon-colorscripts -l | sort | parallel --bar --color --retry-failed -j 200% "$POKEINFO" {} ">" "$POKEDATA"{} + pokemon-colorscripts -l | sort | parallel --bar --color --retry-failed -j 200% pokeinfo {} ">" "$POKEDATA"{} fi }