4c1e7a7eb9
- Core config layered on CachyOS base with Catppuccin Mocha theming - Fisher plugins: fzf.fish, catppuccin, autopair, replay, puffer-fish, magic-enter, spark - Smart CLI wrappers with fallbacks (bat, lsd, btop, dust, prettyping) - Custom functions: git, docker, network, kitty, AI session management - Extensive abbreviation system for keyboard-driven workflows - Secrets/local sourcing pattern for private and machine-specific config - README with full documentation and personalization guide - AGPLv3+ license with copyright headers on all source files
44 lines
1.1 KiB
Fish
44 lines
1.1 KiB
Fish
###
|
|
# wakatime.fish
|
|
#
|
|
# hook script to send wakatime a tick (unofficial)
|
|
# see: https://github.com/ik11235/wakatime.fish
|
|
###
|
|
|
|
function __register_wakatime_fish_before_exec -e fish_postexec
|
|
if set -q FISH_WAKATIME_DISABLED
|
|
return 0
|
|
end
|
|
|
|
set -l exec_command_str
|
|
|
|
set exec_command_str (string split -f1 ' ' "$argv")
|
|
|
|
if test "$exec_command_str" = 'exit'
|
|
return 0
|
|
end
|
|
|
|
set -l PLUGIN_NAME "ik11235/wakatime.fish"
|
|
set -l PLUGIN_VERSION "0.0.6"
|
|
|
|
set -l project
|
|
set -l wakatime_path
|
|
|
|
if type -p wakatime 2>&1 > /dev/null
|
|
set wakatime_path (type -p wakatime)
|
|
else if type -p ~/.wakatime/wakatime-cli 2>&1 > /dev/null
|
|
set wakatime_path (type -p ~/.wakatime/wakatime-cli)
|
|
else
|
|
echo "wakatime command not found. Please read \"https://wakatime.com/terminal\" and install wakatime."
|
|
return 1
|
|
end
|
|
|
|
if git rev-parse --is-inside-work-tree &> /dev/null
|
|
set project (basename (git rev-parse --show-toplevel))
|
|
else
|
|
set project "Terminal"
|
|
end
|
|
|
|
$wakatime_path --write --plugin "$PLUGIN_NAME/$PLUGIN_VERSION" --entity-type app --project "$project" --entity "$exec_command_str" &> /dev/null&; disown
|
|
end
|