stinkpot
--------
_
_ / \ _
(_\/\_/\/_)
/\/ \/\
\/\_/\/
\/_\/
" "
stinkpot is an sqlite backed shell-history searcher for
bash.
stinkpot is a much tinier atuin (https://atuin.sh). i have
been using atuin for a while, but i don't use most of its
features: the sync server, atuin AI, dotfiles manager,
script manager or the KV store. while sync is interesting,
my machines have very different setups and i tend to run
very different commands on them.
my only usecase for atuin was the session agnostic history
management, and the searcher TUI. stinkpot provides these
while being about 400 lines of go.
stinkpot is a tiny turtle species apparently, hence the
name.
develop
-------
to build:
go build -o stinkpot .
usage
-----
if you use home-manager for nixos, stinkpot has a
home-manager module:
home-manager.users.<name> = {
imports = [
./home.nix
inputs.stinkpot.homeManagerModules.default
];
};
if not, just call eval the init script in your .bashrc:
eval "$(stinkpot init)"
or .config/fish/config.fish:
stinkpot init fish | source
start by importing your existing bash history into stinkpot:
stinkpot import
and then hit ctrl+r at your shell to trigger reverse search:
> search history...
1s vim flake.nix
3m redis-server
3m jj l
35m jj show m
36m jj git fetch
39m cd
40m vim readme.txt
788 matches · ↑/↓ move · enter accept · esc cancel
hit tab/enter to accept the selection, hit enter again to
execute. the history database is stored in
~/.local/share/stinkpot. if upgrades break the DB, just
delete it and run the import command.
Configure Feed
Select the types of activity you want to include in your feed.
sqlite-backed shell history
Configure Feed
Select the types of activity you want to include in your feed.
Clone this repository
https://tangled.org/oppi.li/stinkpot https://tangled.org/did:plc:wqstj3k5tslmm246baaf3tpa
git@tangled.org:oppi.li/stinkpot git@tangled.org:did:plc:wqstj3k5tslmm246baaf3tpa
For self-hosted knots, clone URLs may differ based on your setup.
Signed-off-by: oppiliappan <me@oppi.li>
This change makes the bash procedure __stinkpot_record return the exit code of the last user
command. This makes it so that commands following it in PROMPT_COMMAND will also be passed the
correct exit code.
Before this change a .bashrc with the following contents
> function new-prompt {
> user_exit_code="$?"
> echo "The last command exited with status: ${user_exit_code}."
> return $user_exit_code
> }
> PROMPT_COMMAND="new-prompt;"
> eval "$(stinkpot init)"
would produce the unexpected session
> rovanion@T14i ~$ true
> The last command exited with status: 0.
> rovanion@T14i ~$ false
> The last command exited with status: 0.
instead of the expected session
> rovanion@T14i ~$ true
> The last command exited with status: 0.
> rovanion@T14i ~$ false
> The last command exited with status: 1.
which is what now happens with this patch applied.
readme.txt