aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzlg <zlg@zlg.space>2020-03-08 08:25:56 -0700
committerzlg <zlg@zlg.space>2020-03-08 08:25:56 -0700
commitba0c8f06015763bf30d280af8bf5eb093e6c119b (patch)
tree901304ad1d57dae2848d1d6afce01d8ff79a8f5b
parentAvoid a backtrace when editing notes on an invalid game (diff)
downloadvgstash-ba0c8f06015763bf30d280af8bf5eb093e6c119b.tar.gz
vgstash-ba0c8f06015763bf30d280af8bf5eb093e6c119b.tar.bz2
vgstash-ba0c8f06015763bf30d280af8bf5eb093e6c119b.tar.xz
vgstash-ba0c8f06015763bf30d280af8bf5eb093e6c119b.zip
helpers.sh: Add vgub, vgmulti, vgrand
vgub - Games that are beaten or complete, excluding rereleases i.e. Super Mario Bros on NES and Wii VC will only show one or the other. vgmulti - Games you own on more than one system vgrand - Suggests a random game to play from your 'playlog' filter
-rw-r--r--scripts/helpers.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/helpers.sh b/scripts/helpers.sh
index 3b2d335..b726f0b 100644
--- a/scripts/helpers.sh
+++ b/scripts/helpers.sh
@@ -25,3 +25,32 @@ function vgsrc() {
function vgadd() {
vgstash add "$@"
}
+
+# Shows you a list of *unique* game titles that you have beaten or completed.
+# This allows you to weed out the games you own or have beaten on more than one
+# platform.
+function vgub() {
+ # TODO: improve
+ vgstash list -w 80 | head -n 2
+ vgstash list done -w 80 | sed -e '1,2d' | sort | uniq -w50 | sort -b -t'|' -k 2,2
+}
+
+# Shows you the games that have more than one entry (by title) in vgstash.
+# Helpful for seeing games you own or have owned more than one copy of.
+function vgmulti() {
+ # TODO: improve
+ if [ -n $1 ]; then
+ local filter="$1"
+ else
+ local filter="allgames"
+ fi
+ vgstash list -w 80 | head -n 2
+ vgstash list $filter -w 80 | sort | uniq -D -w50
+}
+
+# Prints the title and system of a random game that you need to beat.
+# This tool is great for deciding what to play to knock out the backlog.
+function vgrand() {
+ local game=$(vgstash list playlog | sed -e '1,2d' | shuf -n 1 --random-source=/dev/random | cut -d '|' -f 1-2 | tr -s ' ' | sed -e 's: | :, for :' -e 's:\s$::')
+ echo "You should play ${game}!"
+}