New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Fish shell support #230
Conversation
- Fish shell does not share the same syntax as bash and zsh so liquidprompt for fish lives in a separate file. - The structure of the script is a bit different from the original - CVS functions are not completed (only git has a working function). - lp_enable and lp_disable are available for the user to enable/disable some features at runtime. These functions have auto-completion.
- Remove the end of line (after the '%' character) before removing the beggining of line from the output of acpi. When (dis)charging, `acpi --battery` would output something like "Battery 0: Discharging, 63%, 02:51:50 remaining" The removal of the beggining of line would stop at the last comma instead of stopping at the first one and would output "02:51:50 remaining" instead of "63%, 02:51:50 remaining" - Set the right values to some global variables.
fish_prompt doesn't run any test anymore and merely prints $LP_PROMPT - _lp_prompt is called on 'fish_prompt' events (fish fires this event whenever a new prompt is about to be displayed). - _lp_directory is called only when $PWD changes value of on 'lp_dir_option_changed' events. * There is now no need to keep an $OLD_PWD variable and compare it with the value of $PWD at each call of fish_prompt * The event 'lp_dir_option_changed' is fired when 'lp_enable' or 'lp_disable' change an option involved in '_lp_directory'. - _lp_checks is called only on 'lp_feature_option_changed' events. The event 'lp_feature_option_changed' is fired when 'lp_enable' and 'lp_disable' change an option involved in '_lp_checks'.
- Eye-candy * Temperature and battery display now follow the same logic as the load display: if LP_PERCENTS_ALWAYS is set, the mark is not colored in order to be unobstrusive, and the value is colored else, only the mark is displayed, and is colored accordingly * All marks are unobstrusive. Either way they are not colored, or they are colored but not bold while the value they tag along is bold. - _lp_jobcount bug The function now correctly detects running and stopped jobs.
I don't intend to merge this. It would be better to keep it as a separate project as I don't want to maintain that code. By the way I have already chosen another way to implement liquidprompt for fish which is to port liquidprompt on top of The Angel's Prompt. But this is not yet ready :( |
There is now a separate project: https://github.com/wesbarnett/fish-lp |
@wesbarnett Have you tried dolmen/angel-PS1? Why did you choose to use the full rewrite of LP in fish? |
I have not tried angel-PS1, but @harenome had already done the real work and I just wanted a simple config file to drop into my home folder. |
@wesbarnett If I may suggest a few things, I humbly believe you should have forked this differently:
Your |
Liquidprompt can now be used with Fish shell.