Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
b878c90
more stable wait_for
KommuSoft Aug 16, 2025
4051ab8
better white-black front colors for whatday
KommuSoft Aug 17, 2025
c32e36f
validate json data
KommuSoft Aug 17, 2025
bedb464
update checkout script
KommuSoft Aug 17, 2025
1bd181f
add pass-extension-otp
KommuSoft Aug 17, 2025
10dbca9
otp
KommuSoft Aug 17, 2025
fdfa17e
timeprompt
KommuSoft Aug 17, 2025
e588ca9
allow immediate ending in the waitfor command
KommuSoft Aug 17, 2025
f68b13a
allow cancelling waitfors
KommuSoft Aug 17, 2025
710e372
rabbitdoc
KommuSoft Aug 26, 2025
3ab6688
install GitHub cli
KommuSoft Aug 26, 2025
59f2909
gitcpr
KommuSoft Aug 26, 2025
4bd5f8f
exit code waitfor
KommuSoft Aug 27, 2025
811966b
mark early exits
KommuSoft Aug 27, 2025
7948269
open browser to issue
KommuSoft Aug 29, 2025
9894062
gitpr
KommuSoft Aug 29, 2025
7e1fbcd
gitpr
KommuSoft Aug 29, 2025
c84bc54
gitpr
KommuSoft Aug 29, 2025
7fde93b
fix gitcpr and redirect to new gitcpr
KommuSoft Aug 29, 2025
84adfeb
gitci
KommuSoft Aug 29, 2025
0e55404
fix gitci
KommuSoft Aug 29, 2025
4c91c9f
blackcp
KommuSoft Aug 30, 2025
86f9582
blackcp
KommuSoft Aug 30, 2025
823d704
blackcp
KommuSoft Aug 30, 2025
528c4de
blackcp
KommuSoft Aug 30, 2025
017f03e
blackcp
KommuSoft Aug 30, 2025
0b550f2
blackcp
KommuSoft Aug 30, 2025
c144b48
blackcp
KommuSoft Aug 30, 2025
321f2eb
blackcp
KommuSoft Aug 30, 2025
23448b5
isortcp
KommuSoft Aug 30, 2025
d3ba6d0
gitclonec
KommuSoft Aug 31, 2025
ad27325
make taskflush more robust
KommuSoft Sep 8, 2025
69bb6e5
add_docstrings
KommuSoft Sep 8, 2025
1feddca
add docstrings to add docstrings
KommuSoft Sep 8, 2025
148e53e
pydoc
KommuSoft Sep 8, 2025
8b77455
pydoc
KommuSoft Sep 9, 2025
d19c681
📝 Add docstrings to `feature/doc-update-6`
coderabbitai[bot] Sep 9, 2025
75b01d4
install.sh template
KommuSoft Sep 13, 2025
2a68d15
-y
KommuSoft Sep 13, 2025
5d8c128
include copy of chmod
KommuSoft Sep 13, 2025
1efd3cf
install pyright
KommuSoft Sep 13, 2025
c5a52ef
Merge pull request #12 from hapytex/coderabbitai/docstrings/8b77455
KommuSoft Sep 13, 2025
f33d04b
add shabang
KommuSoft Sep 13, 2025
aacd810
typehintcheck
KommuSoft Sep 13, 2025
ccb916a
exit code for check_typehints
KommuSoft Sep 13, 2025
f90b899
better exit code
KommuSoft Sep 13, 2025
4e864bb
fix out of bounds waitfor
KommuSoft Sep 14, 2025
382e6fc
waitfor with progress bar
KommuSoft Sep 14, 2025
85b24a2
docker group
KommuSoft Sep 20, 2025
e636771
season
KommuSoft Sep 20, 2025
0474076
four polarities
KommuSoft Sep 20, 2025
10f5827
four polarities
KommuSoft Sep 20, 2025
aaeb456
vimgit
KommuSoft Sep 21, 2025
ebd609b
season colors
KommuSoft Sep 21, 2025
cd3f541
mkdir --
KommuSoft Sep 21, 2025
e8f85b5
seasons
KommuSoft Sep 21, 2025
e500314
waitfor pct clock
KommuSoft Sep 29, 2025
e396037
better circle
KommuSoft Sep 29, 2025
162cbb7
calligraphic ℬ𝓁𝒶𝒸𝓀
KommuSoft Oct 5, 2025
fea9cdf
list branches if no argument for gitb
KommuSoft Oct 5, 2025
5c861d2
gitcp do not push if commit fails
KommuSoft Oct 10, 2025
4d1de78
hour colors
KommuSoft Oct 18, 2025
385ac32
hour color
KommuSoft Oct 18, 2025
092da21
more parity
KommuSoft Oct 18, 2025
469bf52
add pre-commit
KommuSoft Oct 18, 2025
4e8b686
black reformatting
KommuSoft Oct 18, 2025
f400314
end pomodoro if ending the script prematurely
KommuSoft Oct 18, 2025
71cb689
end pomodoro if ending the script prematurely
KommuSoft Oct 18, 2025
8397183
fix polarity
KommuSoft Oct 19, 2025
1804786
log biblespeak
KommuSoft Oct 19, 2025
b0dffad
log biblespeak
KommuSoft Oct 19, 2025
cec3fb0
start working on communication tooling
KommuSoft Oct 25, 2025
ee76127
mkdircdgit
KommuSoft Oct 25, 2025
c53e4d1
copy gitignores
KommuSoft Oct 25, 2025
903375d
ignore gitignores
KommuSoft Oct 25, 2025
9e85908
add gitignore to git
KommuSoft Oct 25, 2025
386de31
multilang gitignore
KommuSoft Oct 25, 2025
f075309
note
KommuSoft Oct 28, 2025
6b06c88
noteloop
KommuSoft Oct 28, 2025
2a29266
visual marking for notebooks
KommuSoft Oct 28, 2025
da6c659
more visual hints for notebook
KommuSoft Oct 28, 2025
49bcd99
fix visual clues
KommuSoft Oct 28, 2025
9b35a92
document notes
KommuSoft Oct 28, 2025
73dcf48
rename noteloop to notes
KommuSoft Oct 28, 2025
75fe57d
rename noteloop to notes
KommuSoft Oct 28, 2025
7012d30
empty notes not saved
KommuSoft Oct 28, 2025
cad71ff
better note taking
KommuSoft Oct 29, 2025
19e51a3
airplane
KommuSoft Oct 29, 2025
b8a0c7f
mynote
KommuSoft Oct 30, 2025
c087c80
variables.json
KommuSoft Nov 2, 2025
12ad4e2
change variables.json to allow default values
KommuSoft Nov 2, 2025
a29b992
faster setvar
KommuSoft Nov 2, 2025
b9e6b84
facialmask
KommuSoft Nov 5, 2025
26b9ab6
heal colors
KommuSoft Nov 5, 2025
86b7c2a
damn dockersave
KommuSoft Nov 6, 2025
9ce9b97
visidata
KommuSoft Nov 8, 2025
ecdd0cb
move to sqlite based db for measurements
KommuSoft Nov 9, 2025
4e87d9a
migrate old data
KommuSoft Nov 9, 2025
cb94d5c
undo migrate script
KommuSoft Nov 9, 2025
fc4a5e8
dockerscpload
KommuSoft Nov 9, 2025
c30781f
coffee colors
KommuSoft Nov 11, 2025
c21d80f
keycolor
KommuSoft Nov 11, 2025
bb83b6e
compress stream when docker transferring
KommuSoft Nov 11, 2025
d7bbf11
parameterize language
KommuSoft Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check"
jsonlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: validate JSON
env:
REPORT_ONLY: true
SHOW_ERRORS: true
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/json-lint/master/pipeline.sh)
Comment on lines +16 to +20
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid executing unpinned remote scripts in CI; replace with a local validator or pin to a commit.

curl-ing and executing a remote script from a moving branch (master) is a supply-chain risk and makes builds non-deterministic. Prefer a local validator (no network), or at minimum fetch a specific commit and verify integrity.

Preferred fix: replace the remote script with a Python-based JSON validation that fails the job on invalid JSON.

-      - name: validate JSON
-        env:
-          REPORT_ONLY: true
-          SHOW_ERRORS: true
-        run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/json-lint/master/pipeline.sh)
+      - name: Validate JSON (fail on invalid)
+        run: |
+          set -euo pipefail
+          # Validate all *.json files (tracked and untracked). Fails on first invalid file.
+          found=false
+          while IFS= read -r -d '' f; do
+            found=true
+            python3 -m json.tool "$f" >/dev/null
+          done < <(find . -type f -name "*.json" -print0)
+          # If no JSON files exist, succeed without doing anything.
+          if [ "$found" = false ]; then
+            echo "No JSON files found."
+          fi

Alternative (if you must keep the remote script):

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: validate JSON
env:
REPORT_ONLY: true
SHOW_ERRORS: true
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/json-lint/master/pipeline.sh)
- name: Validate JSON (fail on invalid)
run: |
set -euo pipefail
# Validate all *.json files (tracked and untracked). Fails on first invalid file.
found=false
while IFS= read -r -d '' f; do
found=true
python3 -m json.tool "$f" >/dev/null
done < <(find . -type f -name "*.json" -print0)
# If no JSON files exist, succeed without doing anything.
if [ "$found" = false ]; then
echo "No JSON files found."
fi
🤖 Prompt for AI Agents
.github/workflows/build.yml around lines 16-20: the workflow currently curl|bash
executes an unpinned remote script (supply-chain risk and non-deterministic);
replace it with a local JSON validator that runs without network (or, if you
must keep remote, fetch a pinned commit and verify its SHA). Specifically:
remove the curl... pipeline.sh step and add a step that runs a local validation
command (e.g., iterate repo JSON files and run python -m json.tool on each,
failing the job on any parse error), ensure the validator is committed in the
repo or uses built-in python so no network is required; alternatively, change
the URL to the raw file at a specific commit and add a SHA256 verification
before executing.


8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ A set of functions for the **F**riendly **I**nteractive **Sh**ell (fish). This i
- **`gitb`**: make a new git branch;
- **`gitc`**: make a git commit (short for `git commit -am`);
- **`gitcp`**: commit with the given parameters, and push the changes;
- **`gitcpr`**: commit with the given parameters, push the changes and open a pull request on *GitHub*;
- **`gitd`**: calculate the git difference and work with a pager to read the full response;
- **`gitf`**: alias for `git fetch`;
- **`gith`**: checkout a given branch;
- **`gitm`**: move a given file in a git repository;
- **`gitmaster`**: checkout the master branch (and stash work in progress if any);
- **`gitmastertag`**: checkout the master branch, pull from remote, tag the commit and push the tag to the repository;
- **`gitp`**: pushes the changes to the remote repository (short for `git push`);
- **`gitpr`**: open a pull request on *GitHub*;
- **`gitremote`**: add the remote as origin with the given `GIT_PREFIX` and the name of the directory as git project;
- **`gits`**: prints the status of the current Git repository (short for `git status`);
- **`gitt`**: make a git tag and push the tag;
Expand Down Expand Up @@ -131,6 +133,10 @@ A set of functions for the **F**riendly **I**nteractive **Sh**ell (fish). This i
- **`natrix-env`**: run a Python program in the natrix environment;
- **`numpy`**: start a Python shell with `numpy` imported;

### O

- **`otp`**: generate/configure One Time Passwords (OTPs) with pass-extension-otp;
Comment on lines +148 to +150
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix indentation for new section O.

The otp bullet has 1 space instead of 2, making it inconsistent with all other bullets in the document. Align it with the established format.

 ### O

- - **`otp`**: generate/configure One Time Passwords (OTPs) with pass-extension-otp;
+  - **`otp`**: generate/configure One Time Passwords (OTPs) with pass-extension-otp;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### O
- **`otp`**: generate/configure One Time Passwords (OTPs) with pass-extension-otp;
### O
- **`otp`**: generate/configure One Time Passwords (OTPs) with pass-extension-otp;
Suggested change
### O
- **`otp`**: generate/configure One Time Passwords (OTPs) with pass-extension-otp;
### O
- **`otp`**: generate/configure One Time Passwords (OTPs) with pass-extension-otp;
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

144-144: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

🤖 Prompt for AI Agents
In README.md around lines 142 to 144, the new "O" section's bullet for `otp` is
indented with a single leading space instead of the two spaces used for other
bullets; fix this by changing the indentation to two spaces so the line reads
with the same leading spacing as other list items (aligning the dash and content
to match the established bullet formatting).


### P

- **`pandas`**: start a Python shell with `numpy` and `pandas` imported;
Expand All @@ -151,6 +157,7 @@ A set of functions for the **F**riendly **I**nteractive **Sh**ell (fish). This i

### R

- **`rabbitdoc`**: ask [*CodeRabbit*](https://github.com/coderabbitai) to generate docstrings for the latest pull request;
- **`redo`**: redo a command until the exit code is 0;
- **`remake`**: a loop to remake certain products with a Makefile;
- **`rmake`**: walk up the filetree until it finds a Makefile;
Expand Down Expand Up @@ -185,6 +192,7 @@ A set of functions for the **F**riendly **I**nteractive **Sh**ell (fish). This i
- **`taskd`**: set the task with the given id as done;
- **`taskflush`**: set all expired tasks to done;
- **`teeth`**: help cleaning teeth;
- **`timeprompt`**: wait for a given amount of time, or until the person hits a key exits with 1 if the user interrupted;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify the description of timeprompt.

The current phrasing is awkward: "wait for a given amount of time, or until the person hits a key exits with 1 if the user interrupted." Consider revising for clarity:

-  - **`timeprompt`**: wait for a given amount of time, or until the person hits a key exits with 1 if the user interrupted;
+  - **`timeprompt`**: wait for a given amount of time or until a key is pressed; exits with 1 if the user interrupted;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **`timeprompt`**: wait for a given amount of time, or until the person hits a key exits with 1 if the user interrupted;
- **`timeprompt`**: wait for a given amount of time or until a key is pressed; exits with 1 if the user interrupted;
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

203-203: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)

🤖 Prompt for AI Agents
In README.md around line 203, the `timeprompt` description is awkward and
unclear; replace the current fragment with a single clear sentence such as:
"timeprompt: waits for a specified duration or until the user presses any key;
exits with status 1 if the user interrupts." Ensure punctuation and grammar are
correct and that the behavior (wait duration, key press, exit code on interrupt)
is unambiguous.

- **`timestamp`**: get a string that specifies date and time, used for filenames mainly;
- **`todo`**: add or inspect to a todo list;
- **`truthful`**: check if at least one of the given Python literals or JSON values has truthiness `true`;
Expand Down
7 changes: 5 additions & 2 deletions blooddonation.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ function blooddonation --description 'register a blood donation together with bl
test -n "$bpm" || read -P (string unescape '\e[31mBPM\e[0m> ') bpm
bloodpressure "$systolic" "$diastolic" &
measurelog "blooddonation.$kind" true health.bodilyfunction.bpm "$bpm" &
waitfor 2700 '🩸 donation' '🩸 ' (getcolor blood body_colors ,)
here_is_the_news
if ! waitfor 2700 '' '🩸 donation' '🩸 ' (getcolor blood body_colors ,)
measurelog 'blooddonation.end' true
else
here_is_the_news
end
end
2 changes: 1 addition & 1 deletion eggs.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function eggs --description 'wait until the eggs are fully cooked in the water boiler'
measurelog cooking.eggs.boiled true &
echo -e 'takes \e[1m7%\e[0m of the home battery'
waitfor 1500 '🥚 eggs' '🥚 '
waitfor 1500 '' '🥚 eggs' '🥚 '
here_is_the_news
end
6 changes: 6 additions & 0 deletions gitcpr.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function gitcpr --description 'commit with the given parameters, push the changes and open a pull request on GitHub'
set message (echo "$argv")
git commit -am $argv;
Comment on lines +2 to +3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Commit message handling breaks for multi-word messages. Quote and join argv.

git commit -am $argv passes only the first word to -m and treats the remainder as pathspecs. Build a single message string and quote it.

-  set message (echo "$argv")
-  git commit -am $argv;
+  set -l message (string join " " -- $argv)
+  git commit -am "$message" || return $status

Note: keeping -a preserves prior behavior (stage modified, not new, files). If you want to include new files by default, switch to git add -A && git commit -m "$message".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
set message (echo "$argv")
git commit -am $argv;
set -l message (string join " " -- $argv)
git commit -am "$message" || return $status
🤖 Prompt for AI Agents
In gitcpr.fish around lines 2-3, the commit invocation uses git commit -am $argv
which only passes the first word as the message and treats remaining words as
pathspecs; instead join argv into a single message string and quote it when
passing to git. Set a local message variable by joining $argv (e.g. using string
join " " $argv) and then call git commit -am "$message" so multi-word commit
messages are preserved.

gitp
gitpr $argv
Comment on lines +4 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Gate subsequent steps on success; bubble up failures.

Ensure push succeeds before opening a PR, and forward exit codes to the caller.

-  gitp
-  gitpr $argv
+  gitp || return $status
+  gitpr $argv
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
gitp
gitpr $argv
gitp || return $status
gitpr $argv
🤖 Prompt for AI Agents
In gitcpr.fish around lines 4 to 5, the script currently runs gitp then
unconditionally calls gitpr $argv; change it to gate the PR step on a successful
push by checking the exit status of the gitp command and only invoking gitpr if
gitp succeeded, and if gitp fails propagate its non‑zero exit code to the caller
(e.g. test $status and exit with that status or use an early return) so failures
are bubbled up.

end
4 changes: 4 additions & 0 deletions gitpr.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function gitpr --description 'open a pull request on GitHub'
set title (echo "$argv")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Join argv safely for multi-word titles.

echo "$argv" is brittle in fish; prefer string join and a local var.

-  set title (echo "$argv")
+  set -l title (string join " " -- $argv)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
set title (echo "$argv")
set -l title (string join " " -- $argv)
🤖 Prompt for AI Agents
In gitpr.fish around line 2, the code uses echo "$argv" which is brittle for
joining multi-word arguments; replace it by creating a local variable and using
fish's string join to safely combine argv (e.g., set -l title (string join " "
$argv)) and then use that local title variable wherever needed.

firefox (gh pr create --title "$title" --body "$title" 2>&1 | tail -n 1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid parsing gh output and hard dependency on Firefox; use --web and propagate status.

2>&1 | tail -n 1 | firefox can open an error string as a URL and loses gh exit status. Let gh open the browser and return its status.

-  firefox (gh pr create --title "$title" --body "$title" 2>&1 | tail -n 1)
+  if test -z "$title"
+    gh pr create --fill --web
+  else
+    gh pr create --title "$title" --body "$title" --web
+  end
+  return $status
🤖 Prompt for AI Agents
In gitpr.fish around line 3, the current command pipes gh output into firefox
and captures stderr/stdout which can open error text as a URL and loses gh's
exit status; replace the pipeline with gh pr create --title "$title" --body
"$title" --web (no 2>&1 | tail -n 1 | firefox), and ensure the script exits with
gh's exit code (let gh return its status or capture and propagate it via exit
$status) so errors are preserved and no hard dependency on Firefox is
introduced.

end
2 changes: 1 addition & 1 deletion homebattery.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ function homebattery --description 'determine how long it will take to load the
# 80% -> 100% @150Watts
set s1 (math "max(80, $upto) - max(80, $cur)")
set tot (math "round(73728*$s0/300 + 73728*$s1/150)")
waitfor "$tot" '⚡ battery' '⚡ '
waitfor "$tot" '' '⚡ battery' '⚡ '
end
2 changes: 1 addition & 1 deletion household.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function household --description 'wait until a household device has finished with info' -a time -a emoji -a name -a energy -a water
echo -e "takes \e[1m$energy%\e[0m of the home battery and \e[1m"$water"ℓ\e[0m water"
waitfor $time "$emoji $name" "$emoji "
waitfor $time '' "$emoji $name" "$emoji "
here_is_the_news
end
5 changes: 4 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid deprecated apt-key; use signed-by keyrings for Yarn too.

apt-key is deprecated. Use a keyring and reference it in the source entry, mirroring what you already do for GitHub CLI.

-curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
+curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/yarn-archive-keyring.gpg
@@
-echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
+echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Also applies to: 6-6

🤖 Prompt for AI Agents
install.sh lines 3 and 6: the script uses the deprecated apt-key to add Yarn's
GPG key; replace this with a dedicated keyring file and reference it via
signed-by in the APT source entry. Download the Yarn pubkey into a keyring
(e.g., /usr/share/keyrings/yarn-archive-keyring.gpg) with proper permissions,
remove the apt-key add call, and update the Yarn repository line to include
[signed-by=/usr/share/keyrings/yarn-archive-keyring.gpg] so APT uses the keyring
instead of apt-key.

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list

sudo add-apt-repository ppa:tatokis/alarm-clock-applet

sudo apt-get update
sudo apt-get install -y alarm-clock-applet apt-file agrep certbot cloc curl cvc4 djinn fish git git-filter-repo git-lfs gnuplot-nox haskell-stack hlint hoogle ipython3 jq lambdabot ledger lynx nodeenv nodejs npm pandoc pdfsam powerline pv pylint python-wxtools python3-pytest rename sdate sox supervisor swi-prolog-core tig tox xdotool yarn zbar-tools z3
sudo apt-get install -y alarm-clock-applet apt-file agrep certbot cloc curl cvc4 djinn fish gh git git-filter-repo git-lfs gnuplot-nox haskell-stack hlint hoogle ipython3 jq lambdabot ledger lynx nodeenv nodejs npm pandoc pass-extension-otp pdfsam powerline pv pylint python-wxtools python3-pytest rename sdate sox supervisor swi-prolog-core tig tox xdotool yarn zbar-tools z3
sudo snap install upscayl
git lfs install

Expand Down
2 changes: 1 addition & 1 deletion movie.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function movie --description 'register going to a movie' -a name -a duration
test -n "$name" || read -P (string unescape '\e[31name of the movie\e[0m> ') name
measurelog entertainment.movie "$name"
if test -n "$duration"
waitfor "$duration" '🎥 movie' '🎥 '
waitfor "$duration" '' '🎥 movie' '🎥 '
here_is_the_news
end
end
3 changes: 3 additions & 0 deletions otp.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function otp --wraps='pass otp' --description 'generate/configure One Time Passwords (OTPs) with pass-extension-otp'
pass otp $argv
end
4 changes: 2 additions & 2 deletions pomodoro.fish
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function pomodoro --description 'the pomodoro technique to stay focussed'
set end (date '+%Y-%m-%d %T%z' -d "+40 minutes")
echo "$end" > "$HOME/block_sleep"
measurelog pomodoro.work true &
waitfor 1500 '\e[100D \e[100D\e[31m[working]\e[0m' '▶️ ' (getcolor random focus_colors ,)
waitfor 1500 '' '\e[100D \e[100D\e[31m[working]\e[0m' '▶️ ' (getcolor random focus_colors ,)
kill "$gamma"
if [ "$i" -gt 3 ]
set waitcolor '255,3,32'
Expand All @@ -46,7 +46,7 @@ function pomodoro --description 'the pomodoro technique to stay focussed'
gsettings set org.gnome.desktop.notifications show-banners "$banners"
notify-send -i /usr/share/icons/hicolor/64x64/apps/io.github.alarm-clock-applet.clock.png -c productivity -u low 'pomodoro ⏰' '⏸️ take a break'
measurelog pomodoro.pause true &
waitfor "$pause" "$pausetype" "$pausetitle" "$waitcolor"
waitfor "$pause" '' "$pausetype" "$pausetitle" "$waitcolor"
here_is_the_news &
end
end
Expand Down
3 changes: 3 additions & 0 deletions rabbitdoc.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function rabbitdoc --description 'ask CodeRabbit.ai to generate docstrings for the latest pull request'
firefox (gh pr comment (gh pr list --json number --jq '.[0].number') -b '@coderabbitai generate docstrings')
end
2 changes: 1 addition & 1 deletion smartwatch.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ function smartwatch --description 'determine how long it will take to load the s
test -n "$upto" || set upto 100
measurelog home.smartwatch (jsonlist "$cur" "$upto") &
set tot (math "round(51.724137931*($upto-$cur))")
waitfor "$tot" '⌚ battery' '⌚ '
waitfor "$tot" '' '⌚ battery' '⌚ '
here_is_the_news
end
4 changes: 2 additions & 2 deletions teeth.fish
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function teeth --description 'help cleaning teeth'
for tooth in $teeth
set kin (string sub -l 1 "$move")
draw_teeth "$cc" "$tt" "$kin"
waitfor 3 "$cheek - $move - $tooth" "clean teeth $cheek - $move - $tooth "
waitfor 3 '' "$cheek - $move - $tooth" "clean teeth $cheek - $move - $tooth "
echo -en ' \e[100D\e[8A'
set tt (math $tt+1)
end
Expand All @@ -34,6 +34,6 @@ function teeth --description 'help cleaning teeth'
echo ' '
end
echo -en ' \e[100D\e[8A'
waitfor 5 'brush tongue' 'brush tongue '
waitfor 5 '' 'brush tongue' 'brush tongue '
echo 'do NOT rinse with water '
end
3 changes: 3 additions & 0 deletions timeprompt.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function timeprompt --description 'wait for a given amount of time, or until the person hits a key exits with 1 if the user interrupted' -a time
! bash -c "read -n 1 -t '$time'"
end
Comment on lines +1 to +3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Bug: use Fish’s “not” instead of “!” and fix description grammar

Fish doesn’t support bash-style “!” for negation. Use not to invert the exit status. Also tighten the description grammar.

Apply:

-function timeprompt --description 'wait for a given amount of time, or until the person hits a key exits with 1 if the user interrupted' -a time
-  ! bash -c "read -n 1 -t '$time'"
+function timeprompt --description 'wait for a given amount of time, or until the person presses a key; exits with 1 if the user interrupted' -a time
+  not bash -c "read -n 1 -t $time"
 end

Notes:

  • Bash read returns 0 on keypress and nonzero on timeout; not inverts this to match your documented behavior.
  • Dropped the superfluous single quotes around $time inside the bash -c string.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function timeprompt --description 'wait for a given amount of time, or until the person hits a key exits with 1 if the user interrupted' -a time
! bash -c "read -n 1 -t '$time'"
end
function timeprompt --description 'wait for a given amount of time, or until the person presses a key; exits with 1 if the user interrupted' -a time
not bash -c "read -n 1 -t $time"
end
🤖 Prompt for AI Agents
In timeprompt.fish around lines 1 to 3, the function uses bash-style "!" for
negation and has a grammatically loose description; replace the leading "!" with
Fish's "not" to invert the exit status and tighten the description string (e.g.,
"Wait for a given time or until a key is pressed; exit 1 if interrupted"). Also
remove the unnecessary single quotes around $time inside the bash -c command so
the timeout is passed correctly.

2 changes: 1 addition & 1 deletion vitamins.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function vitamins --description 'take our daily vitamins and magnesium'
waitfor 90 '💊 vitamins' '💊 '
waitfor 90 '' '💊 vitamins' '💊 '
measurelog health.vitamins true
hydrate 33cl
end
27 changes: 20 additions & 7 deletions waitfor.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function waitfor --description 'wait a certain amount of time, or until the user hits ENTER' -a time -a label -a desc -a keydown -a until -a step
function waitfor --description 'wait a certain amount of time, or until the user hits ENTER' -a time -a allow -a label -a desc -a keydown -a until -a step
set es 0
if [ -n "$keydown" ]
keycolor (string split , "$keydown") 255 &
end
Expand All @@ -16,27 +17,39 @@ function waitfor --description 'wait a certain amount of time, or until the user
set oldval 256
set oldn 8
set time (math "round($time)")
for i in (seq "$time" "-$step" "$until")
set txt (timeformat "$i")
set cur (date '+%s')
set tar (math "$cur + $time")
while test "$cur" -lt "$tar"
set cur (date '+%s')
set rmd (math "$tar - $cur")
set txt (timeformat "$rmd")
Comment on lines 25 to 28
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix TOCTOU bug in loop condition and restore until semantics; clamp remaining time to avoid negatives

The loop tests an outdated $cur captured before sleep, which can allow one extra iteration and yield negative $rmd. This leads to invalid ANSI colors and potentially writing negative brightness to sysfs. Also, until is currently unused by the loop.

Refactor to:

  • Evaluate the current time in the while condition.
  • Honor until by computing a stop epoch.
  • Clamp $rmd to be non-negative.

Apply this diff:

 set tar (math "$cur + $time")
-while test "$cur" -lt "$tar"
-  set cur (date '+%s')
-  set rmd (math "$tar - $cur")
+set stop (math "$tar - $until")
+while test (date '+%s') -lt "$stop"
+  set cur (date '+%s')
+  set rmd (math "max(0, $stop - $cur)")
   set txt (timeformat "$rmd")

Optional: To avoid oversleeping near the end, consider sleeping no longer than the remaining time:

sleep (math "min($step, $rmd)")
🤖 Prompt for AI Agents
In waitfor.fish around lines 20 to 24, the loop uses a stale $cur captured
before sleeping which creates a TOCTOU bug (allowing an extra iteration and
negative $rmd) and ignores the `until` semantics; change the loop to evaluate
the current time in the loop condition by computing a stop epoch up front when
`until` is set, loop while the current time is less than that stop epoch (or
target), recompute $cur inside the condition, compute $rmd as the positive
difference and clamp it to zero if negative, and optionally limit sleep to the
remaining time by using sleep with min($step, $rmd).

set n (string length "$txt")
if [ "$n" -lt "$oldn" ]
# erase previous one if length differs
echo -en ' \e[8D'
end
Comment on lines 23 to 26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Erasure logic is brittle; clear to end-of-line instead of printing 8 spaces

Hard-coding 8 spaces will leave artifacts when the new text is shorter by more than 8. Clear EOL.

Apply this diff:

-    if [ "$n" -lt "$oldn" ]
-      # erase previous one if length differs
-      echo -en '        \e[8D'
-    end
+    if [ "$n" -lt "$oldn" ]
+      printf "\e[0K"
+    end
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ "$n" -lt "$oldn" ]
# erase previous one if length differs
echo -en ' \e[8D'
end
if [ "$n" -lt "$oldn" ]
printf "\e[0K"
end
🤖 Prompt for AI Agents
In waitfor.fish around lines 29-32, the code erases previous output by printing
8 spaces and moving left 8, which is brittle; replace that with an ANSI
clear-to-end-of-line sequence. Use a shell-safe print (printf) to emit ESC[K
(clear to end of line) — optionally preceded by '\r' if you need to return to
column zero — instead of the hard-coded 8-space sequence so shorter new text
never leaves artifacts.

set cl (math "min(255, 4*$i)")
set cl (math "min(255, 4*$rmd)")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Negative $rmd will produce invalid color values.

Due to the TOCTOU bug (lines 26-27), $rmd can be negative. When $rmd < 0, this line computes a negative $cl, leading to invalid ANSI color codes at line 40 and potential negative brightness at line 47.

This will be resolved by fixing the TOCTOU bug and clamping $rmd:

set rmd (math "max(0, $stop - $cur)")

Also applies to: 45-45

🤖 Prompt for AI Agents
In waitfor.fish around lines 26-27 and 39 (and also line 45), there is a TOCTOU
issue where $rmd can become negative and lead to invalid color values; fix by
computing the remaining delta defensively (capture consistent timestamps or
compute stop-cur in one step and clamp it with max(0, ...)) and then clamp the
computed color value $cl to the valid 0–255 range (use min/max to ensure
0<=cl<=255); apply the same clamping logic to the other occurrence at line 45.

echo -en "\e[1m\e[38;2;255;$cl;"$cl"m$txt\e[0m\e["$n"D"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Broken ANSI escape due to quoting/arg-splitting; emit with printf as a single arg

The current echo mixes quoted and unquoted tokens, risking spaces that break SGR parameters.

Use printf:

-    echo -en "\e[1m\e[38;2;255;$cl;"$cl"m$txt\e[0m\e["$n"D"
+    printf "\e[1m\e[38;2;255;%d;%dm%s\e[0m\e[%dD" $cl $cl $txt $n
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo -en "\e[1m\e[38;2;255;$cl;"$cl"m$txt\e[0m\e["$n"D"
printf "\e[1m\e[38;2;255;%d;%dm%s\e[0m\e[%dD" $cl $cl $txt $n
🤖 Prompt for AI Agents
In waitfor.fish around line 32, the echo command mixes quoted and unquoted
tokens which can cause word-splitting and break ANSI SGR parameters; replace the
echo invocation with a single-argument printf to avoid splitting and ensure the
entire escape sequence is emitted atomically. Construct the printf format so
escape codes and variables are expanded in one string (use a single format
string and pass variables as needed), ensure any numeric variables are not
subject to word splitting, and use the appropriate escape-sequence
interpretation flag so the SGR sequence, the text, and the final cursor-move
code are printed as one intact argument.

set pct (math "round(100*($time-$i)/$time)")
set pct (math "round(100*($time-$rmd)/$time)")
echo -en "\033]0;$desc$txt\007\033]9;4;1;$pct\033\0134"
if [ -n "$keydown" ]
set newval (math "round(235*$i/$time)+20")
set newval (math "round(235*$rmd/$time)+20")
if [ "$oldval" -ne "$newval" ]
echo "$newval" > /sys/class/leds/rgb:kbd_backlight/brightness &
set oldval $newval
end
end
sleep "$step"
if [ -z "$allow" ]
if ! timeprompt "$step"
set cur "$tar"
set es 1
end
else
sleep "$step"
end
set oldn "$n"
end
# clear progress
echo -en "\033]9;4;0\007"
return "$es"
end
2 changes: 1 addition & 1 deletion walking.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function walking --description 'register a walk'
waitfor 2100 '🚶 walking' '🚶 '
waitfor 2100 '' '🚶 walking' '🚶 '
measurelog activity.walking (activity_survey)
end
2 changes: 1 addition & 1 deletion whatday.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function whatday --description 'specifies the day with some counters'
set dt (date +%s -d '0:00 UTC')
set hr (date +%H%M)
set colors '232;20;22' '255;165;0' '250;235;54' '121;195;20' '72;125;231' '75;54;157' '112;54;157'
set tcol 97 97 30 30 30 97 97
set tcol 97 30 30 30 97 97 97
set planets '☽ ' '♂' '☿' '♃' '♀' '♄' '☉'
set polars '↙' '↗'
set caf '🚫☕'
Expand Down