From 0f3c6a38742b21bc4cde57795374cfa414e1783e Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Wed, 16 Oct 2024 00:59:04 -0500 Subject: [PATCH] add some shortcuts for use with termux:widget --- boxes/phone/out-of-tree/Makefile | 2 ++ .../out-of-tree/shortcuts/height-weight.sh | 19 +++++++++++++++++++ .../out-of-tree/shortcuts/input-expense.sh | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100755 boxes/phone/out-of-tree/shortcuts/height-weight.sh create mode 100755 boxes/phone/out-of-tree/shortcuts/input-expense.sh diff --git a/boxes/phone/out-of-tree/Makefile b/boxes/phone/out-of-tree/Makefile index 03c5748..0251ad7 100644 --- a/boxes/phone/out-of-tree/Makefile +++ b/boxes/phone/out-of-tree/Makefile @@ -49,3 +49,5 @@ termux-dots: ln -sf ~/.config/bash/profile ~/.bash_profile mkdir -p ~/.local/share cp $(CURDIR)/../../../home/wallpapers/pape.jpg ~/.local/share + mkdir -p ~/.shortcuts + cp $(CURDIR)/shortcuts/* ~/.shortcuts diff --git a/boxes/phone/out-of-tree/shortcuts/height-weight.sh b/boxes/phone/out-of-tree/shortcuts/height-weight.sh new file mode 100755 index 0000000..e7ab0e4 --- /dev/null +++ b/boxes/phone/out-of-tree/shortcuts/height-weight.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +today=$(date "+%m/%d/%Y") + +printf "Inputting height and weight information for today\n\n" +printf "Height?\n" + +read -p "?>" height + +printf "Weight?\n" + +read -p "?>" weight + +cd ~/pdbs +printf "\n%s %i" "$today" "$weight" >> weight.timeseries +printf "\n%s %i" "$today" "$height" >> height.timeseries + +git add weight.timeseries height.timeseries +git commit -m "added height, weight data for $today" diff --git a/boxes/phone/out-of-tree/shortcuts/input-expense.sh b/boxes/phone/out-of-tree/shortcuts/input-expense.sh new file mode 100755 index 0000000..48a91ac --- /dev/null +++ b/boxes/phone/out-of-tree/shortcuts/input-expense.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +today=$(date "+%m/%d/%Y") +ledgerdate=$(date "+%Y/%m/%d") + +printf "Inputting an expense for today\n\n" +printf "Payee name?\n" + +read -p "?>" payee + +printf "Amount?\n" + +read -p "?>" amount + +cd ~/pdbs +printf '%s * %s\n\tExpenses:%s $%s\n\tAssets:Greencard 4154\n\n' "$ledgerdate" "$payee" "$payee" "$amount" >> phone.ledger + +git add phone.ledger +git commit -m "added an expense for $today"