Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
49be67f
add start and stop tasks feature
colorchestra Jul 29, 2024
9c9490a
start work on completely removing the "later" feature
colorchestra Jul 29, 2024
4705220
disable motivation, demotivation, headlines for now
colorchestra Jul 29, 2024
fbeb4cd
remove 'later' from completion and setup scripts
colorchestra Jul 29, 2024
64f6ddb
rework procrastinate function to not use later / backlog anymore
colorchestra Jul 29, 2024
2a29805
Merge branch 'v2' into remove-later
colorchestra Jul 29, 2024
83ccd24
remove backlog from procrastinate function
colorchestra Jul 29, 2024
bbbae1f
remove old backlog feature from Readme
colorchestra Jul 29, 2024
4f2ead5
finish removing later feature
colorchestra Jul 29, 2024
2440ef9
read EDITOR variable
colorchestra Jul 31, 2024
2e53541
create cringe mode and make cringe stuff only appear if it's enabled
colorchestra Aug 1, 2024
4d75477
change feierabend() to next_day() and add gumo keyword
colorchestra Aug 1, 2024
9f0d94a
add GuMo feature to readme
colorchestra Aug 1, 2024
1bd433a
no longer add tasks using "done"
colorchestra Aug 12, 2024
26007d7
remove unnecessary linefeed
colorchestra Sep 19, 2024
9715f09
add some more tasks to readme
colorchestra Sep 19, 2024
3031f3c
add helper functions to check if task exists and exit if it doesn't
colorchestra Sep 20, 2024
1e3b1af
fix most shellcheck findings
colorchestra Sep 20, 2024
183ef03
refactoring! use _check_if_task_exists everywhere
colorchestra Sep 20, 2024
33e0b07
remove printing motivation
colorchestra Nov 20, 2024
ff676d6
dynamically find datadir; remove cringe mode
colorchestra Nov 20, 2024
7c998c6
write git.log to datadir
colorchestra Nov 20, 2024
013ec1a
start reworking setup.sh and installation paths
colorchestra Nov 22, 2024
20a764a
rename y.sh to y
colorchestra Jun 10, 2025
e7f5ae6
plonk
colorchestra Jun 10, 2025
af9bf4b
remove BASEDIR, fix some shellchecks, replace ls with find
colorchestra Nov 26, 2025
066d02b
deprioritize tasks without !
colorchestra Nov 27, 2025
e8b93d8
sorta fix prio completion thing
colorchestra Nov 27, 2025
f68f874
add 'done' feature for focus mode
colorchestra Nov 28, 2025
e8e0f0b
move day parsing to function; add 'do' feature to focus mode
colorchestra Nov 28, 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
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,38 @@

![Screenshot](https://i.imgur.com/HjUO133.png)

## You're on the v2 development branch!
Notice: this branch is unstable and likely to change. Here's the v2 roadmap:

- [x] add "focus mode" to keep track of the task you're currently working on
- [x] remove "later" / "backlog" feature that no one used
- [x] remove cringey motivation / demotivation / headline
- [x] maybe: add new motivation?
- [ ] ~~maybe: add time tracking? It's almost for free with the inclusion of the start/stop mechanism~~
- [x] remove instant creation of non-existant tasks with "done"
- [x] read EDITOR variable, default to vi
- [x] add GuMo syntax to Feierabend
- [x] refactor entire codebase, make shellcheck report _nothing_
- [ ] fix remaining shellcheck todos
- [ ] clean up other youth sins
- [ ] add better comments, remove bad comments
- [x] rename y.sh to y
- [ ] move things to proper directories (~/.local/bin, ~/.config/something?)
- [x] fix vanish/rm
- [ ] fix behaviour of deprioritizing (make callable without !)
- [ ] rename branch to main
- [ ] new screenshot
- [ ] fix rm/vanish completion (borken)
- [ ] make installable to any directory, with symlink from ~/.local/bin
- [ ] eliminate the need for BASEDIR
### setup.sh
- [ ] check if .local/bin exists on the path find a way to install if it doesn't (either create and add to PATH, or add ~/y to path)
- [ ] fail if things go wrong, don't write completion.sh to bashrc several times or without BASEDIR
- [ ] prompt for existing data repo, clone it automatically
- [ ] add color
- [ ] auto-create 'tomorrow' after cloning data repo because it's never committed


## Features
+ Ask yourself: "y the hell am I doing this?" with every new task
+ Semi-functional bash completion
Expand All @@ -21,14 +53,11 @@

## Usage
+ `y` -> show all tasks
+ `y do (today|tomorrow|later) Fix printer` -> Create new task, defaults to 'today', or move to today if it exists tomorrow or later
+ `y do (today|tomorrow) Fix printer` -> Create new task, defaults to 'today', or move to today if it exists tomorrow
+ `y done Fix printer` -> mark task as done
+ `y do Fix printer` (if task already exists) -> open task in Vim to add notes (absolutely not compatible with any other editor, nu-uh, sorry) (not sorry)
+ `y procrastinate Fix printer` -> move task to tomorrow
+ `y superprocrastinate Fix printer` -> move task to backlog
+ `y prioritize Fix printer` -> toggle mark task as important

+ `y later` -> take a look at your backlog
+ `y feierabend` -> done for the day

## Setup
Expand Down
54 changes: 47 additions & 7 deletions completion.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/bin/bash
# i have no idea what i'm doing

_y() {
local cur prev opts
COMREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="do done procrastinate proc superprocrastinate prio prioritize vanish rm later feierabend"
opts="do done procrastinate proc prio prioritize vanish rm feierabend start stop"
case "${prev}" in
done|procrastinate|superprocrastinate|proc|prio|prioritize)
done|procrastinate|proc|start)
IFS=$'\n' tmp=( $(compgen -W "$(ls ~/y/data/today)" -- "${COMP_WORDS[$COMP_CWORD]}" ))
COMPREPLY=( "${tmp[@]// /\ }" )
return 0
Expand All @@ -18,8 +15,51 @@ _y() {
COMPREPLY=( "${tmp[@]// /\ }" )
return 0
;;
vanish) # extremely ghetto
opts="today tomorrow later"

prio|prioritize)
# simplified: iterate filenames, strip leading "! " into 's', match prefix, and push appropriate completion
local match_cur="$cur"
local mode=0 # 0=return original, 1=return with leading "! ", 2=return stripped only (prev == '!')
if [[ "${COMP_WORDS[COMP_CWORD-1]}" == '!' ]]; then
mode=2
match_cur="$cur"
elif [[ "$cur" == '!'* ]]; then
# user typed bang in same word: remove leading '!' and optional space
mode=1
match_cur="${cur#\!}"
match_cur="${match_cur# }"
else
mode=0
match_cur="$cur"
fi

# iterate files and match stripped names by prefix
local f s out
while IFS= read -r f; do
[[ -z "$f" ]] && continue
if [[ "$f" == '! '* ]]; then
s="${f#\! }"
else
s="$f"
fi
# prefix match
if [[ "$s" == "$match_cur"* ]]; then
if [[ $mode -eq 1 ]]; then
out="! ${s}"
elif [[ $mode -eq 2 ]]; then
out="${s}"
else
out="${f}"
fi
COMPREPLY+=( "$out" )
fi
done < <(ls -1 ~/y/data/today 2>/dev/null)

return 0
;;

vanish|rm) # extremely ghetto
opts="today tomorrow"
case "${prev}" in
today)
IFS=$'\n' tmp=( $(compgen -W "$(ls ~/y/data/today)" -- "${COMP_WORDS[$COMP_CWORD]}" ))
Expand Down
67 changes: 67 additions & 0 deletions setup-legacy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash

BASEDIR=~/y
DATADIR=$BASEDIR/data/

printf "Creating nocolor symlink... "
if [ ! -h "$BASEDIR/y-nocolor.sh" ]; then
ln -s y.sh y-nocolor.sh
printf "Successful.\n"
else
printf "Symlink already exists!\n"
fi

echo "Removing old stuff from .bashrc... "
sed -i '/alias y=/d' ~/.bashrc
sed -i '/y\/completion.sh/d' ~/.bashrc
# todo: feedback

printf "Writing new aliases to .bashrc... "
if echo "alias y='$BASEDIR/y.sh'" >> ~/.bashrc; then
printf "Successful.\n"
else
printf "Error!\n"
fi

printf "Writing completion stuff to .bashrc... "
if echo "source $BASEDIR/completion.sh" >> ~/.bashrc; then
printf "Successful.\n"
else
printf "Error!\n"
fi

read -rp "Do you have an existing y data directory, e.g. in a Git repo? (yes/no) " yn
case $yn in
[Yy]* ) echo "Please manually copy/clone your data directory now." # to do: automatically clone if repo link is inserted
;;

* ) echo "A local Git repository will be initialized. If you want, set a remote."

printf "Creating data directory... "
if [ ! -d "$DATADIR" ]; then
mkdir "$DATADIR"
printf "Successful.\n" # naja...
else
printf "Directory already exists!\n"
fi

cd "$DATADIR" || exit 1

printf "Creating daily directories...\n"
for d in 'today' 'tomorrow' 'done' 'archive' 'started'; do
if ! [[ -d "$d" ]]; then
mkdir "$d"
printf " Directory '$d' created.\n"
else
printf " Directory '$d' already exists!\n"

fi
done
git init
cd "$BASEDIR" || exit 1
;;
esac

echo "Please run 'source ~/.bashrc' to enable bash completion (or start a new shell, or log out and back in)"
echo "Done."
exit
37 changes: 14 additions & 23 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
#!/bin/bash

BASEDIR=~/y
DATADIR=$BASEDIR/data/
DATADIR="$HOME/.local/share/y"

printf "Copying binary to ~/.local/bin... "
# TODO check if already present etc
cp ./y "$HOME/.local/bin/y"
printf "Successful.\n"

printf "Creating nocolor symlink... "
if [ ! -h "$BASEDIR/y-nocolor.sh" ]; then
ln -s y.sh y-nocolor.sh
if [ ! -h "$HOME/.local/bin/y-nocolor" ]; then
ln -s "$HOME/.local/bin/y" "$HOME/.local/bin/y-nocolor"
printf "Successful.\n"
else
printf "Symlink already exists!\n"
fi

echo "Removing old stuff from .bashrc... "
sed -i '/alias y=/d' ~/.bashrc
sed -i '/y\/completion.sh/d' ~/.bashrc
# todo: feedback

printf "Writing new aliases to .bashrc... "
echo "alias y='$BASEDIR/y.sh'" >> ~/.bashrc
if [ $? -eq 0 ]; then
printf "Successful.\n"
else
printf "Error!\n"
fi

# TODO: can this go somewhere else?
printf "Writing completion stuff to .bashrc... "
echo "source $BASEDIR/completion.sh" >> ~/.bashrc
if [ $? -eq 0 ]; then
if echo "source $BASEDIR/completion.sh" >> ~/.bashrc; then
printf "Successful.\n"
else
printf "Error!\n"
fi

read -p "Do you have an existing y data directory, e.g. in a Git repo? (yes/no) " yn
read -rp "Do you have an existing y data directory, e.g. in a Git repo? (yes/no) " yn
case $yn in
[Yy]* ) echo "Please manually copy/clone your data directory now." # to do: automatically clone if repo link is inserted
;;
Expand All @@ -47,10 +38,10 @@ case $yn in
printf "Directory already exists!\n"
fi

cd "$DATADIR"
cd "$DATADIR" || exit 1

printf "Creating daily directories...\n"
for d in today tomorrow later done archive; do
for d in 'today' 'tomorrow' 'done' 'archive' 'started'; do
if ! [[ -d "$d" ]]; then
mkdir "$d"
printf " Directory '$d' created.\n"
Expand All @@ -60,7 +51,7 @@ case $yn in
fi
done
git init
cd "$BASEDIR"
cd "$BASEDIR" || exit 1
;;
esac

Expand Down
Loading