Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Conversation

harenome
Copy link

@harenome harenome commented Nov 3, 2013

Liquidprompt can now be used with Fish shell.

- 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.
@dolmen dolmen mentioned this pull request Dec 5, 2013
@dolmen
Copy link
Collaborator

dolmen commented Jan 19, 2014

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 :(

@nojhan
Copy link
Collaborator

nojhan commented Dec 12, 2016

There is now a separate project: https://github.com/wesbarnett/fish-lp

@dolmen
Copy link
Collaborator

dolmen commented Dec 13, 2016

@wesbarnett Have you tried dolmen/angel-PS1? Why did you choose to use the full rewrite of LP in fish?

@wesbarnett
Copy link

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.

@harenome
Copy link
Author

@wesbarnett If I may suggest a few things, I humbly believe you should have forked this differently:

  1. Fork the original liquidprompt project so that the projects are related. However this relation would be limited to the GitHub ecosystem...
  2. Either:
    1. Create an empty branch and an initial commit...
      $ git checkout --orphan <newbranch>
      $ git reset --hard
      $ git commit --allow-empty -m "initial commit"
      
    2. ...or create a branch from the initial commit.
      $ git checkout $(git rev-list HEAD | tail -n 1)
      $ git checkout -b <newbranch>
      
  3. Cherry-pick the commits from this pull request.
  4. Cherry-pick your new commits.
  5. Delete other branches and push this new branch as your master branch on GitHub.

Your README.md would perhaps be a bit more appealing with a screenshot. Also, what about the license?

@nojhan nojhan closed this Aug 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request wontfix A bug report that is rejected because the fix should be external
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants