mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-30 04:23:36 +08:00
ea0b464f1d
- Move theme installation to cli entry point (omf.fish) - Generalize XDG_CONFIG_HOME code in `omf.xdg.config_home` - Generalize prompt conflicts check in `omf.checks.fish_prompt` * Migrate `omf.doctor` to use it + Change theme activation steps - Create user function path if not existent - Check for conflicts in fish_prompt, aborts if found - Remove current theme from autoloading paths - Add target theme to autoloading paths - Link target theme's fish_prompt to user's - Persist selected theme to $OMF_CONFIG/theme This approach brings two major advantages: - Theme prompt now shows accordingly in fish_config web interface - Faster theme changes, reducing it from seconds to some milis - Avoids calling refresh, which makes users much more happy
25 lines
802 B
Fish
25 lines
802 B
Fish
function __omf.doctor.theme
|
|
if not omf.check.fish_prompt
|
|
echo (omf::err)"Warning: "(omf::off)(omf::em)"fish_prompt.fish"(omf::off)" is overridden."
|
|
echo (omf::em)" fish_config"(omf::off)" command persists the prompt to "(omf::em)"~/.config/fish/functions/fish_prompt.fish"(omf::off)
|
|
echo " That file takes precedence over Oh My Fish's themes. Remove the file to fix it:"
|
|
|
|
echo (omf::em)" rm ~/.config/fish/functions/fish_prompt.fish"(omf::off)
|
|
echo
|
|
|
|
return 1
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
function omf.doctor
|
|
__omf.doctor.theme; or set -l doctor_failed
|
|
|
|
if set -q doctor_failed
|
|
echo "If everything you use Oh My Fish for is working fine, please don't worry and just ignore the warnings. Thanks!"
|
|
else
|
|
echo (omf::em)"Your shell is ready to swim."(omf::off)
|
|
end
|
|
end
|