diff options
author | George Abbott <george@gabbott.dev> | 2023-10-31 17:54:07 +0000 |
---|---|---|
committer | George Abbott <george@gabbott.dev> | 2023-10-31 17:54:07 +0000 |
commit | 4d0bd914e7c1ee65f4036e60149a7b891906a5d3 (patch) | |
tree | c2a6751823e064e003cd4f6166df07bfc106d7eb |
Commit all to date.
l--------- | all/add-bookmark | 1 | ||||
l--------- | all/add-coast | 1 | ||||
l--------- | all/bib | 1 | ||||
l--------- | all/bibadd | 1 | ||||
l--------- | all/bibcmp | 1 | ||||
l--------- | all/biblio | 1 | ||||
l--------- | all/biblio-by-month | 1 | ||||
l--------- | all/biblio-fmt-tbl | 1 | ||||
l--------- | all/biblio-require.rb | 1 | ||||
l--------- | all/bibrm | 1 | ||||
l--------- | all/bkdir | 1 | ||||
l--------- | all/bsu | 1 | ||||
l--------- | all/camel | 1 | ||||
l--------- | all/cdadd | 1 | ||||
l--------- | all/change-audio | 1 | ||||
l--------- | all/change-light | 1 | ||||
l--------- | all/comment: | 1 | ||||
l--------- | all/deprefix | 1 | ||||
l--------- | all/desuffix | 1 | ||||
l--------- | all/dwmblocks-battery | 1 | ||||
l--------- | all/dwmblocks-brightness | 1 | ||||
l--------- | all/dwmblocks-mpc | 1 | ||||
l--------- | all/dwmblocks-updatesig | 1 | ||||
l--------- | all/dwmblocks-vpn | 1 | ||||
l--------- | all/evmnhol | 1 | ||||
l--------- | all/feeds | 1 | ||||
l--------- | all/fmt-as-table | 1 | ||||
l--------- | all/get-bookmark | 1 | ||||
l--------- | all/get-coast | 1 | ||||
l--------- | all/git-push-all | 1 | ||||
l--------- | all/holc | 1 | ||||
l--------- | all/insert-char | 1 | ||||
l--------- | all/isflag | 1 | ||||
l--------- | all/kebab | 1 | ||||
l--------- | all/kt | 1 | ||||
l--------- | all/links | 1 | ||||
l--------- | all/lle | 1 | ||||
l--------- | all/lssec | 1 | ||||
l--------- | all/ma-fmt-tbl | 1 | ||||
l--------- | all/mdsec | 1 | ||||
l--------- | all/mer | 1 | ||||
l--------- | all/mkblog | 1 | ||||
l--------- | all/mkhol | 1 | ||||
l--------- | all/mn | 1 | ||||
l--------- | all/mndream | 1 | ||||
l--------- | all/mnholmd | 1 | ||||
l--------- | all/mnkic | 1 | ||||
l--------- | all/mnman | 1 | ||||
l--------- | all/mnrec | 1 | ||||
l--------- | all/mnsec | 1 | ||||
l--------- | all/mount-ave | 1 | ||||
l--------- | all/mount-ave-speeds | 1 | ||||
l--------- | all/mumble | 1 | ||||
l--------- | all/music-dl | 1 | ||||
l--------- | all/now | 1 | ||||
l--------- | all/open-bookmark | 1 | ||||
l--------- | all/orgd | 1 | ||||
l--------- | all/orgdenv | 1 | ||||
l--------- | all/orgdresolv | 1 | ||||
l--------- | all/pascal | 1 | ||||
l--------- | all/powermenu | 1 | ||||
l--------- | all/process-img | 1 | ||||
l--------- | all/pvd | 1 | ||||
l--------- | all/rd | 1 | ||||
l--------- | all/rddream | 1 | ||||
l--------- | all/rdpdf | 1 | ||||
l--------- | all/rdsec | 1 | ||||
l--------- | all/s6-restart | 1 | ||||
l--------- | all/scream | 1 | ||||
l--------- | all/snake | 1 | ||||
l--------- | all/strip-blank | 1 | ||||
l--------- | all/strip-comments | 1 | ||||
l--------- | all/strip-ownlinecomments | 1 | ||||
l--------- | all/tasks | 1 | ||||
l--------- | all/track-parcel | 1 | ||||
l--------- | all/train | 1 | ||||
l--------- | all/training | 1 | ||||
l--------- | all/training-format-table | 1 | ||||
l--------- | all/trk | 1 | ||||
l--------- | all/vpnc | 1 | ||||
l--------- | all/vpnd | 1 | ||||
l--------- | all/wr | 1 | ||||
l--------- | all/ws-push | 1 | ||||
l--------- | all/ws-replace | 1 | ||||
l--------- | all/wv | 1 | ||||
l--------- | all/yer | 1 | ||||
l--------- | all/yt-suffix | 1 | ||||
-rwxr-xr-x | bib/bibadd | 2 | ||||
-rwxr-xr-x | bib/bibcmp | 8 | ||||
-rwxr-xr-x | bib/biblio | 55 | ||||
-rwxr-xr-x | bib/bibrm | 3 | ||||
-rwxr-xr-x | fmt/camel | 4 | ||||
-rwxr-xr-x | fmt/deprefix | 6 | ||||
-rwxr-xr-x | fmt/desuffix | 5 | ||||
-rwxr-xr-x | fmt/kebab | 4 | ||||
-rwxr-xr-x | fmt/mumble | 5 | ||||
-rwxr-xr-x | fmt/pascal | 4 | ||||
-rwxr-xr-x | fmt/scream | 4 | ||||
-rwxr-xr-x | fmt/snake | 4 | ||||
-rwxr-xr-x | fmt/strip-blank | 6 | ||||
-rwxr-xr-x | fmt/strip-comments | 10 | ||||
-rwxr-xr-x | fmt/strip-ownlinecomments | 10 | ||||
-rwxr-xr-x | fmt/train | 4 | ||||
-rwxr-xr-x | sys/add-bookmark | 34 | ||||
-rwxr-xr-x | sys/add-coast | 40 | ||||
-rwxr-xr-x | sys/cdadd | 39 | ||||
-rwxr-xr-x | sys/change-audio | 21 | ||||
-rwxr-xr-x | sys/change-light | 4 | ||||
-rwxr-xr-x | sys/dwmblocks-battery | 54 | ||||
-rwxr-xr-x | sys/dwmblocks-brightness | 4 | ||||
-rwxr-xr-x | sys/dwmblocks-mpc | 37 | ||||
-rwxr-xr-x | sys/dwmblocks-updatesig | 7 | ||||
-rwxr-xr-x | sys/dwmblocks-vpn | 8 | ||||
-rwxr-xr-x | sys/feeds | 3 | ||||
-rwxr-xr-x | sys/get-bookmark | 17 | ||||
-rwxr-xr-x | sys/get-coast | 14 | ||||
-rwxr-xr-x | sys/insert-char | 16 | ||||
-rwxr-xr-x | sys/open-bookmark | 26 | ||||
-rwxr-xr-x | sys/orgd | 5 | ||||
-rwxr-xr-x | sys/orgdenv | 27 | ||||
-rwxr-xr-x | sys/orgdresolv | 35 | ||||
-rwxr-xr-x | sys/powermenu | 9 | ||||
-rwxr-xr-x | sys/vpnc | 4 | ||||
-rwxr-xr-x | sys/vpnd | 4 | ||||
-rwxr-xr-x | util/bkdir | 12 | ||||
-rwxr-xr-x | util/comment: | 4 | ||||
-rwxr-xr-x | util/git-push-all | 6 | ||||
-rwxr-xr-x | util/isflag | 13 | ||||
-rwxr-xr-x | util/music-dl | 14 | ||||
-rwxr-xr-x | util/process-img | 23 | ||||
-rwxr-xr-x | util/pvd | 4 | ||||
-rwxr-xr-x | util/rd | 10 | ||||
-rwxr-xr-x | util/rdpdf | 7 | ||||
-rwxr-xr-x | util/s6-restart | 5 | ||||
-rwxr-xr-x | util/track-parcel | 7 | ||||
-rwxr-xr-x | util/wv | 20 | ||||
-rwxr-xr-x | util/yt-suffix | 12 | ||||
-rwxr-xr-x | web/biblio-by-month | 207 | ||||
-rwxr-xr-x | web/biblio-fmt-tbl | 181 | ||||
-rwxr-xr-x | web/biblio-require.rb | 36 | ||||
-rwxr-xr-x | web/bsu | 18 | ||||
-rwxr-xr-x | web/fmt-as-table | 75 | ||||
-rwxr-xr-x | web/links | 5 | ||||
-rwxr-xr-x | web/ma-fmt-tbl | 73 | ||||
-rwxr-xr-x | web/mkblog | 22 | ||||
-rwxr-xr-x | web/mount-ave | 34 | ||||
-rwxr-xr-x | web/mount-ave-speeds | 19 | ||||
-rwxr-xr-x | web/now | 5 | ||||
-rwxr-xr-x | web/training | 10 | ||||
-rwxr-xr-x | web/training-format-table | 12 | ||||
-rwxr-xr-x | web/ws-push | 19 | ||||
-rwxr-xr-x | web/ws-replace | 65 | ||||
-rwxr-xr-x | wr/evmnhol | 16 | ||||
-rwxr-xr-x | wr/holc | 6 | ||||
-rwxr-xr-x | wr/kt | 5 | ||||
-rwxr-xr-x | wr/lle | 6 | ||||
-rwxr-xr-x | wr/lssec | 4 | ||||
-rwxr-xr-x | wr/mdsec | 28 | ||||
-rwxr-xr-x | wr/mer | 6 | ||||
-rwxr-xr-x | wr/mkhol | 10 | ||||
-rwxr-xr-x | wr/mn | 5 | ||||
-rwxr-xr-x | wr/mndream | 6 | ||||
-rwxr-xr-x | wr/mnholmd | 18 | ||||
-rwxr-xr-x | wr/mnkic | 5 | ||||
-rwxr-xr-x | wr/mnman | 5 | ||||
-rwxr-xr-x | wr/mnrec | 5 | ||||
-rwxr-xr-x | wr/mnsec | 8 | ||||
-rwxr-xr-x | wr/rddream | 8 | ||||
-rwxr-xr-x | wr/rdsec | 8 | ||||
-rwxr-xr-x | wr/tasks | 3 | ||||
-rwxr-xr-x | wr/trk | 3 | ||||
-rwxr-xr-x | wr/wr | 4 | ||||
-rwxr-xr-x | wr/yer | 6 |
173 files changed, 1712 insertions, 0 deletions
diff --git a/all/add-bookmark b/all/add-bookmark new file mode 120000 index 0000000..91cd060 --- /dev/null +++ b/all/add-bookmark @@ -0,0 +1 @@ +../sys/add-bookmark
\ No newline at end of file diff --git a/all/add-coast b/all/add-coast new file mode 120000 index 0000000..9dc4c8d --- /dev/null +++ b/all/add-coast @@ -0,0 +1 @@ +../sys/add-coast
\ No newline at end of file @@ -0,0 +1 @@ +../bib/./bib
\ No newline at end of file diff --git a/all/bibadd b/all/bibadd new file mode 120000 index 0000000..f8673e2 --- /dev/null +++ b/all/bibadd @@ -0,0 +1 @@ +../bib/bibadd
\ No newline at end of file diff --git a/all/bibcmp b/all/bibcmp new file mode 120000 index 0000000..8751cc8 --- /dev/null +++ b/all/bibcmp @@ -0,0 +1 @@ +../bib/bibcmp
\ No newline at end of file diff --git a/all/biblio b/all/biblio new file mode 120000 index 0000000..1892eb8 --- /dev/null +++ b/all/biblio @@ -0,0 +1 @@ +../bib/biblio
\ No newline at end of file diff --git a/all/biblio-by-month b/all/biblio-by-month new file mode 120000 index 0000000..766fe22 --- /dev/null +++ b/all/biblio-by-month @@ -0,0 +1 @@ +../web/biblio-by-month
\ No newline at end of file diff --git a/all/biblio-fmt-tbl b/all/biblio-fmt-tbl new file mode 120000 index 0000000..959539e --- /dev/null +++ b/all/biblio-fmt-tbl @@ -0,0 +1 @@ +../web/biblio-fmt-tbl
\ No newline at end of file diff --git a/all/biblio-require.rb b/all/biblio-require.rb new file mode 120000 index 0000000..3b3c42a --- /dev/null +++ b/all/biblio-require.rb @@ -0,0 +1 @@ +../web/biblio-require.rb
\ No newline at end of file diff --git a/all/bibrm b/all/bibrm new file mode 120000 index 0000000..5a9bc8f --- /dev/null +++ b/all/bibrm @@ -0,0 +1 @@ +../bib/bibrm
\ No newline at end of file diff --git a/all/bkdir b/all/bkdir new file mode 120000 index 0000000..b7c0a25 --- /dev/null +++ b/all/bkdir @@ -0,0 +1 @@ +../util/bkdir
\ No newline at end of file @@ -0,0 +1 @@ +../web/bsu
\ No newline at end of file diff --git a/all/camel b/all/camel new file mode 120000 index 0000000..511172a --- /dev/null +++ b/all/camel @@ -0,0 +1 @@ +../fmt/camel
\ No newline at end of file diff --git a/all/cdadd b/all/cdadd new file mode 120000 index 0000000..1aa1431 --- /dev/null +++ b/all/cdadd @@ -0,0 +1 @@ +../sys/cdadd
\ No newline at end of file diff --git a/all/change-audio b/all/change-audio new file mode 120000 index 0000000..1835595 --- /dev/null +++ b/all/change-audio @@ -0,0 +1 @@ +../sys/change-audio
\ No newline at end of file diff --git a/all/change-light b/all/change-light new file mode 120000 index 0000000..11b992f --- /dev/null +++ b/all/change-light @@ -0,0 +1 @@ +../sys/change-light
\ No newline at end of file diff --git a/all/comment: b/all/comment: new file mode 120000 index 0000000..07d3606 --- /dev/null +++ b/all/comment: @@ -0,0 +1 @@ +../util/comment:
\ No newline at end of file diff --git a/all/deprefix b/all/deprefix new file mode 120000 index 0000000..392cde9 --- /dev/null +++ b/all/deprefix @@ -0,0 +1 @@ +../fmt/deprefix
\ No newline at end of file diff --git a/all/desuffix b/all/desuffix new file mode 120000 index 0000000..9677d94 --- /dev/null +++ b/all/desuffix @@ -0,0 +1 @@ +../fmt/desuffix
\ No newline at end of file diff --git a/all/dwmblocks-battery b/all/dwmblocks-battery new file mode 120000 index 0000000..93691f2 --- /dev/null +++ b/all/dwmblocks-battery @@ -0,0 +1 @@ +../sys/dwmblocks-battery
\ No newline at end of file diff --git a/all/dwmblocks-brightness b/all/dwmblocks-brightness new file mode 120000 index 0000000..84685f6 --- /dev/null +++ b/all/dwmblocks-brightness @@ -0,0 +1 @@ +../sys/dwmblocks-brightness
\ No newline at end of file diff --git a/all/dwmblocks-mpc b/all/dwmblocks-mpc new file mode 120000 index 0000000..534b32c --- /dev/null +++ b/all/dwmblocks-mpc @@ -0,0 +1 @@ +../sys/dwmblocks-mpc
\ No newline at end of file diff --git a/all/dwmblocks-updatesig b/all/dwmblocks-updatesig new file mode 120000 index 0000000..ffda664 --- /dev/null +++ b/all/dwmblocks-updatesig @@ -0,0 +1 @@ +../sys/dwmblocks-updatesig
\ No newline at end of file diff --git a/all/dwmblocks-vpn b/all/dwmblocks-vpn new file mode 120000 index 0000000..ca0dd49 --- /dev/null +++ b/all/dwmblocks-vpn @@ -0,0 +1 @@ +../sys/dwmblocks-vpn
\ No newline at end of file diff --git a/all/evmnhol b/all/evmnhol new file mode 120000 index 0000000..a4cc805 --- /dev/null +++ b/all/evmnhol @@ -0,0 +1 @@ +../wr/evmnhol
\ No newline at end of file diff --git a/all/feeds b/all/feeds new file mode 120000 index 0000000..3ee06f0 --- /dev/null +++ b/all/feeds @@ -0,0 +1 @@ +../sys/feeds
\ No newline at end of file diff --git a/all/fmt-as-table b/all/fmt-as-table new file mode 120000 index 0000000..3854f37 --- /dev/null +++ b/all/fmt-as-table @@ -0,0 +1 @@ +../web/fmt-as-table
\ No newline at end of file diff --git a/all/get-bookmark b/all/get-bookmark new file mode 120000 index 0000000..882cda8 --- /dev/null +++ b/all/get-bookmark @@ -0,0 +1 @@ +../sys/get-bookmark
\ No newline at end of file diff --git a/all/get-coast b/all/get-coast new file mode 120000 index 0000000..b96eff0 --- /dev/null +++ b/all/get-coast @@ -0,0 +1 @@ +../sys/get-coast
\ No newline at end of file diff --git a/all/git-push-all b/all/git-push-all new file mode 120000 index 0000000..9d40a61 --- /dev/null +++ b/all/git-push-all @@ -0,0 +1 @@ +../util/git-push-all
\ No newline at end of file diff --git a/all/holc b/all/holc new file mode 120000 index 0000000..c051c71 --- /dev/null +++ b/all/holc @@ -0,0 +1 @@ +../wr/holc
\ No newline at end of file diff --git a/all/insert-char b/all/insert-char new file mode 120000 index 0000000..cda8432 --- /dev/null +++ b/all/insert-char @@ -0,0 +1 @@ +../sys/insert-char
\ No newline at end of file diff --git a/all/isflag b/all/isflag new file mode 120000 index 0000000..e232eea --- /dev/null +++ b/all/isflag @@ -0,0 +1 @@ +../util/isflag
\ No newline at end of file diff --git a/all/kebab b/all/kebab new file mode 120000 index 0000000..88e8346 --- /dev/null +++ b/all/kebab @@ -0,0 +1 @@ +../fmt/kebab
\ No newline at end of file @@ -0,0 +1 @@ +../wr/kt
\ No newline at end of file diff --git a/all/links b/all/links new file mode 120000 index 0000000..d7777b2 --- /dev/null +++ b/all/links @@ -0,0 +1 @@ +../web/links
\ No newline at end of file @@ -0,0 +1 @@ +../wr/lle
\ No newline at end of file diff --git a/all/lssec b/all/lssec new file mode 120000 index 0000000..65f7e09 --- /dev/null +++ b/all/lssec @@ -0,0 +1 @@ +../wr/lssec
\ No newline at end of file diff --git a/all/ma-fmt-tbl b/all/ma-fmt-tbl new file mode 120000 index 0000000..b1dbe40 --- /dev/null +++ b/all/ma-fmt-tbl @@ -0,0 +1 @@ +../web/ma-fmt-tbl
\ No newline at end of file diff --git a/all/mdsec b/all/mdsec new file mode 120000 index 0000000..fac60ea --- /dev/null +++ b/all/mdsec @@ -0,0 +1 @@ +../wr/mdsec
\ No newline at end of file @@ -0,0 +1 @@ +../wr/mer
\ No newline at end of file diff --git a/all/mkblog b/all/mkblog new file mode 120000 index 0000000..20fcfb2 --- /dev/null +++ b/all/mkblog @@ -0,0 +1 @@ +../web/mkblog
\ No newline at end of file diff --git a/all/mkhol b/all/mkhol new file mode 120000 index 0000000..ba899a7 --- /dev/null +++ b/all/mkhol @@ -0,0 +1 @@ +../wr/mkhol
\ No newline at end of file @@ -0,0 +1 @@ +../wr/mn
\ No newline at end of file diff --git a/all/mndream b/all/mndream new file mode 120000 index 0000000..84aff61 --- /dev/null +++ b/all/mndream @@ -0,0 +1 @@ +../wr/mndream
\ No newline at end of file diff --git a/all/mnholmd b/all/mnholmd new file mode 120000 index 0000000..5a4d355 --- /dev/null +++ b/all/mnholmd @@ -0,0 +1 @@ +../wr/mnholmd
\ No newline at end of file diff --git a/all/mnkic b/all/mnkic new file mode 120000 index 0000000..37c9001 --- /dev/null +++ b/all/mnkic @@ -0,0 +1 @@ +../wr/mnkic
\ No newline at end of file diff --git a/all/mnman b/all/mnman new file mode 120000 index 0000000..e66c122 --- /dev/null +++ b/all/mnman @@ -0,0 +1 @@ +../wr/mnman
\ No newline at end of file diff --git a/all/mnrec b/all/mnrec new file mode 120000 index 0000000..817c5ba --- /dev/null +++ b/all/mnrec @@ -0,0 +1 @@ +../wr/mnrec
\ No newline at end of file diff --git a/all/mnsec b/all/mnsec new file mode 120000 index 0000000..9492c35 --- /dev/null +++ b/all/mnsec @@ -0,0 +1 @@ +../wr/mnsec
\ No newline at end of file diff --git a/all/mount-ave b/all/mount-ave new file mode 120000 index 0000000..466b4d9 --- /dev/null +++ b/all/mount-ave @@ -0,0 +1 @@ +../web/mount-ave
\ No newline at end of file diff --git a/all/mount-ave-speeds b/all/mount-ave-speeds new file mode 120000 index 0000000..2104d84 --- /dev/null +++ b/all/mount-ave-speeds @@ -0,0 +1 @@ +../web/mount-ave-speeds
\ No newline at end of file diff --git a/all/mumble b/all/mumble new file mode 120000 index 0000000..37ca9a9 --- /dev/null +++ b/all/mumble @@ -0,0 +1 @@ +../fmt/mumble
\ No newline at end of file diff --git a/all/music-dl b/all/music-dl new file mode 120000 index 0000000..6dcadcf --- /dev/null +++ b/all/music-dl @@ -0,0 +1 @@ +../util/music-dl
\ No newline at end of file @@ -0,0 +1 @@ +../web/now
\ No newline at end of file diff --git a/all/open-bookmark b/all/open-bookmark new file mode 120000 index 0000000..f255701 --- /dev/null +++ b/all/open-bookmark @@ -0,0 +1 @@ +../sys/open-bookmark
\ No newline at end of file diff --git a/all/orgd b/all/orgd new file mode 120000 index 0000000..bc852fb --- /dev/null +++ b/all/orgd @@ -0,0 +1 @@ +../sys/orgd
\ No newline at end of file diff --git a/all/orgdenv b/all/orgdenv new file mode 120000 index 0000000..3d0b697 --- /dev/null +++ b/all/orgdenv @@ -0,0 +1 @@ +../sys/orgdenv
\ No newline at end of file diff --git a/all/orgdresolv b/all/orgdresolv new file mode 120000 index 0000000..60cae5d --- /dev/null +++ b/all/orgdresolv @@ -0,0 +1 @@ +../sys/orgdresolv
\ No newline at end of file diff --git a/all/pascal b/all/pascal new file mode 120000 index 0000000..c4d7d1f --- /dev/null +++ b/all/pascal @@ -0,0 +1 @@ +../fmt/pascal
\ No newline at end of file diff --git a/all/powermenu b/all/powermenu new file mode 120000 index 0000000..0688f90 --- /dev/null +++ b/all/powermenu @@ -0,0 +1 @@ +../sys/powermenu
\ No newline at end of file diff --git a/all/process-img b/all/process-img new file mode 120000 index 0000000..6d0dee8 --- /dev/null +++ b/all/process-img @@ -0,0 +1 @@ +../util/process-img
\ No newline at end of file @@ -0,0 +1 @@ +../util/pvd
\ No newline at end of file @@ -0,0 +1 @@ +../util/rd
\ No newline at end of file diff --git a/all/rddream b/all/rddream new file mode 120000 index 0000000..b1058b5 --- /dev/null +++ b/all/rddream @@ -0,0 +1 @@ +../wr/rddream
\ No newline at end of file diff --git a/all/rdpdf b/all/rdpdf new file mode 120000 index 0000000..e275dd3 --- /dev/null +++ b/all/rdpdf @@ -0,0 +1 @@ +../util/rdpdf
\ No newline at end of file diff --git a/all/rdsec b/all/rdsec new file mode 120000 index 0000000..c2130b1 --- /dev/null +++ b/all/rdsec @@ -0,0 +1 @@ +../wr/rdsec
\ No newline at end of file diff --git a/all/s6-restart b/all/s6-restart new file mode 120000 index 0000000..91b2583 --- /dev/null +++ b/all/s6-restart @@ -0,0 +1 @@ +../util/s6-restart
\ No newline at end of file diff --git a/all/scream b/all/scream new file mode 120000 index 0000000..b9dded9 --- /dev/null +++ b/all/scream @@ -0,0 +1 @@ +../fmt/scream
\ No newline at end of file diff --git a/all/snake b/all/snake new file mode 120000 index 0000000..422f654 --- /dev/null +++ b/all/snake @@ -0,0 +1 @@ +../fmt/snake
\ No newline at end of file diff --git a/all/strip-blank b/all/strip-blank new file mode 120000 index 0000000..a41ed88 --- /dev/null +++ b/all/strip-blank @@ -0,0 +1 @@ +../fmt/strip-blank
\ No newline at end of file diff --git a/all/strip-comments b/all/strip-comments new file mode 120000 index 0000000..231bf2d --- /dev/null +++ b/all/strip-comments @@ -0,0 +1 @@ +../fmt/strip-comments
\ No newline at end of file diff --git a/all/strip-ownlinecomments b/all/strip-ownlinecomments new file mode 120000 index 0000000..4732b33 --- /dev/null +++ b/all/strip-ownlinecomments @@ -0,0 +1 @@ +../fmt/strip-ownlinecomments
\ No newline at end of file diff --git a/all/tasks b/all/tasks new file mode 120000 index 0000000..d31d501 --- /dev/null +++ b/all/tasks @@ -0,0 +1 @@ +../wr/tasks
\ No newline at end of file diff --git a/all/track-parcel b/all/track-parcel new file mode 120000 index 0000000..955e9ef --- /dev/null +++ b/all/track-parcel @@ -0,0 +1 @@ +../util/track-parcel
\ No newline at end of file diff --git a/all/train b/all/train new file mode 120000 index 0000000..acf1f8d --- /dev/null +++ b/all/train @@ -0,0 +1 @@ +../fmt/train
\ No newline at end of file diff --git a/all/training b/all/training new file mode 120000 index 0000000..0dadf8c --- /dev/null +++ b/all/training @@ -0,0 +1 @@ +../web/training
\ No newline at end of file diff --git a/all/training-format-table b/all/training-format-table new file mode 120000 index 0000000..6f74097 --- /dev/null +++ b/all/training-format-table @@ -0,0 +1 @@ +../web/training-format-table
\ No newline at end of file @@ -0,0 +1 @@ +../wr/trk
\ No newline at end of file diff --git a/all/vpnc b/all/vpnc new file mode 120000 index 0000000..d4c88e8 --- /dev/null +++ b/all/vpnc @@ -0,0 +1 @@ +../sys/vpnc
\ No newline at end of file diff --git a/all/vpnd b/all/vpnd new file mode 120000 index 0000000..8757447 --- /dev/null +++ b/all/vpnd @@ -0,0 +1 @@ +../sys/vpnd
\ No newline at end of file @@ -0,0 +1 @@ +../wr/wr
\ No newline at end of file diff --git a/all/ws-push b/all/ws-push new file mode 120000 index 0000000..0901169 --- /dev/null +++ b/all/ws-push @@ -0,0 +1 @@ +../web/ws-push
\ No newline at end of file diff --git a/all/ws-replace b/all/ws-replace new file mode 120000 index 0000000..0b93c08 --- /dev/null +++ b/all/ws-replace @@ -0,0 +1 @@ +../web/ws-replace
\ No newline at end of file @@ -0,0 +1 @@ +../util/wv
\ No newline at end of file @@ -0,0 +1 @@ +../wr/yer
\ No newline at end of file diff --git a/all/yt-suffix b/all/yt-suffix new file mode 120000 index 0000000..066cd6a --- /dev/null +++ b/all/yt-suffix @@ -0,0 +1 @@ +../util/yt-suffix
\ No newline at end of file diff --git a/bib/bibadd b/bib/bibadd new file mode 100755 index 0000000..ae58e14 --- /dev/null +++ b/bib/bibadd @@ -0,0 +1,2 @@ +#!/bin/sh +# bibadd: add a new book entry to the bibliography. diff --git a/bib/bibcmp b/bib/bibcmp new file mode 100755 index 0000000..dbff044 --- /dev/null +++ b/bib/bibcmp @@ -0,0 +1,8 @@ +#!/bin/sh +# bibcmp: mark an entry as completed. +# This filters for all with status == ongoing, and can mark one as completed. +# Depends: fzf. + +grep "ongoing" $(orgdresolv "ORGD_BIBCSV_PATH") | \ + awk -F';' '{ printf "%s: %s\n", $2, $3 }' | \ + fzf diff --git a/bib/biblio b/bib/biblio new file mode 100755 index 0000000..a714c77 --- /dev/null +++ b/bib/biblio @@ -0,0 +1,55 @@ +#!/bin/sh +# Update the biblio.csv file, and reflect changes in the corresponding webpages, +# committing and pushing the changes if any made. +# Webpages changed: rd/index, rd/by-month. +# Dependencies: sc-im, git. + +BIBLIO="$HOME/docs/wr/orgd/kt/biblio.csv" +TABLE_FILE='/tmp/biblio-tbl-formatted' + +if [ "$1" = "-u" ] ; then + # Do nothing. This won't ask to update the file, but will just carry on, + # so that it can update the website. + echo "" > /dev/null +else + hash_before="$(sha256sum "$BIBLIO")" + sc-im --txtdelim=";" "$BIBLIO" + hash_after="$(sha256sum "$BIBLIO")" + if [ "$hash_before" = "$hash_after" ] ; then + echo "No changes made - exitting early!" + exit 0 + fi +fi + +####################### First half: update rd/index ########################### +WEBPAGE_PATH="$WEBSITE_PATH/rd/index.html" +DELIMITER_BEGIN="<!-- rd:begin -->" +DELIMITER_END="<!-- rd:end -->" + +table_formatted="$(biblio-fmt-tbl "$BIBLIO")" + +echo "$table_formatted" > "$TABLE_FILE" +sed -i -ne "/$DELIMITER_BEGIN/ {p; r $TABLE_FILE" -e ":a; n; /$DELIMITER_END/ {p; b}; ba}; p" "$WEBPAGE_PATH" + +# Commit and push the changes +cd "$(dirname "$WEBPAGE_PATH")" +git add "$(basename "$WEBPAGE_PATH")" + +####################### Second half: update rd/by-month ####################### +WEBPAGE_PATH="$WEBSITE_PATH/rd/by-month.html" +DELIMITER_BEGIN="<!-- rd-by-month:begin -->" +DELIMITER_END="<!-- rd-by-month:end -->" + +table_formatted="$(biblio-by-month "$BIBLIO")" + +echo "$table_formatted" > "$TABLE_FILE" +sed -i -ne "/$DELIMITER_BEGIN/ {p; r $TABLE_FILE" -e ":a; n; /$DELIMITER_END/ {p; b}; ba}; p" "$WEBPAGE_PATH" + +# Commit and push the changes +cd "$(dirname "$WEBPAGE_PATH")" +git add "$(basename "$WEBPAGE_PATH")" + + +######################### Commit and push all changes ######################### +ws-push + diff --git a/bib/bibrm b/bib/bibrm new file mode 100755 index 0000000..35ae34f --- /dev/null +++ b/bib/bibrm @@ -0,0 +1,3 @@ +#!/bin/sh +# Remove an entry from the bibliography file. +# Requires fzf. diff --git a/fmt/camel b/fmt/camel new file mode 100755 index 0000000..bd24981 --- /dev/null +++ b/fmt/camel @@ -0,0 +1,4 @@ +#!/bin/sh +# camel: convertAStringIntoCamelCase + +# TODO. diff --git a/fmt/deprefix b/fmt/deprefix new file mode 100755 index 0000000..da51657 --- /dev/null +++ b/fmt/deprefix @@ -0,0 +1,6 @@ +#!/bin/sh +# deprefix +# Remove the prefix from all files in the directory which have the prefix. +# deprefix "pref-" + +for i in "$1"*;do mv "$i" "${i#"$1"}";done diff --git a/fmt/desuffix b/fmt/desuffix new file mode 100755 index 0000000..fc0a511 --- /dev/null +++ b/fmt/desuffix @@ -0,0 +1,5 @@ +#!/bin/sh +# desuffix +# Remove all suffixes. + +rename --no-overwrite -- "$1" "" * diff --git a/fmt/kebab b/fmt/kebab new file mode 100755 index 0000000..c9bbc66 --- /dev/null +++ b/fmt/kebab @@ -0,0 +1,4 @@ +#!/bin/sh +# kebab: convert-a-string-into-kebab-case + +echo "$1" | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-zA-Z0-9-]//g' diff --git a/fmt/mumble b/fmt/mumble new file mode 100755 index 0000000..f5494fc --- /dev/null +++ b/fmt/mumble @@ -0,0 +1,5 @@ +#!/bin/sh +# mumble: convertastringintomumblecase +# snake: convert_a_string_into_snake_case + +echo "$1" | tr -d ' ' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-zA-Z0-9]//g' diff --git a/fmt/pascal b/fmt/pascal new file mode 100755 index 0000000..1e5e656 --- /dev/null +++ b/fmt/pascal @@ -0,0 +1,4 @@ +#!/bin/sh +# pascal: ConvertAStringIntoPascalCase + +# TODO. diff --git a/fmt/scream b/fmt/scream new file mode 100755 index 0000000..4836167 --- /dev/null +++ b/fmt/scream @@ -0,0 +1,4 @@ +#!/bin/sh +# scream: CONVERT_A_STRING_INTO_SCREAM_CASE + +echo "$1" | tr ' ' '_' | tr '[:lower:]' '[:upper:]' | sed 's/[^a-zA-Z0-9_]//g' diff --git a/fmt/snake b/fmt/snake new file mode 100755 index 0000000..e33b678 --- /dev/null +++ b/fmt/snake @@ -0,0 +1,4 @@ +#!/bin/sh +# snake: convert_a_string_into_snake_case + +echo "$1" | tr ' ' '_' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-zA-Z0-9_]//g' diff --git a/fmt/strip-blank b/fmt/strip-blank new file mode 100755 index 0000000..2be9030 --- /dev/null +++ b/fmt/strip-blank @@ -0,0 +1,6 @@ +#!/bin/sh +# Strip blank lines, including lines which only have whitespace. + +[ $# -ge 1 -a -f "$1" ] && in="$1" || in="-" + +grep -v '^[[:blank:]]*$' "$in" diff --git a/fmt/strip-comments b/fmt/strip-comments new file mode 100755 index 0000000..2e3a356 --- /dev/null +++ b/fmt/strip-comments @@ -0,0 +1,10 @@ +#!/bin/sh + +# Strip all comments '#' from a file, including on individual lines and in +# lines, not taking escaping due to, e.g. strings into account. +# Use as: cat filename | strip-comments, +# or as strip-comments filename + +[ $# -ge 1 -a -f "$1" ] && in="$1" || in="-" + +sed '/^[[:blank:]]*#/d;s/#.*//' "$in" diff --git a/fmt/strip-ownlinecomments b/fmt/strip-ownlinecomments new file mode 100755 index 0000000..0ed3709 --- /dev/null +++ b/fmt/strip-ownlinecomments @@ -0,0 +1,10 @@ +#!/bin/sh + +# Strip all comments '#' from a file, including on individual lines and in +# lines, not taking escaping due to, e.g. strings into account. +# Use as: cat filename | strip-comments, +# or as strip-comments filename + +[ $# -ge 1 -a -f "$1" ] && in="$1" || in="-" + +sed '/^[[:blank:]]*#/d' "$in" diff --git a/fmt/train b/fmt/train new file mode 100755 index 0000000..b419707 --- /dev/null +++ b/fmt/train @@ -0,0 +1,4 @@ +#!/bin/sh +# train: CONVERT-A-STRING-INTO-TRAIN-CASE + +echo "$1" | tr ' ' '-' | tr '[:lower:]' '[:upper:]' | sed 's/[^a-zA-Z0-9-]//g' diff --git a/sys/add-bookmark b/sys/add-bookmark new file mode 100755 index 0000000..cf37c7f --- /dev/null +++ b/sys/add-bookmark @@ -0,0 +1,34 @@ +#!/bin/sh +# Adds a bookmark. +# Either grabs xclip, or requests input of the string to bookmark. +# If passed --ask (-a), then ignore the clipboard and prompt the user what to +# bookmark. + +bkmk="$(xclip -o -selection primary)" +alias bmnotify-send="notify-send -i $HOME/.local/share/img/bm-icon.png" + +if isflag '-a' "$@" ; then + bkmk="$(dmenu -p "Enter bookmark: " < /dev/null)" +fi + + +[ -z "$bkmk" ] && bmnotify-send "Did not bookmark." "Nothing selected to bookmark!" && exit + +comment="$(dmenu -p "Add comment ($bkmk): " < /dev/null)" +[ -z "$comment" ] && exit +if [ "$ORGD_KT_PATH" = "" ]; then + notify-send "ORGD_KT_PATH empty." "Using $HOME/docs/wr/orgd/kt as fallback." + file="$HOME/docs/wr/orgd/kt/bookmark" +else + file="$ORGD_KT_PATH/bookmark" +fi + +stripped="$(strip-comments "$file")" + +if echo "$stripped" | grep -q "^$bkmk[/ \t]*$"; then + bmnotify-send "No!" "<i>$bkmk</i> already bookmarked!" +else + echo "$bkmk # $comment" >> "$file" + bmnotify-send "Bookmark Added!" "<i>$bkmk</i> added and tagged as <i>$comment</i>." +fi + diff --git a/sys/add-coast b/sys/add-coast new file mode 100755 index 0000000..ebd1df9 --- /dev/null +++ b/sys/add-coast @@ -0,0 +1,40 @@ +#!/bin/sh +# Adds a bookmark. +# Either grabs xclip, or requests input of the string to bookmark. +# If passed --ask (-a), then ignore the clipboard and prompt the user what to +# bookmark. + +coast="$(xclip -o -selection primary)" +alias bmnotify-send="notify-send -i $HOME/.local/share/img/bm-icon.png" +commonargs="-i $HOME/.local/share/img/bm-icon.png" + +if isflag '-a' "$@" ; then + coast="$(dmenu -p "Enter coast entry: " < /dev/null)" +fi + +# Exit if entry is not present. +[ -z "$coast" ] && bmnotify-send "Did not add coast." "Nothing selected to add!" && exit + +# Request comment. +comment="$(dmenu -p "Add comment ($coast): " < /dev/null)" + +# Exit if the comment is blank. +[ -z "$comment" ] && exit + +# Find the file which holds coast entries, and process it. +if [ "$ORGD_KT_PATH" = "" ]; then + notify-send "ORGD_KT_PATH empty." "Using $HOME/docs/wr/orgd/kt as fallback." + file="$HOME/docs/wr/orgd/kt/coast" +else + file="$ORGD_KT_PATH/coast" +fi +stripped="$(strip-comments "$file")" + +# Add the entry, unless its already added. +if echo "$stripped" | grep -q "^$coast[/ \t]*$"; then + bmnotify-send "No!" "<i>$coast</i> already added!" +else + echo "$coast # $comment" >> "$file" + bmnotify-send "Entry Added!" "<i>$coast</i> added and tagged as <i>$comment</i>." $commonargs +fi + diff --git a/sys/cdadd b/sys/cdadd new file mode 100755 index 0000000..57f1b69 --- /dev/null +++ b/sys/cdadd @@ -0,0 +1,39 @@ +#!/bin/sh + +# Add a cd alias to the $ORGD_CDALIAS_PATH file. +# Checks the path is valid first before adding it, and that alias less than +# seven characters as per the requirements. +# Usage: cdadd alias $HOME/target/directory +# Pass -p to disable the check for a valid path. + + +dir="$(orgdresolv ORGD_SD_PATH)" +path="$(orgdresolv ORGD_CDALIAS_PATH)" +alias="$1" +target="$2" + +# Ensure that $ORGD_CDALIAS_PATH exists +mkdir -p "$dir" +touch "$path" +# Check alias less than eight characters. +[ ${#alias} -gt 8 ] && \ + echo "Alias ($alias) must be less than eight characters long." && \ + exit + +# Check $target is a valid path. + +if [ ! -d "$target" ] ; then + if ! isflag '-p' "$@" ; then + echo "Target ($target) is not a valid directory" && \ + exit + fi +fi + +# Check if alias already exists as a cd alias, grep with tab to not match part +# of existing alias. +awk ' { print $1 } ' $path | grep -q "$alias " && \ + echo "The alias ($alias) already exists." && \ + exit + + +echo "$alias $target" >> $path diff --git a/sys/change-audio b/sys/change-audio new file mode 100755 index 0000000..2dafe73 --- /dev/null +++ b/sys/change-audio @@ -0,0 +1,21 @@ +#!/bin/bash +# change-audio +# Shamelessly copied from the Arch Linux wiki. + +# Arbitrary but unique message tag +msgTag="myvolume" + +# Change the volume using alsa(might differ if you use pulseaudio) +amixer -M -c 0 set Master "$@" > /dev/null + +# Query amixer for the current volume and whether or not the speaker is muted +volume="$(amixer -M -c 0 get Master | tail -1 | awk '{print $4}' | sed 's/[^0-9]*//g')" +mute="$(amixer -M -c 0 get Master | tail -1 | awk '{print $6}' | sed 's/[^a-z]*//g')" +if [[ $volume == 0 || "$mute" == "off" ]]; then + # Show the sound muted notification + dunstify -a "changeVolume" -u low -i audio-volume-muted -h string:x-dunst-stack-tag:$msgTag "Volume muted" +else + # Show the volume notification + dunstify -a "changeVolume" -u low -i audio-volume-high -h string:x-dunst-stack-tag:$msgTag \ + -h int:value:"$volume" "Volume: ${volume}%" +fi diff --git a/sys/change-light b/sys/change-light new file mode 100755 index 0000000..4658349 --- /dev/null +++ b/sys/change-light @@ -0,0 +1,4 @@ +#!/bin/sh + +xbacklight -$1 $2 +pkill -RTMIN+2 dwmblocks diff --git a/sys/dwmblocks-battery b/sys/dwmblocks-battery new file mode 100755 index 0000000..455a42f --- /dev/null +++ b/sys/dwmblocks-battery @@ -0,0 +1,54 @@ +#!/bin/sh + +CHARGING="" + +get_symbol() { + printf '' + if [ "$2" = "indeed" ]; then + printf $CHARGING + else + if [ "$1" -ge 0 ] && [ "$1" -le 4 ]; then + printf "" + elif [ "$1" -ge 5 ] && [ "$1" -le 14 ]; then + printf "" + elif [ "$1" -ge 15 ] && [ "$1" -le 24 ]; then + printf "" + elif [ "$1" -ge 25 ] && [ "$1" -le 34 ]; then + printf "" + elif [ "$1" -ge 35 ] && [ "$1" -le 44 ]; then + printf "" + elif [ "$1" -ge 45 ] && [ "$1" -le 54 ]; then + printf "" + elif [ "$1" -ge 55 ] && [ "$1" -le 64 ]; then + printf "" + elif [ "$1" -ge 65 ] && [ "$1" -le 74 ]; then + printf "" + elif [ "$1" -ge 75 ] && [ "$1" -le 84 ]; then + printf "" + elif [ "$1" -ge 85 ] && [ "$1" -le 94 ]; then + printf "" + elif [ "$1" -ge 95 ] && [ "$1" -le 100 ]; then + printf "" + else + printf "uhoh" + fi + fi + printf '' + +} + +for bat in /sys/class/power_supply/BAT*; do + stt=$(cat "$bat/status") + if [ "$stt" = 'Discharging' ] || [ "$stt" = 'Not charging' ] + then + is_battery_charging='no' + else + is_battery_charging='indeed' + fi + + cpcy="$(cat "$bat/capacity")" + + symbol="$(get_symbol "$cpcy" "$is_battery_charging")" + + printf "$symbol $cpcy%%" | tr '\n' ' '; +done diff --git a/sys/dwmblocks-brightness b/sys/dwmblocks-brightness new file mode 100755 index 0000000..34390db --- /dev/null +++ b/sys/dwmblocks-brightness @@ -0,0 +1,4 @@ +#!/bin/sh + +v=$(xbacklight -get) +echo " ${v%%.*}%" diff --git a/sys/dwmblocks-mpc b/sys/dwmblocks-mpc new file mode 100755 index 0000000..0897855 --- /dev/null +++ b/sys/dwmblocks-mpc @@ -0,0 +1,37 @@ +#!/bin/bash + +# Accepts, e.g. 81:50 and prints it to 1:21:50. +to_hms_time() { + min="$(cut -d':' -f1 <<<"$1")" + sec="$(cut -d':' -f2 <<<"$1")" + + ((hour=$min/60)) + ((min=$min-$hour*60)) + + printf -v min "%02d" $min + printf -v sec "%02d" $sec + + if [ $hour = "0" ] ; then + printf "$min:$sec" + else + printf "$hour:$min:$sec" + fi +} + +FILENAME="$(mpc current -f "%title%")" +if [ -z "$FILENAME" ] ; then + FILENAME="$(basename "$(mpc current -f "%file%")")" # TODO: also remove file extension. +fi + +TIMES="$(mpc status "%currenttime%/%totaltime%")" + +if [ -z "$FILENAME" ] && [ "$TIMES" = "0:00/0:00" ] ; then + printf "" + exit +fi + +mpctime="$(mpc status %currenttime%/%totaltime%)" +curtime="$(to_hms_time $(cut -d '/' -f1 <<<"$mpctime"))" # <<< isn't POSIX? +tottime="$(to_hms_time $(cut -d '/' -f2 <<<"$mpctime"))" + +printf " %s/%s ~ %s" "$curtime" "$tottime" "$FILENAME" diff --git a/sys/dwmblocks-updatesig b/sys/dwmblocks-updatesig new file mode 100755 index 0000000..730a7b2 --- /dev/null +++ b/sys/dwmblocks-updatesig @@ -0,0 +1,7 @@ +#!/bin/sh +# Give signal in blocks.def.h + 34. + +echo "$0" +echo "$1" + +pkill -RTMIN+"$1" dwmblocks diff --git a/sys/dwmblocks-vpn b/sys/dwmblocks-vpn new file mode 100755 index 0000000..6a81123 --- /dev/null +++ b/sys/dwmblocks-vpn @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$(ip link show | rg proton0)" = "" ] +then + echo "no vpn" +else + echo "vpn" +fi diff --git a/sys/feeds b/sys/feeds new file mode 100755 index 0000000..9330324 --- /dev/null +++ b/sys/feeds @@ -0,0 +1,3 @@ +#!/bin/sh + +nvim $XDG_CONFIG_HOME/newsboat/urls diff --git a/sys/get-bookmark b/sys/get-bookmark new file mode 100755 index 0000000..321aa10 --- /dev/null +++ b/sys/get-bookmark @@ -0,0 +1,17 @@ +#!/bin/sh + +alias bmnotify-send="notify-send -i $HOME/.local/share/img/bm-icon.png" + +if [ "$ORGD_KT_PATH" = "" ]; then + notify-send "ORGD_KT_PATH empty." "Using $HOME/docs/wr/orgd/kt as fallback." + file="$HOME/docs/wr/orgd/kt/bookmark" +else + file="$ORGD_KT_PATH/bookmark" +fi + +# This regex matches <space tab carriage-return linefeed> though it is hard to +# read. +# I wonder if it might be worth cutting on a different character than space? +# If a space is present in the bookmark then it will bug out. +xdotool type --delay 2 "$(grep -v '^#\|^[ \r\n]*$' $file | dmenu -i -l 50 | cut -d' ' -f1)" +bmnotify-send "Done!" "Text fully pasted." diff --git a/sys/get-coast b/sys/get-coast new file mode 100755 index 0000000..d04364c --- /dev/null +++ b/sys/get-coast @@ -0,0 +1,14 @@ +#!/bin/sh +# get-coast: get a "check-out-at-some-time" entry. +if [ "$ORGD_KT_PATH" = "" ]; then + notify-send "ORGD_KT_PATH empty." "Using $HOME/docs/wr/orgd/kt as fallback." + file="$HOME/docs/wr/orgd/kt/coast" +else + file="$ORGD_KT_PATH/coast" +fi + +# This regex matches <space tab carriage-return linefeed> though it is hard to +# read. +# I wonder if it might be worth cutting on a different character than space? +# If a space is present in the bookmark then it will bug out. +xdotool type --delay 2 "$(grep -v '^#\|^[ \r\n]*$' $file | dmenu -i -l 50 | cut -d' ' -f1)" diff --git a/sys/insert-char b/sys/insert-char new file mode 100755 index 0000000..20ea288 --- /dev/null +++ b/sys/insert-char @@ -0,0 +1,16 @@ +#!/bin/sh + +# A simple dmenu script that grabs from a file, and inserts that character. +# File is located at: $ORGD_DATA_PATH, or $HOME/docs/wr/orgd/dt/chars. + +if [ "$ORGD_DT_PATH" = "" ]; then + notify-send "ORGD_DT_PATH empty." "Using $HOME/docs/wr/orgd/dt as fallback." + file="$HOME/docs/wr/orgd/dt/chars" +else + file="$ORGD_DT_PATH/chars" +fi + +char="$(grep -v '^#\|^[ \r\n]*$' $file | dmenu -l 25 | cut -d' ' -f1)" +notify-send "Inserted Character" "Inserted <i>$char</i>." +xdotool type --delay 0 "$char" + diff --git a/sys/open-bookmark b/sys/open-bookmark new file mode 100755 index 0000000..12f5ae6 --- /dev/null +++ b/sys/open-bookmark @@ -0,0 +1,26 @@ +#!/bin/sh +# Open a bookmark. If the text entered is not a bookmark, search for it +# using Duckduckgo, for now. + +[ -z "$BROWSER" ] && BROWSER="firefox" + +if [ -z "$ORGD_KT_PATH" ] ; then + notify-send "ORGD_KT_PATH empty." "Using $HOME/docs/wr/orgd/kt as fallback." + file="$HOME/docs/wr/orgd/kt/bookmark" +else + file="$ORGD_KT_PATH"/bookmark +fi + +open="$(grep -v '^#\|^[ \r\n]*$' $file | \ + dmenu -p 'Site to open:' -i -l 50 | \ + cut -d'#' -f1 | \ + sed 's/[[:space:]]*$//')" + +[ -z "$open" ] && exit +if cat "$file" | grep -q "^.*$open.*$" ; then + notify-send "Bookmark Opened" "$open has been opened." + $BROWSER "$open" +else + notify-send "Opened DuckDuckGo" "Seached <i>$open</i>." + $BROWSER "https://duckduckgo.com/?q=$(echo $open | tr ' ' '+')" +fi diff --git a/sys/orgd b/sys/orgd new file mode 100755 index 0000000..3f0934c --- /dev/null +++ b/sys/orgd @@ -0,0 +1,5 @@ +#!/bin/sh +# orgd + +mkdir -p "$HOME/docs/wr/orgd" +wr "orgd/$1" diff --git a/sys/orgdenv b/sys/orgdenv new file mode 100755 index 0000000..9c537eb --- /dev/null +++ b/sys/orgdenv @@ -0,0 +1,27 @@ +#!/bin/sh + +# Set up the full gamut of ORGD environment variables based on the prompt +# path. + +# Usage: +# orgdenv .profile +# Add all default orgd paths, e.g. $HOME/docs/wr/orgd into .profile. +# orgdenv .zshrc ~/.local/orgd +# Add orgd paths starting at ~/.local/orgd into .zshrc. +# TODO: finish the envvars off. + +[ -z "$1" ] && echo "You must provide a file to add into." && exit +[ -z "$2" ] && ORGD_ROOT="$HOME/docs/wr/orgd" || ORGD_ROOT="$2" + +echo "$1" +echo "$2" +touch "$1" + +cat > "$1" <<-END + export ORGD_ROOT="$ORGD_ROOT" + # kt + export ORGD_KT_PATH="$ORGD_ROOT/kt" + export ORGD_BIB_PATH="$ORGD_KT_PATH/biblio" + export ORGD_BIBCSV_PATH="$ORGD_KT_PATH/biblio.csv" + export ORGD_MED_PATH="$ORGD_ROOT/med" +END diff --git a/sys/orgdresolv b/sys/orgdresolv new file mode 100755 index 0000000..59a2c4f --- /dev/null +++ b/sys/orgdresolv @@ -0,0 +1,35 @@ +#!/bin/sh +# Resolve an environment path if not present. Pass the name of the path here +# and it will output the path. +# For instance: orgdresolv ORGD_ROOT will output "$HOME/docs/wr/orgd/" + + +# TODO: add all envvars. +# Also, probably best to recursively resolve. So if $ORGD_BIBCSV_PATH not +# found, try $ORGD_KT_PATH/biblio.csv, if that envvar not found try +# $ORGD_ROOT/kt/biblio.csv, etc etc + +case $1 in + ORGD_ROOT) + [ -z "$ORGD_ROOT" ] && echo "$HOME/docs/wr/orgd" || echo "$ORGD_ROOT";; + ORGD_KT_PATH) + [ -z "$ORGD_KT_PATH" ] && echo "$HOME/docs/wr/orgd/kt" || echo "$ORGD_KT_PATH";; + ORGD_MED_PATH) + [ -z "$ORGD_MED_PATH" ] && echo "$HOME/docs/wr/orgd/med" || echo "$ORGD_MED_PATH";; + ORGD_BIBCSV_PATH) + [ -z "$ORGD_BIBCSV_PATH" ] && echo "$HOME/docs/wr/orgd/kt/biblio.csv" || echo "$ORGD_BIBCSV_PATH";; + ORGD_SD_PATH) + [ -z "$ORGD_SD_PATH" ] && echo "$HOME/docs/wr/orgd/sd" || echo "$ORGD_SD_PATH";; + ORGD_CDALIAS_PATH) + [ -z "$ORGD_CDALIAS_PATH" ] && echo "$HOME/docs/wr/orgd/sd/cd" || echo "$ORGD_CDALIAS_PATH";; + ORGD_TD_PATH) + [ -z "$ORGD_TD_PATH" ] && echo "$HOME/docs/wr/orgd/td" || echo "$ORGD_TD_PATH";; + ORGD_FIN_MONTHS) + [ -z "$ORGD_FIN_MONTHS" ] && echo "$HOME/docs/wr/trk/fin/ent" || echo "$ORGD_FIN_MONTHS";; + ORGD_TRK_PATH) + [ -z "$ORGD_TRK_PATH" ] && echo "$HOME/docs/wr/trk" || echo "$ORGD_TRK_PATH";; + *) + exit 1 ;; +esac + +exit 0 diff --git a/sys/powermenu b/sys/powermenu new file mode 100755 index 0000000..e9d6a2a --- /dev/null +++ b/sys/powermenu @@ -0,0 +1,9 @@ +#!/bin/sh + +resp=$(printf "♻️ shutdown\n⏼ reboot\n lock\nrestart dwm\nclose X" | dmenu) + +[ "$resp" = "♻️ shutdown" ] && sudo poweroff +[ "$resp" = "⏼ reboot" ] && sudo reboot +[ "$resp" = " lock" ] && slock +[ "$resp" = "restart dwm" ] && pkill dwm +[ "$resp" = "close X" ] && pkill xinit diff --git a/sys/vpnc b/sys/vpnc new file mode 100755 index 0000000..0a09fc0 --- /dev/null +++ b/sys/vpnc @@ -0,0 +1,4 @@ +#!/bin/sh + +sudo protonvpn c --p2p +pkill -RTMIN+7 dwmblocks diff --git a/sys/vpnd b/sys/vpnd new file mode 100755 index 0000000..f26a909 --- /dev/null +++ b/sys/vpnd @@ -0,0 +1,4 @@ +#!/bin/sh + +sudo protonvpn d +pkill -RTMIN+7 dwmblocks diff --git a/util/bkdir b/util/bkdir new file mode 100755 index 0000000..9bd7e3b --- /dev/null +++ b/util/bkdir @@ -0,0 +1,12 @@ +#!/bin/sh + +# Backup a directory using GPG. +# Usage: bkdir directory-name +# Requires: tar, gpg, sha256sum (i.e. GNU/Linux). + +DIRECTORY="$1" + +tar czvf "$DIRECTORY.tar.gz" "$DIRECTORY" +gpg --encrypt --armor --symmetric --output "$DIRECTORY.tar.gz.gpg" "$DIRECTORY.tar.gz" +sha256sum "$DIRECTORY.tar.gz.gpg" | cut -c1-64 > "$DIRECTORY.tar.gz.sum" + diff --git a/util/comment: b/util/comment: new file mode 100755 index 0000000..ae5a7be --- /dev/null +++ b/util/comment: @@ -0,0 +1,4 @@ +#!/bin/sh +# Does nothing. But you can write: +# comment: I am so cool, sunnavabitch +# So you can write comments. diff --git a/util/git-push-all b/util/git-push-all new file mode 100755 index 0000000..ffa3ff5 --- /dev/null +++ b/util/git-push-all @@ -0,0 +1,6 @@ +#!/bin/sh +# git-push-all: Iterate through all git remotes, and push to each of them. + +for rem in $(git remote) ; do + git push "$rem" +done diff --git a/util/isflag b/util/isflag new file mode 100755 index 0000000..214a989 --- /dev/null +++ b/util/isflag @@ -0,0 +1,13 @@ +#!/bin/sh +# Pass a flag name, and "$@", and this will check if the flag was passed. +# Example: isflag '-p' "$@" +# will check if the -p flag was passed to the program. + +term="$1" +shift +for arg; do + if [ "$arg" = "$term" ] ; then + return 0 + fi +done +return 1 diff --git a/util/music-dl b/util/music-dl new file mode 100755 index 0000000..21d0358 --- /dev/null +++ b/util/music-dl @@ -0,0 +1,14 @@ +#!/bin/sh +# Grab the audio track via yt-dlp, and place in the music folder. + +musicdir="/var/lib/mpd/music/yt-dlp" +record="$musicdir/dlrecord" + +mkdir -p "$musicdir" + +notify-send "Downloading..." "Downloading $1"& +yt-dlp "$1" --format bestaudio -P "$musicdir" -o "%(title)s.%(ext)s" +echo "$1" >> "$record" +notify-send "Song downloaded!" "$1 is now downloaded." & + +mpd update diff --git a/util/process-img b/util/process-img new file mode 100755 index 0000000..88e426b --- /dev/null +++ b/util/process-img @@ -0,0 +1,23 @@ +#!/bin/sh +# Process images in the directory. Creates: +# - A directory large/, with all the images in full. +# - A directory small/, with all the images 600x400. +# - An output file, images.html, with the figcaptions for each of them. +# The href of the large will be $1/large/image.jpg. +# +# TODO +# - Make it so it doesn't add entries for large/ and small/ dirs. + + +URL_PREFIX="$1" + +mkdir -p small +mkdir -p large + +for file in * +do + echo "Currently on: ", $file + cp "$file" "large/$file" + convert -resize 600X400 "$file" "small/$file" + echo "<figure>\n\t<a\n\t\thref=\"$1/large/$file\"><img\n\t\tsrc=\"small/$file\" alt=\"TODO\" width=\"600\"\n\t\theight=\"400\"/></a>\n<figcaption>TODO</figcaption>\n</figure>\n\n" >> images.html +done diff --git a/util/pvd b/util/pvd new file mode 100755 index 0000000..dc1b9fd --- /dev/null +++ b/util/pvd @@ -0,0 +1,4 @@ +#!/bin/sh +# mpv all files with an asterisk. + +mpv *$1* @@ -0,0 +1,10 @@ +#!/bin/sh +# rd: rename current directory +# rd "new-name" + + +[ "$1" = "" ] && echo "rd: rename directory: new name missing" && return +curr="$(basename "$(pwd)")" +cd .. +mv "$curr" "$1" +cd "$1" || return diff --git a/util/rdpdf b/util/rdpdf new file mode 100755 index 0000000..65c8d9b --- /dev/null +++ b/util/rdpdf @@ -0,0 +1,7 @@ +#!/bin/sh +# Locate PDFs and read them. +# Requires: locate, fzf, zathura. + +f="$(locate .pdf | fzf)" +[ -z "$f" ] && exit +zathura "$f" diff --git a/util/s6-restart b/util/s6-restart new file mode 100755 index 0000000..4e0e5e4 --- /dev/null +++ b/util/s6-restart @@ -0,0 +1,5 @@ +#!/bin/sh + +sudo s6-rc -d change $1 +sudo s6-rc -u change $1 + diff --git a/util/track-parcel b/util/track-parcel new file mode 100755 index 0000000..f298e9b --- /dev/null +++ b/util/track-parcel @@ -0,0 +1,7 @@ +#!/bin/sh +# Given a tracking reference either as first argument or piped in, +# open in $BROWSER, or xdg-open, the tracking site for that reference. + +# TODO: actually finish implementing. +xdg-open "https://www.evri.com/track/parcel/$1/details" +xdg-open "https://www.royalmail.com/track-your-item#/tracking-results/$1" @@ -0,0 +1,20 @@ +#!/bin/sh +# Watch video: it downloads it into $WV_DIRECTORY, then plays it. If no +# argument passed, it will select a video in $WV_DIRECTORY. + +if [ -z "$WV_DIRECTORY" ] ; then + echo "WV_DIRECTORY not set" + exit 1 +fi + +mkdir -p "$WV_DIRECTORY" + +if [ -z "$1" ] ; then + # No args. + echo "No args: TODO: implement selecting video in WV_DIRECTORY" + exit 1 +fi + +yt-dlp "$1" -P "$WV_DIRECTORY" -o "%(title)s.%(ext)s" -f "bv*[height<=720]+ba/b[height<=720] / wv*+ba/w" +fn="$(yt-dlp "$1" -P "$WV_DIRECTORY" -o "%(title)s.%(ext)s" --print filename)" +mpv "$fn" diff --git a/util/yt-suffix b/util/yt-suffix new file mode 100755 index 0000000..fc9ccb4 --- /dev/null +++ b/util/yt-suffix @@ -0,0 +1,12 @@ +#!/bin/sh +# Get the suffix from a Youtube video, or Invidious instance. +# https://youtube.com/watch?v=dQw4w9WgXcQ -> dQw4w9WgXcQ +# Pass the -w flag if you want to keep the watch?v= +# Usage: +# yt-suffix PATH (-w) + +if isflag '-w' "$@" ; then + echo "watch?v=" +fi + +echo $1 | awk -F'/' '{print $4}' | awk -F'=' '{print $2}' diff --git a/web/biblio-by-month b/web/biblio-by-month new file mode 100755 index 0000000..ee42044 --- /dev/null +++ b/web/biblio-by-month @@ -0,0 +1,207 @@ +#!/usr/bin/env ruby + +require 'date' + +# TODO: this. +# Take a file as first argument, which is to be the file biblio.csv, containing +# all books read. Then formats this as a table. It sorts the books in +# the order [Ongoing, Completed, Yet to Read], and replaces several values with +# ones more appropriate for viewing pleasure. +# For the final column (index: 11, zero-indexed) we replace the contents with a +# link. So rd/the-progress-of-a-crime becomes +# For column 3 (Part), this is rounded as special logic. +# <a href="https://gabbott.dev/rd/the-progress-of-a-crime>Link</a> + +require_relative './biblio-require' + +if ARGV[0] == nil then + puts "<!-- No argument passed! ma-fmt-tbl Exitting early. -->\n" + exit +end + +# def do_header(h: str): str +# Returns the rows of the table corresponding to the header. +def do_header(h) + s = "\t<tr class=\"header\">\n" + values = h.split($delim) + + values.each_with_index do |value, idx| + next if idx == 0 or idx == 6 or idx == 7 or idx == 8 or idx == 9 + s << ("\t\t<th>" + value + "</th>\n") + end + + s << "\t</tr>\n" + return s +end + +# Make the string look sexy, ooh la la. +def sexify(val) + # Round integers if they end .00. + if val.end_with? ".00" then + integral = val.to_i + unless integral == 0 + return integral.to_s + end + end + + # Transform strings. + if $status_transform.has_key? (val) + return $status_transform[val] + end + if $form_transform.has_key? (val) + return $form_transform[val] + end + if $ownership_transform.has_key? (val) + return $ownership_transform[val] + end + if $general_transform.has_key? (val) + return $general_transform[val] + end + return val +end + + +ret="" +header="" + +# Contains the buckets into which to put the entries. +unknown = [] # typeof(unknown) == array[str] +known = {} # typeof(known) == Hash[str => array[str]] + +def written_month_of(ym) + # Takes, e.g. "2023-09" and returns "September 2023". Invariant: entry must + # be of form "YYYY-MM". + month = ym[-2..-1] + ret = "" + month_name = Date::MONTHNAMES[month.to_i] + ret << month_name << " " << ym[0..3] + return ret +end + +def wrap_entries_in_table(entries, header) + # Call after string made of all entries. This fn wraps them into the table. + ret = "" + ret << "<table class=\"biblio\">\n" \ + << header \ + << entries \ + << "</table>\n" + + return ret +end + +def make_html_entry(entry) + # Makes a singular entry. + ret = "" + ret << "\t<tr>\n" + entry.split($delim).each_with_index do |e, i| + next if i == 0 or i == 6 or i == 7 or i == 8 or i == 9 + e = e.delete "\n" + if i == 11 and e != "N/A" then + ret << "\t\t<td class=\"biblio-tr\"><a href=\"" \ + << ENV["WEBSITE_URL"] \ + << "/" \ + << e \ + << "\">Link</a></td>\n" + else + ret << "\t\t<td class=\"biblio-tr\">" \ + << sexify(e) \ + << "</td>\n" + end + end + + ret << "\t</tr>\n" + return ret +end + +File.foreach(ARGV[0]).with_index do |line, line_num| + # 0. If entry not completed, skip, otherwise ...; [done] + # 1. Figure out what month the line corresponds to; + # 2. Chuck line into a bucket corresponding to entries in that month; + # 3. Sorting that bucket into the right month, and make the table out of the + # entries. + if line_num == 0 then # Must go first, otherwise skipped by checks below. + header << do_header(line) + end + + next if line == "\n" or line == "\t" or line == "" or line == " " or line == $delim + next if not line.include? "completed;" + + finished_date = line.split($delim)[5] + if finished_date == "" or finished_date == "\t" or finished_date == "N/A" then + unknown = unknown.append line + else + # Invariant: everything completed is either unknown date, or has at least + # a year and a month (but not necessarily a day). We use this, e.g. + # "2023-01", as the index for the month. + + index = finished_date[0..6] + # It is possible for the index not to be added here, so if this is the case + # just add the index as [] and then we directly append to what we've just + # added. + if not known.has_key? (index) + known[index] = [] + end + + # And now we can append. + known[index] = (known[index] << line) + end +end + +# Sort hash, so we can simply iterate over it. +known = known.sort.reverse.to_h + +# Make HTML for "Unknown"s +unknown = unknown.map! { |entry| make_html_entry(entry) }.join ("\n") +unknown_table = wrap_entries_in_table(unknown, header) # typeof == str + +unkn_ret = "" +unkn_ret << "<h2>Unknown</h2>\n" \ + << unknown_table + +kn_rets = [] +# Make HTML for each month. +known.each do |key, values| + # Here, values is an array of all entries. We want to merge then together, + # and thereby get the table. + values = values.map! { |value| make_html_entry(value) }.join ("\n") + known_table = wrap_entries_in_table(values, header) # typeof == str + kn_ret = "" + kn_ret << "<h2>" \ + << written_month_of(key) \ + << "</h2>\n" \ + << known_table + + kn_rets = kn_rets.append(kn_ret) +end + + + + + + +# File.foreach(ARGV[0]).with_index do |line, line_num| +# next if line == "\n" or line == "\t" or line == "" or line == " " or line == $delim +# +# # Handle the first line - the header. +# if line_num == 0 then +# header << do_header(line) +# else +# # We need to figure out whether it is ongoing, completed, or yet to read. +# # To do this, we will check if the corresponding string is in the line. +# if line.include? "completed;" then +# target = table_cmp +# elsif line.include? "ongoing;" then +# target = table_ongoing +# elsif line.include? "dropped;" then +# target = table_drp +# else +# target = table_rest +# end +# +# end +# end + +# Echo the file. + +puts kn_rets +puts unkn_ret diff --git a/web/biblio-fmt-tbl b/web/biblio-fmt-tbl new file mode 100755 index 0000000..0296e8b --- /dev/null +++ b/web/biblio-fmt-tbl @@ -0,0 +1,181 @@ +#!/usr/bin/env ruby +# Take a file as first argument, which is to be the file biblio.csv, containing +# all books read. Then formats this as a table. It sorts the books in +# the order [Ongoing, Completed, Yet to Read], and replaces several values with +# ones more appropriate for viewing pleasure. +# For the final column (index: 11, zero-indexed) we replace the contents with a +# link. So rd/the-progress-of-a-crime becomes +# For column 3 (Part), this is rounded as special logic. +# <a href="https://gabbott.dev/rd/the-progress-of-a-crime>Link</a> + +require_relative './biblio-require' + + + +if ARGV[0] == nil then + puts "<!-- No argument passed! ma-fmt-tbl Exitting early. -->\n" + exit +end + +# def do_header(h: str): str +# Returns the rows of the table corresponding to the header. +def do_header(h) + s = "\t<tr class=\"header\">\n" + values = h.split($delim) + + values.each_with_index do |value, idx| + next if idx == 0 or idx == 7 or idx == 8 or idx == 9 + s << ("\t\t<th>" + value + "</th>\n") + end + + s << "\t</tr>\n" + return s +end + +# Make the string look sexy, ooh la la. +def sexify(val) + # Round integers if they end .00. + if val.end_with? ".00" then + integral = val.to_i + unless integral == 0 + return integral.to_s + end + end + + # Transform strings. + if $status_transform.has_key? (val) + return $status_transform[val] + end + if $form_transform.has_key? (val) + return $form_transform[val] + end + if $ownership_transform.has_key? (val) + return $ownership_transform[val] + end + if $general_transform.has_key? (val) + return $general_transform[val] + end + return val +end + + +# The tables, which are set as targets during the look +table="" +table_ongoing="" +table_cmp="" # Just contains completed entries. +table_paused="" +table_drp="" +table_rest="" +table_coll="" + +# And the counts, for adding in counts if I want +ctable_ongoing=0 +ctable_cmp=0 +ctable_paused=0 +ctable_drp=0 +ctable_rest=0 +ctable_coll=0 + +# And the header, don't forget! +header="" + +File.foreach(ARGV[0]).with_index do |line, line_num| + next if line == "\n" or line == "\t" or line == "" or line == " " or line == $delim + + # Handle the first line - the header. + if line_num == 0 then + header << do_header(line) + else + # We need to figure out whether it is ongoing, completed, or yet to read. + # To do this, we will check if the corresponding string is in the line. + if line.include? "completed;" then + target = table_cmp + ctable_cmp += 1 + elsif line.include? "ongoing;" then + target = table_ongoing + ctable_ongoing += 1 + elsif line.include? "paused;" then + target = table_paused + ctable_paused += 1 + elsif line.include? "dropped;" then + target = table_drp + ctable_drp += 1 + elsif line.include? "collection;" then + target = table_coll + ctable_coll += 1 + else + target = table_rest + ctable_rest += 1 + end + + target << "\t<tr>\n" + line.split($delim).each_with_index do |entry, idx| + # We want to skip: Status, Ownership, Bought, Cost as they just take up + # space. Here we are skipping by the relevant index. + next if idx == 0 or idx == 7 or idx == 8 or idx == 9 + + entry = entry.delete "\n" + if idx == 11 and entry != "N/A" then + # Review column: transform it to contain a link. + target << "\t\t<td class=\"biblio-tr\"><a href=\"" \ + << ENV["WEBSITE_URL"] \ + << "/" \ + << entry \ + << "\">Link</a></td>\n" + else + target << "\t\t<td class=\"biblio-tr\">" \ + << sexify(entry) \ + << "</td>\n" + end + end + target << "\t</tr>\n" + end +end + +# Instead of one table, split into <h2>Currently Reading</h2><table></table>, +# <h2>Completed</h2><table></table> and <h2>Not read or +# reference</h2><table></table>. +table << "<h2>Currently Reading</h2>\n" +table << "<p>There are " << ctable_ongoing.to_s << " entries in this table.</p>\n" +table << "<table class=\"biblio\">\n" +table << header +table << table_ongoing +table << "</table>\n\n" + +table << "<h2>Completed</h2>\n" +table << "<p>There are " << ctable_cmp.to_s << " entries in this table.</p>\n" +table << "<table class=\"biblio\">\n" +table << header +table << table_cmp +table << "</table>\n\n" + +table << "<h2>Paused</h2>\n" +table << "<p>There are " << ctable_paused.to_s << " entries in this table.</p>\n" +table << "<table class=\"biblio\">\n" +table << header +table << table_paused +table << "</table>\n\n" + +table << "<h2>Collections of Works</h2>\n" +table << "<table class=\"biblio\">\n" +table << header +table << table_coll +table << "</table>\n\n" + +table << "<h2>Dropped</h2>\n" +table << "<p>There are " << ctable_drp.to_s << " entries in this table.</p>\n" +table << "<table class=\"biblio\">\n" +table << header +table << table_drp +table << "</table>\n\n" + +table << "<h2>Not read or reference</h2>\n" +table << "<p>There are " << ctable_rest.to_s << " entries in this table.</p>\n" +table << "<table class=\"biblio\">\n" +table << header +table << table_rest +table << "</table>\n\n" + +# Echo the file. +puts table + diff --git a/web/biblio-require.rb b/web/biblio-require.rb new file mode 100755 index 0000000..65ca235 --- /dev/null +++ b/web/biblio-require.rb @@ -0,0 +1,36 @@ +#!/usr/bin/env ruby + +$status_transform = { + "yet-to-read" => "Not yet read", + "completed" => "Completed", + "ordered" => "On Order", + "ongoing" => "Currently Reading", + "reference" => "Reference", + "not-owned" => "Not owned.", + "dropped" => "Dropped", + "collection" => "Collection", + "paused" => "Paused" +} + +$form_transform = { + "audiobook" => "Audiobook", + "physical" => "Physical Book", + "virtual" => "PDF", # Deprecated attribute - use pdf instead. + "pdf" => "PDF", + "epub" => "EPUB", + "light-novel" => "LN", + "manga" => "Manga" + +} + +$ownership_transform = { + "owned" => "Owned", + "borrowed" => "Borrowed", + "not-owned" => "Not owned" +} + +$general_transform = { + "N/A" => "" +} + +$delim = ";" @@ -0,0 +1,18 @@ +#!/bin/sh +# Bring Sally Up: make an update to Bring Sally Up, and it will create a commit +# for that change. It won't push without `-u`, in case the commit can be +# amended. + +FILEPATH="$HOME/web/www/gabbott.dev/gabbott.dev/blog/pushups/bring-sally-up.html" +ORIGHASH="$(sha256sum "$FILEPATH")" + +nvim "$FILEPATH" +if [ "$(sha256sum "$FILEPATH")" = "$ORIGHASH" ] ; then + echo "No changes made, hence no commit will be made" + exit 0 +else + git commit -m "Bring Sally Up: entry for $(date +%Y-%m-%d)" + # TODO: handle `-u`. +fi + + diff --git a/web/fmt-as-table b/web/fmt-as-table new file mode 100755 index 0000000..c7064b5 --- /dev/null +++ b/web/fmt-as-table @@ -0,0 +1,75 @@ +#!/usr/bin/env ruby +# fmt-as-table ORIGIN HEADER OPTION +# ORIGIN: the file to format as a table. Each row must be newline-delimited, +# and each column tab-delimited. Anything following a # is treated as +# a comment and ignored. +# HEADER: the headers. This must be passed as a single string with each column +# tab-delimited. +# OPTION: a string specifying output format options, comma-delimited. Currently +# supported are: +# collapsible(summary) Create a <details> tag surrounding it, to make +# the table collapsible. `summary` must be a string +# which contains the text to place in the <summary> +# tag of the <details>. + + +if ARGV[0] == nil or ARGV[1] == nil then + puts "No argument passed! Exitting early.\n" + exit +end + +## Handle options +is_collapsible = false +collapsible_summary = "" + + + +option="" +if ARGV[2] != nil then + option=ARGV[2] +end + +options=option.split "," +options.each do |opt| + if opt[0..10] == "collapsible" then + is_collapsible = true + collapsible_summary = opt.split("(")[1].split(")")[0] + end +end + +table="" + +if is_collapsible then + table << "<details>\n" + table << "<summary>" << collapsible_summary << "</summary>\n" +end + +# Sort out the header. +table << "<table>\n" +table << "\t<tr class=\"header\">\n" +ARGV[1].split("\t").each do |entry| + table << ("\t\t<th>" + entry + "</th>\n") +end +table << "\t</tr>\n\n" + +# Now sort out the actual file. + +File.foreach(ARGV[0]).with_index do |line, line_num| + next if line[0] == '#' + next if line == "\n" or line == "\t" or line == "" + table << "\t<tr>\n" + line.split("\t").each do |entry| + table << ("\t\t<td>" + entry.delete("\n") + "</td>\n") + end + table << "\t</tr>\n" +end + +table << "</table>\n" + +if is_collapsible then + table << "</details>" +end + +# Echo the file. +puts table + diff --git a/web/links b/web/links new file mode 100755 index 0000000..534ab9b --- /dev/null +++ b/web/links @@ -0,0 +1,5 @@ +#!/bin/sh +# Edit links. + +nvim "$WEBSITE_PATH/links.html" +ws-push diff --git a/web/ma-fmt-tbl b/web/ma-fmt-tbl new file mode 100755 index 0000000..639ecf1 --- /dev/null +++ b/web/ma-fmt-tbl @@ -0,0 +1,73 @@ +#!/usr/bin/env ruby +# Takes a file as first argument, and formats that table which should +# be in tab delimited form with optional comment lines beginning with # +# into a table for HTML. +# The second argument is a known quantity - because we also need to calculate +# the final fields of each entry. + +def kph(time) + time = time.to_i + time_h = time / (60.0 * 60.0) + distance = 0.47 + return distance / time_h +end + +def mph(time) + return kph(time) * 0.6213712 +end + +if ARGV[0] == nil then + puts "<!-- No argument passed! ma-fmt-tbl Exitting early. -->\n" + exit +end + + +table="" + +# Sort out the header. +table << "<table>\n" +table << "\t<tr class=\"header\">\n" +table << "\t\t<th>Date</th>\n" +table << "\t\t<th>Set</th>\n" +table << "\t\t<th>Time Taken (s)</th>\n" +table << "\t\t<th>Heart Rate (bpm)</th>\n" +table << "\t\t<th>Stops</th>\n" +table << "\t\t<th>Begin Time</th>\n" +table << "\t\t<th>End Time</th>\n" +table << "\t\t<th>Kph</th>\n" +table << "\t\t<th>Mph</th>\n" +table << "\t</tr>\n" + + +# Now sort out the actual file. + +File.foreach(ARGV[0]).with_index do |line, line_num| + next if line[0] == '#' + next if line == "\n" or line == "\t" or line == "" or line == " " + table << "\t<tr>\n" + line.split("\t").each do |entry| + table << ("\t\t<td>" + entry.delete("\n") + "</td>\n") + end + + splits = line.split("\t") + splits_len = splits.length + time = splits[2] + kph_v = kph(time) + mph_v = mph(time) + while splits_len < 7 + # In case any entries are missing, pad to that amount. + table << "\t\t<td></td>\n" + splits_len += 1 + end + + table << ("\t\t<td>" + kph_v.round(2).to_s + "</td>\n") + table << ("\t\t<td>" + mph_v.round(2).to_s + "</td>\n") + + table << "\t</tr>\n" +end + +table << "</table>\n" + +# Echo the file. +puts table + diff --git a/web/mkblog b/web/mkblog new file mode 100755 index 0000000..ea91535 --- /dev/null +++ b/web/mkblog @@ -0,0 +1,22 @@ +#!/bin/sh +# Make a blog entry. Either a new entry, or edit an existing entry. + + +TEMPLATE="$BLOG_PATH/template.html" +ENTRIES_DIR="$BLOG_PATH/entries" +FILE="$ENTRIES_DIR/$1.html" + +# Handle if no parameters passed. # +if [ -z "$1" ] ; then + nvim "$ENTRIES_DIR" + exit 0 +fi + +# If parameter passed. # +if [ ! -f "$FILE" ] ; then + # We have a new blog entry. Copy template and edit that. + cp "$TEMPLATE" "$FILE" + nvim "$FILE" +else + nvim "$FILE" +fi diff --git a/web/mount-ave b/web/mount-ave new file mode 100755 index 0000000..e3b9ad9 --- /dev/null +++ b/web/mount-ave @@ -0,0 +1,34 @@ +#!/bin/sh +# Updates the Mount Avenue tracker - to do this, an entry must be made in +# trk/mount-avenue, and then this is copied over to the website where a new +# entry is made, by replacing the contents of <!-- ma:begin --> and +# <!-- ma:end -->. + +# Constants # +WEBPAGE_PATH="$BLOG_PATH/training/mount-ave.html" +DELIMITER_BEGIN="<!-- ma:begin -->" +DELIMITER_END="<!-- ma:end -->" +TABLE_FILE='/tmp/ma-tbl-formatted' + +trk_path="$(orgdresolv "ORGD_TRK_PATH")"/mount-avenue + + +# Modify the document and check for changes. +hash_before="$(sha256sum "$trk_path")" +trk mount-avenue +hash_after="$(sha256sum "$trk_path")" + +if [ "$hash_before" = "$hash_after" ] ; then + echo "No changes made - exitting early." + exit 0 +fi +table_formatted="$(ma-fmt-tbl "$trk_path")" + +echo "$table_formatted" > "$TABLE_FILE" +sed -i -ne "/$DELIMITER_BEGIN/ {p; r $TABLE_FILE" -e ":a; n; /$DELIMITER_END/ {p; b}; ba}; p" "$WEBPAGE_PATH" + +# Commit and push the changes +cd "$(dirname "$WEBPAGE_PATH")" +git add "$(basename "$WEBPAGE_PATH")" +git commit -m "Mount Avenue: updated $(date +"%Y-%m-%d %H:%M")" +git-push-all diff --git a/web/mount-ave-speeds b/web/mount-ave-speeds new file mode 100755 index 0000000..bc2df4e --- /dev/null +++ b/web/mount-ave-speeds @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +# Run as +# mount-ave-speeds <time-in-secs> +# And get back the kph and mph. + +time = ARGV[0].to_i +km2m_constant = 0.6213712 +time_h = time / (60.0 * 60.0) +km = 0.47 + +kph = (km / time_h) +mph = kph * km2m_constant + +print "Time taken: ", time, "\n" +print "KPH: ", kph.round(2), "\n" +print "MPH: ", mph.round(2), "\n" + + @@ -0,0 +1,5 @@ +#!/bin/sh +# now: edit the now document, similar to mer. + +$EDITOR "$WEBSITE_PATH/now.html" +ws-push diff --git a/web/training b/web/training new file mode 100755 index 0000000..c60edd2 --- /dev/null +++ b/web/training @@ -0,0 +1,10 @@ +#!/bin/sh +# Updates the training/general page of the website for the day. +# To do this, an entry is added in trk/training and then is copied over into +# the website, formatted correctly, and a commit made. + +ORIGIN="$(orgdresolv "ORGD_TRK_PATH")"/training +DEST="$BLOG_PATH/training/general.html" + + +ws-replace "<!-- training:begin -->" "<!-- training:end -->" "$ORIGIN" "$DEST" "Training" "txt" "training-format-table" "$(date +"%Y-%m")" diff --git a/web/training-format-table b/web/training-format-table new file mode 100755 index 0000000..4638578 --- /dev/null +++ b/web/training-format-table @@ -0,0 +1,12 @@ +#!/bin/sh +# training-format-table ORIGIN_FILE +# This will also iterate over every month, and create the relevant table +# headers, before passing to fmt-as-table. +# TODO: make it automated for each month, but for now, it can be manually added +# months. + +# 2023-10 +fmt-as-table "$1/2023-10" "Index Date Sit-ups Planks Squats Ball Squats Comments" "collapsible(2023-10)" + +# 2023-11 +fmt-as-table "$1/2023-11" "Index Date Press-ups Planks Dumbbells Ball Squats Comments" "collapsible(2023-11)" diff --git a/web/ws-push b/web/ws-push new file mode 100755 index 0000000..768e9ef --- /dev/null +++ b/web/ws-push @@ -0,0 +1,19 @@ +#!/bin/sh +# ws-push +# Run without arguments. Pushed the local copy of the website to the server. + +if [ -z "$REMOTE_URL" ] ; then + echo "REMOTE_URL not set!" + exit 1 +fi + +if [ -z "$WS_REMOTE_ACCT" ] ; then + echo "WS_REMOTE_ACCT not set!" + exit 2 +fi + +SERVER_PATH="/var/rsync-www" +SERVER_DEST="$WS_REMOTE_ACCT:$SERVER_PATH" +LOCAL_PATH="$HOME/web/www/" # Don't forget the trailing slash! + +rsync -azPv --delete "$LOCAL_PATH" "$SERVER_DEST" diff --git a/web/ws-replace b/web/ws-replace new file mode 100755 index 0000000..6870033 --- /dev/null +++ b/web/ws-replace @@ -0,0 +1,65 @@ +#!/bin/sh +# Takes: +# ws-replace begin end origin dest commitident txt|csv script +# Begin: <!-- ident:begin --> +# End: <!-- ident:end --> +# Origin: $HOME/docs/wr/orgd/kt/biblio.csv +# Dest: $WEBSITE_PATH/rd/index.html +# Commitident: Biblio (: updated ...) +# Txt|Csv: csv +# script: biblio-by-month +# File If Origin gives a directory (as for example, the script called +# will update a whole directory), then File gives the exact file +# to modify. +# If `txt`: +# Removes all comments; treats each line as an entry, +# and tab as the delimiter. Edits are made with: $EDITOR +# or $VISUAL or nvim or vim or vi. +# If `csv`: +# Calls out to an external script, $SCRIPT to generate +# the HTML. +# Both then substitute the HTML in. + +DELIMITER_BEGIN="$1" +DELIMITER_END="$2" +ORIGIN="$3" +DEST="$4" +COMMITIDENT="$5" +TXTCSV="$6" +SCRIPT="$7" +TABLE_FILE="/tmp/$5-formatted" +FILE="$8" + +# Work out $EDITWITH +if [ "$TXTCSV" = "txt" ] ; then + EDITWITH="$EDITOR" + # TODO: add VISUAL, nvim, vim, vi... +else + EDITWITH="sc-im" +fi + +if [ -z "$FILE" ] ; then + hash_before="$(sha256sum $ORIGIN)" + $EDITWITH "$ORIGIN" + hash_after="$(sha256sum $ORIGIN)" +else + # As $ORIGIN is a directory, so here we specify the exact file. + hash_before="$(sha256sum "$ORIGIN/$FILE")" + $EDITWITH "$ORIGIN/$FILE" + hash_after="$(sha256sum "$ORIGIN/$FILE")" +fi + +if [ "$hash_before" = "$hash_after" ] ; then + echo "No changes made - quitting early!" + exit 0 +fi + +echo "Changes will be made." + +formatted="$($SCRIPT "$ORIGIN")" +echo "$formatted" > "$TABLE_FILE" +sed -i -ne "/$DELIMITER_BEGIN/ {p; r $TABLE_FILE" -e ":a; n; /$DELIMITER_END/ {p; b}; ba}; p" "$DEST" + +# Commit and push the changes +ws-push + diff --git a/wr/evmnhol b/wr/evmnhol new file mode 100755 index 0000000..ef56204 --- /dev/null +++ b/wr/evmnhol @@ -0,0 +1,16 @@ +#!/bin/sh +# evmnhol +# First set EVMNHOL_DIR as the directory in $HOME/docs/wr/lle/hol/ to write to, +# then run evmnhol with the date you want to write to. + + +if [ -z "$EVMNHOL_DIR" ] ; then echo "EVMNHOL_DIR is not set"; return; fi +if [ -z "$1" ] ; then echo "You need to pass a date"; return; else DT="$1" fi +if [ ! -d "$HOLIDAY/$EVMNHOL_DIR" ] ; then echo "$HOLIDAY/$EVMNHOL_DIR does not exist"; return; fi + +# TODO: add logic to verify the date using md. But check md actually +# exists first. Use date +%s -d "$(cat md | grep begin | cut -d'=' -f2)" + +mkdir -p "$HOME/docs/wr/lle/$(date +%Y-%m -d $DT)" +wr "lle/$(date +%Y-%m -d $DT)/H$(date --iso-8601 -d $DT).txt" +ln -s "../../$(date +%Y-%m -d $DT)/H$(date --iso-8601 -d $DT).txt" "$HOLIDAY/$EVMNHOL_DIR/H$(date --iso-8601 -d $DT).txt" @@ -0,0 +1,6 @@ +#!/bin/sh +# holc <holiday> <date> + +[ -z $1 ] && DT="today" || DT="$1" +mkdir -p "$HOME/docs/wr/lle/$(date +%Y-%m -d $DT)" +nvim "$HOME/docs/wr/lle/$(date +%Y-%m -d $DT)/H$(date --iso-8601 -d $DT).txt" @@ -0,0 +1,5 @@ +#!/bin/sh +# kt + +mkdir -p "$HOME/docs/wr/orgd/kt" +orgd "kt/$1" @@ -0,0 +1,6 @@ +#!/bin/sh +# lle + +[ -z "$1" ] && DT="today" || DT="$1" +mkdir -p "$HOME/docs/wr/lle/$(date +%Y-%m -d "$DT")" +wr "lle/$(date +%Y-%m -d "$DT")/L$(date --iso-8601 -d "$DT").txt" diff --git a/wr/lssec b/wr/lssec new file mode 100755 index 0000000..9a98b79 --- /dev/null +++ b/wr/lssec @@ -0,0 +1,4 @@ +#!/bin/sh +# lssec + +ls "$HOME/docs/wr/sec" $@ diff --git a/wr/mdsec b/wr/mdsec new file mode 100755 index 0000000..031f5a7 --- /dev/null +++ b/wr/mdsec @@ -0,0 +1,28 @@ +#!/bin/sh +# mdsec: modify a secure entry, writing it back after. + +[ -z "$DEFAULT_GPG" ] && echo "DEFAULT_GPG not set" && return +[ ! -f "$HOME/docs/wr/sec/$1" ] && echo "File $1 does not exist" && return +mkdir -p "/tmp/mksec" + +# File names +temp="/tmp/mksec/$1.decrypted" +ck="/tmp/mksec/$1-modck.decrypted" +src="$HOME/docs/wr/sec/$1" +dest="$src" + + +gpg -d --output "$temp" "$src" +cp "$temp" "$ck" +nvim "$temp" + +# Only try to save if a modification has been made, tested with modification +# date, where the edited file should only be -nt if its been modified/saved. +if [ "$temp" -nt "$ck" ] ; then + gpg --encrypt --armor --symmetric -r "$DEFAULT_GPG" --output "$dest" "$temp" +else + printf "No modification made - no changes saved\n" +fi + +shred -u "$temp" +shred -u "$ck" @@ -0,0 +1,6 @@ +#!/bin/sh +# mer + +if [ -z $1 ] ; then DT="yesterday" else DT="$1" fi +mkdir -p "$HOME/docs/wr/lle/$(date +%Y-%m -d $DT)" +nvim "$HOME/docs/wr/lle/$(date +%Y-%m -d $DT)/M$(date +%Y-%m -d $DT).txt" diff --git a/wr/mkhol b/wr/mkhol new file mode 100755 index 0000000..4b8c02a --- /dev/null +++ b/wr/mkhol @@ -0,0 +1,10 @@ +#!/bin/sh +# mkhol +if [ -z "$HOLIDAY" ] ; then HOL="$HOLIDAY" else HOL="$HOME/docs/wr/lle/hol" fi +if [ -z "$1" ] ; then + # TODO: add logic to verify the date is valid + echo "You need to provide a date parameter"; return; fi +if [ -z "$2" ] ; then echo "Please enter a place where you went."; + return; fi + +mkdir -p "$HOL/$1-$2" @@ -0,0 +1,5 @@ +#!/bin/sh +# mn + +mkdir -p "$HOME/docs/wr/mn" +wr "mn/$1" diff --git a/wr/mndream b/wr/mndream new file mode 100755 index 0000000..25fbcac --- /dev/null +++ b/wr/mndream @@ -0,0 +1,6 @@ +#!/bin/sh +# mndream + +[ -z $1 ] && DT="yesterday" || DT="$1" +mkdir -p "$HOME/docs/wr/dream" +wr "dream/D$(date --iso-8601 -d $DT).txt" diff --git a/wr/mnholmd b/wr/mnholmd new file mode 100755 index 0000000..f359ff2 --- /dev/null +++ b/wr/mnholmd @@ -0,0 +1,18 @@ +#!/bin/sh +# mnholmd: Create the metadata file for a holiday file. +# mnholmd <date> <place-name> + +if [ -z "$HOLIDAY" ] ; then HOL="$HOLIDAY" else HOL="$HOME/docs/wr/lle/hol" fi +if [ -z "$1" ] ; then + # TODO: add logic to verify the date is valid + echo "You need to provide a date parameter"; return; fi +if [ -z "$2" ] ; then echo "Please enter a place where you went."; + return; fi +# logic +if [ ! -d "$HOL/$1-$2" ] ; then echo "$1-$2 does not exist"; return; fi +if [ -f "$HOL/$1-$2/md" ] ; then + nvim "$HOL/$1-$2/md" +else + echo "begin=\nend=\nwith=\nat=\n" >> "$HOL/$1-$2/md" + nvim "$HOL/$1-$2/md" +fi diff --git a/wr/mnkic b/wr/mnkic new file mode 100755 index 0000000..7f5ab0c --- /dev/null +++ b/wr/mnkic @@ -0,0 +1,5 @@ +#!/bin/sh +# mnkic + +mkdir "$HOME/docs/wr/kic" -p +wr "kic/$1" diff --git a/wr/mnman b/wr/mnman new file mode 100755 index 0000000..df72b17 --- /dev/null +++ b/wr/mnman @@ -0,0 +1,5 @@ +#!/bin/sh +# mnman + +mkdir -p "$HOME/docs/wr/man" +wr "man/$1" diff --git a/wr/mnrec b/wr/mnrec new file mode 100755 index 0000000..26e5b81 --- /dev/null +++ b/wr/mnrec @@ -0,0 +1,5 @@ +#!/bin/sh +# mnrec + +mkdir -p "$HOME/docs/wr/rec" +wr "rec/$1" diff --git a/wr/mnsec b/wr/mnsec new file mode 100755 index 0000000..8f1d3ca --- /dev/null +++ b/wr/mnsec @@ -0,0 +1,8 @@ +#!/bin/sh +# mnsec: Make a secure encrypted entry using GPG. + +[ -z "$DEFAULT_GPG" ] && echo "DEFAULT_GPG not set" && return +mkdir -p "/tmp/mksec" +nvim "/tmp/mksec/$1" +gpg --encrypt --armor --symmetric -r "$DEFAULT_GPG" --output "$HOME/docs/wr/sec/$1" "/tmp/mksec/$1" +shred -u "/tmp/mksec/$1" diff --git a/wr/rddream b/wr/rddream new file mode 100755 index 0000000..706e088 --- /dev/null +++ b/wr/rddream @@ -0,0 +1,8 @@ +#!/bin/sh +# rddream +if [ -z "$1" ] ; then + wr "dream" + exit +else + wr "dream/D$(date --iso-8601 -d $DT).txt" +fi diff --git a/wr/rdsec b/wr/rdsec new file mode 100755 index 0000000..21ba438 --- /dev/null +++ b/wr/rdsec @@ -0,0 +1,8 @@ +#!/bin/sh +# rdsec: Read a secure entry, will NOT write it back after. + +[ ! -f "$HOME/docs/wr/sec/$1" ] && echo "File $1 does not exist" && return +mkdir -p "/tmp/mksec" +gpg -d --output "/tmp/mksec/$1.decrypted" "$HOME/docs/wr/sec/$1" +nvim "/tmp/mksec/$1.decrypted" +rm "/tmp/mksec/$1.decrypted" diff --git a/wr/tasks b/wr/tasks new file mode 100755 index 0000000..2d9e3e0 --- /dev/null +++ b/wr/tasks @@ -0,0 +1,3 @@ +#!/bin/sh + +wr tasks @@ -0,0 +1,3 @@ +#!/bin/sh + +wr trk/$1 @@ -0,0 +1,4 @@ +#!/bin/sh + +mkdir -p "$HOME/docs/wr" +nvim "$HOME/docs/wr/$1" @@ -0,0 +1,6 @@ +#!/bin/sh +# yer + +[ -z "$1" ] && DT="yesterday" || DT="$1" +mkdir -p "$HOME/docs/wr/lle/$1-12" +nvim "$HOME/docs/wr/lle/$1-12/Y$1.txt" |