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

Open
wants to merge 8 commits into
from

Conversation

Projects
None yet
4 participants
@harenome

harenome commented Nov 3, 2013

Liquidprompt can now be used with Fish shell.

harenome added some commits Nov 2, 2013

First version of liquidprompt for 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.
Minor _lp_battery correction, defaults
- 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.
Use fish function -on-event and -on-variable
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'.
Fix eye-candy consistency and _lp_jobcount bug
- 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 referenced this pull request Dec 5, 2013

Closed

Add fish support? #119

@dolmen

This comment has been minimized.

Show comment
Hide comment
@dolmen

dolmen Jan 19, 2014

Collaborator

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

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

@dolmen dolmen added the enhancement label Jun 30, 2014

@dolmen dolmen added the wontfix label Aug 18, 2014

@nojhan

This comment has been minimized.

Show comment
Hide comment
@nojhan

nojhan Dec 12, 2016

Owner

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

Owner

nojhan commented Dec 12, 2016

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

@dolmen

This comment has been minimized.

Show comment
Hide comment
@dolmen

dolmen Dec 13, 2016

Collaborator

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

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

This comment has been minimized.

Show comment
Hide comment
@wesbarnett

wesbarnett Dec 13, 2016

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.

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

This comment has been minimized.

Show comment
Hide comment
@harenome

harenome Dec 19, 2016

@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?

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment