Fixed vim and zsh
This commit is contained in:
4
zsh/modules/prompt/external-themes/liquidprompt/.github/ISSUE_TEMPLATE.md
vendored
Normal file
4
zsh/modules/prompt/external-themes/liquidprompt/.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
Shell: bash/zsh
|
||||
Operating system:
|
||||
Liquid Prompt version (tag, commit):
|
||||
|
33
zsh/modules/prompt/external-themes/liquidprompt/.mailmap
Normal file
33
zsh/modules/prompt/external-themes/liquidprompt/.mailmap
Normal file
@ -0,0 +1,33 @@
|
||||
nojhan <nojhan@nojhan.net> <johann.dreo@thalesgroup.com>
|
||||
nojhan <nojhan@nojhan.net> <nojhan@gmail.com>
|
||||
Alexander Belaev (alexbel) <alexbel@lavabit.com>
|
||||
Alex Prengere <alexprengere@gmail.com> <alex.prengere@amadeus.com>
|
||||
Alex Prengere <alexprengere@gmail.com> Alex <alexprengere@gmail.com>
|
||||
Aurélien Requiem <aurelien@requiem.fr> <aurelien.requiem@loadedtech.com.au>
|
||||
Aurélien Requiem <aurelien@requiem.fr>
|
||||
Clément Mathieu <clement@unportant.info>
|
||||
Christophe Drevet (dr4Ke) <dr4ke@dr4ke.net> <christophe.drevet@cea.fr>
|
||||
François Schmidts (jaesivsm) <francois.schmidts@gmail.com>
|
||||
François Schmidts (jaesivsm) <francois.schmidts@gmail.com> <fschmidts@olfeo.com>
|
||||
François Schmidts (jaesivsm) <francois.schmidts@gmail.com> <jaesivsm>
|
||||
Frédéric Lepied <flepied@gmail.com>
|
||||
Étienne Deparis <etienne@depar.is>
|
||||
Étienne Deparis <etienne@depar.is> <etienne.deparis@umaneti.net>
|
||||
Felix Chern (dryman) <idryman@gmail.com>
|
||||
Jean-Sébastien Leroy <jean.sebastien.leroy@gmail.com>
|
||||
Joris Dedieu <joris@nfrance.com>
|
||||
Joris Dedieu <joris@nfrance.com> <joris@pontiac3.nfrance.com>
|
||||
Julien Pecqueur <jpec@julienpecqueur.net>
|
||||
Julien Pecqueur <jpec@julienpecqueur.net> <jpec80@gmail.com>
|
||||
Ludovic Rousseau <ludovic.rousseau@gmail.com> <lroussea@370bh2j.(none)>
|
||||
Matthew Micene (nzwulfin) <nzwulfin@gmail.com>
|
||||
Nicolas Lacourte <nicolas@dotinfra.fr>
|
||||
Olivier Dupuis <oj.dupuis@gmail.com>
|
||||
Ying Li (cyli) <cyli@twistedmatrix.com>
|
||||
Poil <poil@quake.fr> M.Poil <?@?>
|
||||
Poil <poil@quake.fr> Poil <?@?>
|
||||
Thomas Debesse <thomas.debesse@gmail.com>
|
||||
Rolf Morel (polyphemus) <rolfmorel@gmail.com>
|
||||
Wilson Maravilha (algaerhythm) <algaerhythm@gmail.com>
|
||||
Yannack <yannack@gmail.com>
|
||||
Brad Beyenhof <bbeyenhof@gmail.com> <bbeyenhof@icloud.com>
|
208
zsh/modules/prompt/external-themes/liquidprompt/CHANGES
Normal file
208
zsh/modules/prompt/external-themes/liquidprompt/CHANGES
Normal file
@ -0,0 +1,208 @@
|
||||
|
||||
NEXT
|
||||
New features:
|
||||
- Workaround broken .bashrc that export PROMPT_COMMAND (GH #450, #463):
|
||||
we now unexport it on startup
|
||||
- Allow to customize the symbol before the path that shows if the
|
||||
directory is writable: LP_MARK_PERM (GitHub #430, #484)
|
||||
Bug fixes:
|
||||
- Fix regression in LP_ENABLE_FQDN implementation (GitHub #472)
|
||||
- Fix LP_COLOR_HOST_HASH on SunOS (GitHub #461, #462)
|
||||
- Fix LP_MARK_DEFAULT being ignored if root (GitHub #501)
|
||||
- Git:
|
||||
* Faster "git stash" check (GitHub #503)
|
||||
Thanks to Roman (@hatifnatt), Jon Garrison (@jpwgarrison),
|
||||
Mark Vander Stel (@Rycieos), Bryce Jasmer (b-jazz), Felix
|
||||
Schlitter (@felixSchl), Philip Garrison (@pgarrison), Lubomir
|
||||
Host (@lhost), Iain Hallam (@iainhallam), Matt
|
||||
Smith (@ncs-msmith)...
|
||||
... for their patches or bug reports.
|
||||
|
||||
1.11 2016-06-25
|
||||
Bug fixes:
|
||||
- OS X: sudo feature fixed
|
||||
- OS X: battery level restored
|
||||
|
||||
1.10 2016-05-30
|
||||
Breaking changes:
|
||||
- In themes, LP_COLORMAP_x variables are replaced by a single
|
||||
LP_COLORMAP array variable. A warning will be displayed at startup
|
||||
if your config still uses the old variables, but a compatibility
|
||||
shim is active (will be removed in next release).
|
||||
- Many LP_ENABLE_* settings are now static (their effect applies when
|
||||
liquidprompt is loaded, and changing them at the prompt does nothing)
|
||||
to more and more improve speed.
|
||||
- zsh: option 'nopromptsubst' is enabled for security reasons.
|
||||
This will unfortunately also affect evaluations of other prompt
|
||||
contexts such as RPS1.
|
||||
- Variables LP_SCREEN_TITLE_OPEN and LP_SCREEN_TITLE_CLOSE are now
|
||||
removed to simplify the code (GitHub #371)
|
||||
New features:
|
||||
- Sudo:
|
||||
* The color of the prompt mark is now dynamic and changes to
|
||||
LP_COLOR_MARK_SUDO (default: bold red) as long as your sudo
|
||||
credentials are cached (GitHub #335).
|
||||
Requires sudo 1.7.0+.
|
||||
This feature must be enabled with LP_ENABLE_SUDO=1
|
||||
Use 'sudo -K' to revoke your credentials early.
|
||||
* This feature is disabled by default as there is no way to
|
||||
detect if the user has sudo rights without triggering a security
|
||||
alert that will annoy the sysadmin.
|
||||
- Git:
|
||||
* Show the number of commits behind the remote (GitHub #269)
|
||||
* Show the rebasing/merging/cherry-picking state (GitHub #409)
|
||||
- Add variable LP_TTYN: the basename of the terminal (GitHub #357)
|
||||
- Add setting LP_ENABLE_FQDN to show the fully qualified domain name
|
||||
of the host (GitHub #254, #277)
|
||||
- LP_HOSTNAME_ALWAYS=-1 to always hide the hostname (GitHub #406)
|
||||
- Run duration of the last command (LP_ENABLE_RUNTIME) is now also
|
||||
supported on zsh (GitHub #404, #355)
|
||||
- Python: add support for Conda (CONDA_DEFAULT_ENV) (GitHub #425)
|
||||
Bug fixes:
|
||||
- Use $XDG_CONFIG_HOME to locate the config (GitHub #415, #420, #425)
|
||||
- Improved zsh integration (but most issues had no impact of the
|
||||
user experience)
|
||||
- Fix escaping of special chars from $PWD (well, almost, see GitHub
|
||||
#389) and explicitely set the shell options we need (instead of
|
||||
relying on the shell default settings)
|
||||
- Git:
|
||||
* Fix typo in git work directory detection
|
||||
- Fossil:
|
||||
* Fix on darwin (GitHub #390)
|
||||
- LP_DISABLED_VCS_PATH is fixed on zsh (GitHub #423)
|
||||
- Battery indicator:
|
||||
* MacOS: many fixes to handle (all?) edge cases (GitHub #326)
|
||||
We now have a pmset simulator to better detect regressions.
|
||||
- Temperature indicator:
|
||||
* The code using the 'sensors' command now uses the '-u' option
|
||||
("raw output") that is easier to parse. This format is at least
|
||||
7 years old. (GitHub #379, #380)
|
||||
* We now try each backend (acpi/sensors) once to check it works
|
||||
at startup and disable the feature if none works.
|
||||
(GitHub #410, #319, #381, #387)
|
||||
- CPU load indicator:
|
||||
* Fix the scale that was incorrectly 0-200 (GitHub #391)
|
||||
- Title:
|
||||
* Fix terminal sequences that were sent in the title text (the
|
||||
escaping algorithm is rewritten and now just correct).
|
||||
- Terminal channel:
|
||||
* Fix detection of tmux (GitHub #304, #377)
|
||||
* Fix detection of local session on OS X (GitHub #407)
|
||||
- Misc:
|
||||
* Fix bash 3 compatibility (GitHub #313)
|
||||
* Clear GREP_OPTIONS and skip 'grep' aliases (GitHub #372)
|
||||
- Shortened path:
|
||||
* Fix bugs when $PWD contains spaces or special chars (GitHub #369)
|
||||
* Optimize implementation in case of LP_PATH_KEEP=-1 : LP_PWD
|
||||
becomes static (related to GitHub #256, #336)
|
||||
* Optimize implementation in case LP_ENABLE_SHORTEN_PATH=0
|
||||
* Optimize implementation in case LP_ENABLE_SHORTEN_PATH=0 on bash
|
||||
with PROMPT_DIRTRIM
|
||||
- Sample configuration files:
|
||||
* example.bashrc: major fixes
|
||||
- The last statement of liquidprompt did not return 0 (GitHub #360,#361)
|
||||
- Analog clock:
|
||||
* complete rewrite for speed and correctness (GitHub #365 and other
|
||||
issues)
|
||||
- Documentation:
|
||||
* Many small fixes
|
||||
- Move dist/ to contrib/dist/ as files there are unmaintained
|
||||
- Fix title escapes in zsh inside tmux/screen (GitHub #370, #371)
|
||||
|
||||
Thanks to Matt Fletcher (@MaffooBristol), Kevin Yap (@iKevinY), Sean
|
||||
Hussey (@seanhussey), François Schmidts (@jaesivsm), Morgan Knicely
|
||||
(@morganizeit), Daniel Serodio (@dserodio), Jonathan Giddy
|
||||
(@jongiddy), Jeremy Clement (@jeremyclement), Panayiotis Kkolos
|
||||
(@pkkolos), Arturo Borrero Gonzalez (@aborrero), Samuel Krieg
|
||||
(@SamK), Brian May (@brianmay), Colin Lieberman (@colinlieberman),
|
||||
@hegedus, Anthony Gelibert (@anthonygelibert), Anthony Ramine (@nox),
|
||||
Erik M Jacobs (@thoraxe), Pedro Parracho (@berserck), Brad Beyenhof
|
||||
(@augmentedfourth), Austen Adler (@stonewareslord), Hagen Graf
|
||||
(@hcgraf), William P. Riley-Land (@wprl), Dave Rigby (@daverigby),
|
||||
Ned Batchelder (@nedbat), Fabien Marty (@thefab), Alessio Garzi
|
||||
(@Ozzyboshi), Roger Huang (@rhuang2014), Sebastian Bremicker
|
||||
(@sebrem), Alex Prengere (@alexprengere), Philipp Grogg (@gro-gg),
|
||||
Tener Hades (@tenerhades), Thomas Kühnel (@kuehnelth), Étienne Deparis
|
||||
(@milouse), @Hotschke, Software Mechanic (@softwaremechanic), Simon
|
||||
McVittie (@smcv)...
|
||||
... for their patches or bug reports.
|
||||
|
||||
1.9 2014-11-12 dolmen (Olivier Mengué)
|
||||
Bug fixes:
|
||||
- Battery indicator:
|
||||
* General fixes (GitHub #264)
|
||||
* MacOS: fix for computers without battery (like iMacs) (GitHub
|
||||
#319)
|
||||
* Optimize colormap
|
||||
- Temperature indicator:
|
||||
* Linux: Add a guard against any future l10n of the 'acpi' command
|
||||
* Linux: Fix for negative temperature values (GitHub #308)
|
||||
- CPU load:
|
||||
* Darwin/BSD: quoting fixes
|
||||
- Hostname:
|
||||
* Fix colorization for SSH
|
||||
* Simplify chroot detection
|
||||
- VCS:
|
||||
- Git:
|
||||
* Use --porcelain for "git status" (GitHub #270)
|
||||
* Minir optimization (GitHub #266)
|
||||
- Fossil:
|
||||
* Cleanup and fixes (GitHub #274 and others)
|
||||
- Subversion:
|
||||
* Fix branch/tag name extraction (GitHub #117, #237, #293)
|
||||
- Bazar:
|
||||
* Fix branch name extraction
|
||||
* zsh fixes (GitHub #303)
|
||||
- Mercurial:
|
||||
* General cleanup for speed and fixes
|
||||
* Disabled "hg outgoing" because it is slow (GitHub #217)
|
||||
- Shortened path:
|
||||
* Bash: Fix quoting for PROMPT_DIRTRIM
|
||||
- Prompt mark:
|
||||
* Simplify implementation of LP_MARK_DEFAULT
|
||||
- Jobs:
|
||||
* Refactoring
|
||||
* Fix when screen/tmux are not installed (GitHub #304)
|
||||
- Analog clock:
|
||||
* Fix hour for 12AM and 12PM (GitHub #273)
|
||||
- Misc:
|
||||
* bash: save and set 'promptvars'
|
||||
* bash: workaround broken pattern substitution in bash 4.2 (GitHub
|
||||
#289, #294, #302)
|
||||
* zsh: fix restoration of the original (pre-liquidprompt) prompt
|
||||
* Fix tmux detection (GitHub #279)
|
||||
* Save IFS (GitHub #267)
|
||||
* Fix $TERM check (GitHub #291)
|
||||
* Various quoting fixes
|
||||
* Apply some shellcheck.com suggestions
|
||||
* Many, many optimizations (GitHub #267)
|
||||
New features:
|
||||
- Add vcsh support (GitHub #148, #287)
|
||||
- Add support for Software Collections (GitHub #299, #300)
|
||||
|
||||
Thanks to Anthony Gelibert, Frédéric Mahé, Panayiotis Kkolos, Étienne
|
||||
Deparis, François Schmidts, Linus Wallgren, Alexander Belaev, Bartosz
|
||||
Janda, Brett McBride, Chase Colman, Cosmin L. Neagu, Matthew Micene,
|
||||
Vincent Lara, Wilson Maravilha and Yannack for their patches. Thanks
|
||||
to all the other contributors who reported issues or proposed patches
|
||||
that have not been applied.
|
||||
|
||||
1.8 2014-01-15 dolmen (Olivier Mengué)
|
||||
|
||||
1.7 2013-11-30 nojhan
|
||||
|
||||
1.6 2013-05-14 nojhan
|
||||
|
||||
1.5 2013-04-20 nojhan
|
||||
|
||||
1.4 2013-04-11 nojhan
|
||||
|
||||
1.3 2013-03-11 nojhan
|
||||
|
||||
1.2 2013-01-16 nojhan
|
||||
|
||||
1.1 2012-08-16 nojhan
|
||||
|
||||
1.0 2012-08-10 nojhan
|
||||
|
||||
0.0 2011-02-05 nojhan
|
101
zsh/modules/prompt/external-themes/liquidprompt/CONTRIBUTING.md
Normal file
101
zsh/modules/prompt/external-themes/liquidprompt/CONTRIBUTING.md
Normal file
@ -0,0 +1,101 @@
|
||||
Contributing to Liquid Prompt
|
||||
=============================
|
||||
|
||||
Contributing a patch
|
||||
--------------------
|
||||
|
||||
The public stable branch for end users is `master`.
|
||||
|
||||
|
||||
How to do the right thing?
|
||||
--------------------------
|
||||
|
||||
$ git clone -o upstream git://github.com/nojhan/liquidprompt.git
|
||||
$ cd liquidprompt
|
||||
|
||||
# Run liquidprompt and check that your issue is still on that branch
|
||||
$ source liquidprompt
|
||||
|
||||
# Prepare a fix (include the issue number in the branch name if an issue
|
||||
# already exists)
|
||||
$ git checkout -b fix/my-fix
|
||||
# Prepare a new feature
|
||||
$ git checkout -b feature/my-feature
|
||||
|
||||
# Hack, commit, hack, commit...
|
||||
|
||||
# Fork the project on GitHub (if you haven't yet)
|
||||
|
||||
# Add the remote target for pushes
|
||||
$ git remote add github git@github.com:$GITHUB_USER/liquidprompt.git
|
||||
|
||||
# Check that your local repo is up to date
|
||||
$ git fetch
|
||||
# Rebase your work on the latest state of `master`
|
||||
$ git rebase upstream/master
|
||||
|
||||
# Push your commits
|
||||
$ git push github fix/my-fix
|
||||
$ git push github feature/my-feature
|
||||
|
||||
# Create the pull request on GitHub. Check that Github chose the `master`
|
||||
# branch as the starting point for your branch.
|
||||
|
||||
|
||||
How to make a good pull request?
|
||||
--------------------------------
|
||||
|
||||
1. Check that your Git authorship settings are correct:
|
||||
|
||||
$ git config -l | grep ^user\.
|
||||
|
||||
2. All the commits in the pull request must be on the same topic. If instead
|
||||
you propose fixes on different topics, use separate branches in your repo
|
||||
and make a pull request for each.
|
||||
3. Good commit messages:
|
||||
- first line must be 72 chars max and is a summary of the commit
|
||||
- second line must be empty
|
||||
- following lines (72 chars max) are optional and take this space freely
|
||||
to express what that changes does.
|
||||
Use references to GitHub issues number (ex: `#432`) if applicable
|
||||
4. Use a good title for your pull request.
|
||||
5. Put details, web links, in the pull request body. Use Markdown fully to
|
||||
format the content (see
|
||||
[Markdown syntax](http://daringfireball.net/projects/markdown/syntax)).
|
||||
For example use triple backquotes for code blocks.
|
||||
|
||||
|
||||
Never, ever, merge the branches `master` of the main repo into one
|
||||
of your own branches. Instead, always rebase your own work on top the `master`
|
||||
branch.
|
||||
|
||||
How my patch will be applied?
|
||||
-----------------------------
|
||||
|
||||
Before being applied, your pull request will be reviewed, by the maintainer
|
||||
and also by other users. You can also help the project by reviewing others
|
||||
pull requests.
|
||||
|
||||
If your patch is accepted it will be applied either:
|
||||
- by "merging" your branch
|
||||
- by cherry-picking your commit on top of the `master` branch. This makes the
|
||||
history linear, and so easier to track.
|
||||
|
||||
In any case, your authorship will be preserved in the commit.
|
||||
|
||||
What if my patch is not applied?
|
||||
--------------------------------
|
||||
|
||||
If you don't even get a review, add a "ping" comment with increasing delay
|
||||
between pings: 1 week, 2 weeks, then every month.
|
||||
|
||||
If a stable version is released while your pull request has still not been
|
||||
merged on any working branch of the main repo, it would be helpful to ease
|
||||
the maitainer's work by rebasing your branch on top of the latest `master`
|
||||
and push it again to your GitHub repo. Be careful (for example create a
|
||||
branch or a tag before your rebase) because your may lose all your work in
|
||||
that process.
|
||||
|
||||
|
||||
Olivier Mengué, maintainer.
|
||||
http://github.com/dolmen
|
661
zsh/modules/prompt/external-themes/liquidprompt/LICENSE
Normal file
661
zsh/modules/prompt/external-themes/liquidprompt/LICENSE
Normal file
@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
368
zsh/modules/prompt/external-themes/liquidprompt/README.md
Normal file
368
zsh/modules/prompt/external-themes/liquidprompt/README.md
Normal file
@ -0,0 +1,368 @@
|
||||
Liquid Prompt — a useful adaptive prompt for Bash & zsh
|
||||
=======================================================
|
||||
|
||||
Liquid Prompt gives you a nicely displayed prompt with useful information
|
||||
when you need it. It shows you what you need when you need it.
|
||||
You will notice what changes *when* it changes, saving time and frustration.
|
||||
You can even use it with your favorite shell – Bash or zsh.
|
||||
|
||||

|
||||
|
||||
|
||||
## Features
|
||||
|
||||
If there is nothing special about the current context, the appearance of Liquid
|
||||
Prompt is similar to that of a default prompt:
|
||||
|
||||
`[user:~] $ `
|
||||
|
||||
If you are running a background command and are also in the "myb" branch
|
||||
of a Git repository on a server:
|
||||
|
||||
`1r [user@server:~/liquidprompt] myb ± `
|
||||
|
||||
When Liquid Prompt is displaying everything (a rare event!), it may look like this:
|
||||
|
||||
`code 🕤 ⌁24% ⌂42% 3d/2&/1z [user@server:~/ … /code/liquidprompt][pyenv]↥ master(+10/-5,3)*+ 125 ± `
|
||||
|
||||
Here is an overview of what Liquid Prompt is capable of displaying:
|
||||
|
||||
* a tag associated to the current shell session (you can easily add any
|
||||
prefix tag to your prompt by invoking `prompt_tag MYTAG`)
|
||||
* the current time, displayed as either numeric values or as an analog clock
|
||||
* the current battery status:
|
||||
* a green `⏚` if charging, above the given threshold, but not charged
|
||||
* a yellow `⏚` if charging and under the given threshold
|
||||
* a yellow `⌁` if discharging but above the given threshold
|
||||
* a red `⌁` if discharging and under the given threshold
|
||||
* the remaining battery power if it is under the given threshold, displayed with
|
||||
an increasingly red color map as remaining power decreases
|
||||
* the average of the processors load if it is over a given limit, displayed with
|
||||
an intensity color map as load increases
|
||||
* the average temperature of the available system sensors (generally CPU and MB)
|
||||
* the number of detached sessions (`screen` or `tmux`)
|
||||
* the number of attached sleeping jobs (when you interrupt a command with Ctrl-Z
|
||||
and bring it back with `fg`)
|
||||
* the number of attached running jobs (commands started with a `&`)
|
||||
* a pair of square brackets, in blue if your current shell is running in a
|
||||
terminal multiplexer (`screen` or `tmux`)
|
||||
* the current user, in bold yellow if it is root and in light white if it is not
|
||||
the same as the login user
|
||||
* a green `@` if the connection has X11 support; a yellow one if not
|
||||
* the current host – in bold red if you are connected via a `telnet` connection
|
||||
and blue (or other unique colors) if connected via SSH
|
||||
* a green colon if the user has write permissions in the current directory and
|
||||
a red one if not
|
||||
* the current directory in bold, shortened if it takes too much space while always
|
||||
preserving the first two directory names
|
||||
* the current Python virtual environment
|
||||
* an up arrow if an HTTP proxy is in use
|
||||
* the name of the current branch if you are in a version control repository
|
||||
(Git, Mercurial, Subversion, Bazaar, or Fossil):
|
||||
* in green if everything is up-to-date
|
||||
* in red if there are changes
|
||||
* in yellow if there are pending commits to push
|
||||
* the number of added/deleted lines if changes have been made and the
|
||||
number of pending commits
|
||||
* a yellow `+` if there are stashed modifications
|
||||
* a red `*` if there are untracked files in the repository
|
||||
* the runtime of the last command, if it has exceeded a certain threshold
|
||||
* the error code of the last command, if it has failed in some way
|
||||
* a smart mark at the end of the prompt:
|
||||
* `±` for Git,
|
||||
* `☿` for Mercurial,
|
||||
* `‡` for Subversion,
|
||||
* `‡±` for Git-Subversion,
|
||||
* `⌘` for Fossil,
|
||||
* `$` or `%` for a simple user, in red if you have `sudo` rights,
|
||||
* a red `#` for the root user.
|
||||
* if desired, the prompt will be replicated in your terminal window's
|
||||
title (without the colors)
|
||||
|
||||
You can temporarily deactivate Liquid Prompt and revert to your previous prompt
|
||||
by typing `prompt_off`. Use `prompt_on` to bring it back. You can disable
|
||||
*all* prompts and simply use a single mark sign (`$ ` for user and `# ` for root)
|
||||
by using the `prompt_OFF` command.
|
||||
|
||||
|
||||
## Test Drive and Installation
|
||||
|
||||
Installation is simple. The basic dependencies are standard Unix utilities/commands.
|
||||
If you experience some problems during the installation, please check that they
|
||||
are met; see the [dependencies](#dependencies) section for what you need specifically.
|
||||
|
||||
Follow these steps:
|
||||
|
||||
cd
|
||||
git clone https://github.com/nojhan/liquidprompt.git
|
||||
source liquidprompt/liquidprompt
|
||||
|
||||
To use it every time you start a shell, add the following lines to your
|
||||
`.bashrc` (if you use Bash) or `.zshrc` (if you use zsh):
|
||||
|
||||
# Only load Liquid Prompt in interactive shells, not from a script or from scp
|
||||
[[ $- = *i* ]] && source ~/liquidprompt/liquidprompt
|
||||
|
||||
Next up is the configuration; you can skip this step if you like the defaults:
|
||||
|
||||
cp ~/liquidprompt/liquidpromptrc-dist ~/.config/liquidpromptrc
|
||||
|
||||
You can also copy the file to `~/.liquidpromptrc`.
|
||||
Use your favorite text editor to change the defaults.
|
||||
The `liquidpromptrc` file is richly commented and easy to set your own defaults.
|
||||
You can even theme Liquid Prompt and use a custom PS1 prompt. This is explained
|
||||
in the sections below.
|
||||
|
||||
Check in your `.bashrc` that the `PROMPT_COMMAND` variable is not set, or else
|
||||
the prompt will not be available.
|
||||
|
||||
### Installation via Antigen
|
||||
|
||||
To install via antigen, simply add the following line in your `.zshrc` after activating antigen:
|
||||
|
||||
antigen bundle nojhan/liquidprompt
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
Apart from obvious ones, some features depend on specific commands. If you do
|
||||
not install them, the corresponding feature will not be available, but no error
|
||||
will be displayed.
|
||||
|
||||
* Battery status requires `acpi` on GNU/Linux.
|
||||
* Temperature status requires `acpi` or `lm-sensors` on GNU/Linux.
|
||||
* Detached session status looks for `screen` and/or `tmux`.
|
||||
* VCS support features require `git`, `hg`, `svn`, `bzr` or `fossil`, but you
|
||||
probably already knew that.
|
||||
|
||||
For other features, the script uses commands that should be available on a large
|
||||
variety of Unix systems: `tput`, `grep`, `awk`, `sed`, `ps`, `who`, and `expr`.
|
||||
|
||||
|
||||
## Feature Configuration
|
||||
|
||||
You can configure some variables in the `~/.config/liquidpromptrc` file:
|
||||
|
||||
* `LP_BATTERY_THRESHOLD`, the maximal value under which the battery level is displayed
|
||||
* `LP_LOAD_THRESHOLD`, the minimal value after which the load average is displayed
|
||||
* `LP_TEMP_THRESHOLD`, the minimal value after which the average temperature is displayed
|
||||
* `LP_RUNTIME_THRESHOLD`, the minimal value after which the runtime is displayed
|
||||
* `LP_PATH_LENGTH`, the maximum percentage of the screen width used to display the path
|
||||
* `LP_PATH_KEEP`, how many directories to keep at the beginning of a shortened path
|
||||
* `LP_HOSTNAME_ALWAYS`, a choice between always displaying the hostname or
|
||||
showing it only when connected via a remote shell
|
||||
* `LP_USER_ALWAYS`, a choice between always displaying the user or showing
|
||||
it only when he is different from the one that logged in
|
||||
|
||||
You can also force some features to be disabled, to save some time in the
|
||||
prompt-building process:
|
||||
|
||||
* `LP_ENABLE_PERM`, if you want to detect if the directory is writeable
|
||||
* `LP_ENABLE_SHORTEN_PATH`, if you want to shorten the path display
|
||||
* `LP_ENABLE_PROXY`, if you want to detect if a proxy is used
|
||||
* `LP_ENABLE_JOBS`, if you want to have jobs information
|
||||
* `LP_ENABLE_LOAD`, if you want to have load information
|
||||
* `LP_ENABLE_BATT`, if you want to have battery information
|
||||
* `LP_ENABLE_GIT`, if you want to have Git information
|
||||
* `LP_ENABLE_SVN`, if you want to have Subversion information
|
||||
* `LP_ENABLE_HG`, if you want to have Mercurial information
|
||||
* `LP_ENABLE_BZR`, if you want to have Bazaar information
|
||||
* `LP_ENABLE_FOSSIL`, if you want to have Fossil information
|
||||
* `LP_ENABLE_VCS_ROOT`, if you want to show VCS informations with root account
|
||||
* `LP_ENABLE_TITLE`, if you want to use the prompt as your terminal window's title
|
||||
* `LP_ENABLE_SCREEN_TITLE`, if you want to use the prompt as your screen window's title
|
||||
* `LP_ENABLE_SSH_COLORS`, if you want different colors for hosts you SSH into
|
||||
* `LP_ENABLE_RUNTIME`, if you want to display the runtime of the last command
|
||||
* `LP_ENABLE_SUDO`, if you want the prompt mark to change color while you have password-less root access
|
||||
* `LP_ENABLE_FQDN`, if you want the display of the fully qualified domain name
|
||||
* `LP_ENABLE_TIME`, if you want to display the time at which the prompt was shown
|
||||
* `LP_TIME_ANALOG`, if you want to show the time using an analog clock instead of numeric values
|
||||
|
||||
Note that if required commands are not installed, enabling the corresponding
|
||||
feature will have no effect. Also, all the `LP_ENABLE_…` variables override the
|
||||
templates; i.e. if you use `$LP_BATT` in your template and you set `LP_ENABLE_BATT=0`
|
||||
in your configuration file, your prompt will not have any battery information.
|
||||
|
||||
If you are using Bash and want to use the `PROMPT_DIRTRIM` built-in
|
||||
functionality to shorten but still want to have Liquid Prompt calculating the
|
||||
number of directories to keep in the path, precise a value for `PROMPT_DIRTRIM`
|
||||
before sourcing Liquid Prompt and it will override this value with one fitting
|
||||
the width of your terminal.
|
||||
|
||||
You may face performances decrease when using VCS located in remote directories.
|
||||
To avoid this, you can set the `LP_DISABLED_VCS_PATH` variable to a list of
|
||||
absolute colon-separated paths where VCS-related features should be disabled.
|
||||
|
||||
|
||||
## Customizing the Prompt
|
||||
|
||||
### Adding a Prefix/Postfix
|
||||
|
||||
You can prefix the `LP_PS1` variable with anything you want using
|
||||
`LP_PS1_PREFIX`. The following example activate a custom window's title:
|
||||
|
||||
LP_PS1_PREFIX="\[\e]0;\u@\h: \w\a\]"
|
||||
|
||||
To postfix the prompt, use the `LP_PS1_POSTFIX` variable. For example, to add a
|
||||
newline and a single character:
|
||||
|
||||
LP_PS1_POSTFIX="\n>"
|
||||
|
||||
Note: the `prompt_tag` function is a convenient way to add a prefix. You can use
|
||||
it to add a keyword to each of your different terminals:
|
||||
|
||||
[:~/code/liquidprompt] develop ± prompt_tag mycode
|
||||
mycode [:~/code/liquidprompt] develop ±
|
||||
|
||||
|
||||
### Rearranging the Prompt
|
||||
|
||||
You can sort what you want to see by sourcing your favorite template file
|
||||
(`*.ps1`) in the configuration file.
|
||||
|
||||
You can start from the `liquid.ps1` file, which show the default settings.
|
||||
To use your own configuration, just set `LP_PS1_FILE` to your own file path in
|
||||
your `~/.liquidpromptrc` and you're done.
|
||||
|
||||
Those scripts basically export the `LP_PS1` variable, by appending features and
|
||||
theme colors.
|
||||
|
||||
Available features:
|
||||
* `LP_BATT` battery
|
||||
* `LP_LOAD` load
|
||||
* `LP_TEMP` temperature
|
||||
* `LP_JOBS` detached `screen` or `tmux` sessions/running jobs/suspended jobs
|
||||
* `LP_USER` user
|
||||
* `LP_HOST` hostname
|
||||
* `LP_PERM` a colon (`:`)
|
||||
* `LP_PWD` current working directory
|
||||
* `LP_PROXY` HTTP proxy
|
||||
* `LP_VCS` informations concerning the current working repository
|
||||
* `LP_ERR` last error code
|
||||
* `LP_MARK` prompt mark
|
||||
* `LP_TITLE` the prompt as a window's title escaped sequences
|
||||
* LP_TTYN the terminal basename
|
||||
* `LP_BRACKET_OPEN` and `LP_BRACKET_CLOSE`, brackets enclosing the user+path part
|
||||
|
||||
For example, if you just want to have a prompt displaying the user and the
|
||||
host, with a normal full path in blue and Git support only:
|
||||
|
||||
export LP_PS1=`echo -ne "[\${LP_USER}\${LP_HOST}:\${BLUE}\$(pwd)\${NO_COL}] \${LP_GIT} \\\$ "`
|
||||
|
||||
Note that you need to properly escape dollar signs in a string that will be
|
||||
interpreted by Bash at each prompt.
|
||||
|
||||
To erase your new formatting, just bind `LP_PS1` to a null string:
|
||||
|
||||
export LP_PS1=""
|
||||
|
||||
|
||||
## Themes
|
||||
|
||||
You can change the colors and special characters of some parts of Liquid Prompt
|
||||
by sourcing your favorite theme file (`*.theme`) in the configuration file. See
|
||||
[`liquid.theme`](liquid.theme) for an example of the default Liquid Prompt theme.
|
||||
|
||||
### Colors
|
||||
|
||||
The available colours available for use are:
|
||||
|
||||
`BOLD`, `BLACK`, `BOLD_GRAY`, `WHITE`, `BOLD_WHITE`, `GREEN`, `BOLD_GREEN`,
|
||||
`YELLOW`, `BOLD_YELLOW`, `BLUE`, `BOLD_BLUE`, `PINK`, `CYAN`, `BOLD_CYAN,`,
|
||||
`RED`, `BOLD_RED`, `WARN_RED`, `CRIT_RED`, `DANGER_RED`, and `NO_COL`.
|
||||
|
||||
Set the variable to a null string (`""`) if you do not want color.
|
||||
|
||||
* Current working directory
|
||||
* `LP_COLOR_PATH` as normal user
|
||||
* `LP_COLOR_PATH_ROOT` as root
|
||||
* Color of the proxy mark
|
||||
* `LP_COLOR_PROXY`
|
||||
* Jobs count
|
||||
* `LP_COLOR_JOB_D` Detached (`screen` / `tmux` sessions without attached clients)
|
||||
* `LP_COLOR_JOB_R` Running (`xterm &`)
|
||||
* `LP_COLOR_JOB_Z` Sleeping (Ctrl-Z)
|
||||
* `LP_COLOR_IN_MULTIPLEXER` currently running in a terminal multiplexer
|
||||
* Last error code
|
||||
* `LP_COLOR_ERR`
|
||||
* Prompt mark
|
||||
* `LP_COLOR_MARK` as user
|
||||
* `LP_COLOR_MARK_ROOT` as root
|
||||
* `LP_COLOR_MARK_SUDO` when you did `sudo` and your credentials are still cached (use `sudo -K` to revoke them)
|
||||
* `LP_MARK_PREFIX="\n"` put the prompt on the second line
|
||||
* Current user
|
||||
* `LP_COLOR_USER_LOGGED` user who logged in
|
||||
* `LP_COLOR_USER_ALT` user but not the one who logged in
|
||||
* `LP_COLOR_USER_ROOT` root
|
||||
* Hostname
|
||||
* `LP_COLOR_HOST` local host
|
||||
* `LP_COLOR_SSH` connected via SSH
|
||||
* `LP_COLOR_TELNET` connected via `telnet`
|
||||
* `LP_COLOR_X11_ON` connected with X11 support
|
||||
* `LP_COLOR_X11_OFF` connected without X11 support
|
||||
* Separation mark (by default, the colon before the path)
|
||||
* `LP_COLOR_WRITE` have write permission
|
||||
* `LP_COLOR_NOWRITE` do not have write permission
|
||||
* VCS
|
||||
* `LP_COLOR_UP` repository is up-to-date / a push has been made
|
||||
* `LP_COLOR_COMMITS` some commits have not been pushed
|
||||
* `LP_COLOR_CHANGES` there are some changes to commit
|
||||
* `LP_COLOR_DIFF` number of lines or files impacted by current changes
|
||||
* Battery
|
||||
* `LP_COLOR_CHARGING_ABOVE` charging and above threshold
|
||||
* `LP_COLOR_CHARGING_UNDER` charging but under threshold
|
||||
* `LP_COLOR_DISCHARGING_ABOVE` discharging but above threshold
|
||||
* `LP_COLOR_DISCHARGING_UNDER` discharging and under threshold
|
||||
|
||||
|
||||
### Special Characters
|
||||
|
||||
* `LP_MARK_DEFAULT` (default: "") the mark you want at the end of your prompt
|
||||
(leave empty to use your shell's default mark)
|
||||
* `LP_MARK_BATTERY` (default: "⌁") in front of the battery charge
|
||||
* `LP_MARK_ADAPTER` (default: "⏚") displayed when plugged-in
|
||||
* `LP_MARK_LOAD` (default: "⌂") in front of the load
|
||||
* `LP_MARK_PROXY` (default: "↥") indicate a proxy in use
|
||||
* `LP_MARK_HG` (default: "☿") prompt mark in Mercurial repositories
|
||||
* `LP_MARK_SVN` (default: "‡") prompt mark in Subversion repositories
|
||||
* `LP_MARK_GIT` (default: "±") prompt mark in Git repositories
|
||||
* `LP_MARK_FOSSIL` (default: "⌘") prompt mark in Fossil repositories
|
||||
* `LP_MARK_BZR` (default: "⚯") prompt mark in Bazaar repositories
|
||||
* `LP_MARK_DISABLED` (default: "⌀") prompt mark in disabled repositories
|
||||
(see `LP_DISABLED_VCS_PATH`)
|
||||
* `LP_MARK_UNTRACKED` (default: "\*") if Git has untracked files
|
||||
* `LP_MARK_STASH` (default: "+") if Git has stashed modifications
|
||||
* `LP_MARK_BRACKET_OPEN` (default: "[") marks around the main part of the prompt
|
||||
* `LP_MARK_BRACKET_CLOSE` (default: "]") marks around the main part of the prompt
|
||||
* `LP_MARK_PERM` (default: ":") colored green red or green to indicate write
|
||||
permissions of the current directory
|
||||
* `LP_TITLE_OPEN` (default: "\e]0;") escape character opening a window's title
|
||||
* `LP_TITLE_CLOSE` (default: "\a") escape character closing a window's title
|
||||
|
||||
|
||||
## Known Limitations and Bugs
|
||||
|
||||
Liquid Prompt is distributed under the [GNU Affero General Public License
|
||||
version 3](LICENSE).
|
||||
|
||||
* Does not display the number of commits to be pushed in Mercurial repositories.
|
||||
* Browsing very large Subversion repositories may dramatically slow down
|
||||
the display of Liquid Prompt (use `LP_DISABLED_VCS_PATH` to avoid that).
|
||||
* Subversion repositories cannot display commits to be pushed because
|
||||
that's not how Subversion works
|
||||
* The proxy detection only uses the `$http_proxy` environment variable.
|
||||
* The window's title escape sequence may not work properly on some terminals
|
||||
(like `xterm-256`).
|
||||
* The analog clock requires a Unicode-aware terminal and at least a
|
||||
sufficiently complete font on your system. The [Symbola](http://users.teilar.gr/~g1951d/)
|
||||
font, designed by Georges Douros, is known to work well. On Debian or Ubuntu
|
||||
install try the `fonts-symbola` or `ttf-ancient-fonts` package.
|
||||
|
||||
|
||||
## Authors
|
||||
|
||||
Current Maintainer: [](https://coderwall.com/dolmen)
|
||||
|
||||
Original Author: [](https://coderwall.com/nojhan)
|
||||
|
||||
And many contributors!
|
@ -0,0 +1,12 @@
|
||||
|
||||
liquidprompt/contrib Policy
|
||||
---------------------------
|
||||
|
||||
This directory contains files that have been contributed by contributors
|
||||
but that the core liquidprompt maintainers don't take care.
|
||||
So they are probably outdated, maybe of poor quality (because the maintainers
|
||||
do not have the knowledge to properly review them).
|
||||
|
||||
So use them at your own risks, and don't fill issues about them, just send
|
||||
patches.
|
||||
|
40
zsh/modules/prompt/external-themes/liquidprompt/contrib/dist/archlinux-aur/PKGBUILD
vendored
Normal file
40
zsh/modules/prompt/external-themes/liquidprompt/contrib/dist/archlinux-aur/PKGBUILD
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
# Maintainer: Julien Pecqueur (JPEC) <jpec[at]julienpecqueur[dot]net>
|
||||
pkgname=liquidprompt-git
|
||||
pkgver=20130314
|
||||
pkgrel=3
|
||||
pkgdesc="An intelligent and non intrusive prompt for bash and zsh"
|
||||
url="https://github.com/nojhan/liquidprompt"
|
||||
arch=('any')
|
||||
license=('AGPLv3')
|
||||
optdepends=('screen' 'acpi')
|
||||
makedepends=('git')
|
||||
md5sums=('SKIP')
|
||||
install=liquidprompt.install
|
||||
_gitroot="git://github.com/nojhan/liquidprompt.git"
|
||||
_gitname="liquidprompt"
|
||||
|
||||
build() {
|
||||
cd ${srcdir}/
|
||||
msg "Connecting to the GIT server...."
|
||||
if [[ -d ${srcdir}/${_gitname} ]] ; then
|
||||
cd ${_gitname}
|
||||
git reset --hard
|
||||
git pull origin
|
||||
msg "The local files are updated..."
|
||||
else
|
||||
msg "Cloning git repo..."
|
||||
git clone ${_gitroot}
|
||||
cd ${_gitname}
|
||||
fi
|
||||
git reset --hard
|
||||
msg "GIT checkout done."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${_gitname}"
|
||||
# install files
|
||||
install -Dm755 liquidprompt "$pkgdir/usr/bin/liquidprompt"
|
||||
install -Dm644 liquidpromptrc-dist "$pkgdir/etc/liquidpromptrc"
|
||||
}
|
||||
|
||||
# vim:set ts=2 sw=2 et:
|
@ -0,0 +1,4 @@
|
||||
post_install() {
|
||||
echo "Use 'source liquidprompt' to enable the prompt."
|
||||
}
|
||||
|
18
zsh/modules/prompt/external-themes/liquidprompt/contrib/dist/debian/create_deb.sh
vendored
Executable file
18
zsh/modules/prompt/external-themes/liquidprompt/contrib/dist/debian/create_deb.sh
vendored
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Creating Debian's package..."
|
||||
nano ./liquidprompt/DEBIAN/control
|
||||
|
||||
echo "Copying files..."
|
||||
cp ../../liquidprompt ./liquidprompt/usr/bin/liquidprompt
|
||||
cp ../../liquidpromptrc-dist ./liquidprompt/etc/liquidpromptrc
|
||||
chmod a+x ./liquidprompt/usr/bin/liquidprompt
|
||||
|
||||
echo "Building liquidprompt.deb..."
|
||||
dpkg-deb -b liquidprompt
|
||||
|
||||
echo "Deleting files..."
|
||||
rm -f ./liquidprompt/etc/*
|
||||
rm -f ./liquidprompt/usr/bin/*
|
||||
|
||||
echo "Done !"
|
11
zsh/modules/prompt/external-themes/liquidprompt/contrib/dist/debian/liquidprompt/DEBIAN/control
vendored
Normal file
11
zsh/modules/prompt/external-themes/liquidprompt/contrib/dist/debian/liquidprompt/DEBIAN/control
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
Package: liquidprompt
|
||||
Version: 1.3-0
|
||||
Section: base
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Depends: bash
|
||||
Recommends: acpi
|
||||
Suggests: git, screen, tmux
|
||||
Maintainer: Julien Pecqueur <jpec@julienpecqueur.net>
|
||||
Description: A slick adaptative prompt for Bash and Zsh.
|
||||
Homepage: http://github.com/nojhan/liquidprompt
|
BIN
zsh/modules/prompt/external-themes/liquidprompt/demo.png
Normal file
BIN
zsh/modules/prompt/external-themes/liquidprompt/demo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 129 KiB |
@ -0,0 +1,25 @@
|
||||
|
||||
# If you want to use Liquid Prompt without bothering about its configuration,
|
||||
# just run the following command:
|
||||
# cp example.bashrc ~/.bashrc
|
||||
|
||||
# The following is a minimalistic Bash config file
|
||||
|
||||
# Use the system config if it exists
|
||||
if [ -f /etc/bashrc ]; then
|
||||
. /etc/bashrc # --> Read /etc/bashrc, if present.
|
||||
elif [ -f /etc/bash.bashrc ]; then
|
||||
. /etc/bash.bashrc # --> Read /etc/bash.bashrc, if present.
|
||||
fi
|
||||
|
||||
# The following lines are only for interactive shells
|
||||
[[ $- = *i* ]] || return
|
||||
|
||||
# Use Bash completion, if installed
|
||||
if [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
|
||||
# Use Liquid Prompt
|
||||
source ~/liquidprompt/liquidprompt
|
||||
|
53
zsh/modules/prompt/external-themes/liquidprompt/liquid.ps1
Normal file
53
zsh/modules/prompt/external-themes/liquidprompt/liquid.ps1
Normal file
@ -0,0 +1,53 @@
|
||||
|
||||
#######################################
|
||||
# LIQUID PROMPT DEFAULT TEMPLATE FILE #
|
||||
#######################################
|
||||
|
||||
# Available features:
|
||||
# LP_BATT battery
|
||||
# LP_LOAD load
|
||||
# LP_JOBS screen sessions/running jobs/suspended jobs
|
||||
# LP_USER user
|
||||
# LP_HOST hostname
|
||||
# LP_PERM a colon ":"
|
||||
# LP_PWD current working directory
|
||||
# LP_VENV Python virtual environment
|
||||
# LP_PROXY HTTP proxy
|
||||
# LP_VCS the content of the current repository
|
||||
# LP_ERR last error code
|
||||
# LP_MARK prompt mark
|
||||
# LP_TIME current time
|
||||
# LP_TTYN number of current terminal (useful in title for quick switching)
|
||||
# LP_RUNTIME runtime of last command
|
||||
# LP_MARK_PREFIX user-defined prompt mark prefix (helpful if you want 2-line prompts)
|
||||
# LP_PS1_PREFIX user-defined general-purpose prefix (default set a generic prompt as the window title)
|
||||
# LP_PS1_POSTFIX user-defined general-purpose postfix
|
||||
# LP_BRACKET_OPEN open bracket
|
||||
# LP_BRACKET_CLOSE close bracket
|
||||
|
||||
# Remember that most features come with their corresponding colors,
|
||||
# see the README.
|
||||
|
||||
# add time, jobs, load and battery
|
||||
LP_PS1="${LP_PS1_PREFIX}${LP_TIME}${LP_BATT}${LP_LOAD}${LP_JOBS}"
|
||||
# add user, host and permissions colon
|
||||
LP_PS1="${LP_PS1}${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_PERM}"
|
||||
|
||||
LP_PS1="${LP_PS1}${LP_PWD}${LP_BRACKET_CLOSE}${LP_VENV}${LP_PROXY}"
|
||||
|
||||
# Add VCS infos
|
||||
# If root, the info has not been collected unless LP_ENABLE_VCS_ROOT
|
||||
# is set.
|
||||
LP_PS1="${LP_PS1}${LP_VCS}"
|
||||
|
||||
# add return code and prompt mark
|
||||
LP_PS1="${LP_PS1}${LP_RUNTIME}${LP_ERR}${LP_MARK_PREFIX}${LP_MARK}${LP_PS1_POSTFIX}"
|
||||
|
||||
# "invisible" parts
|
||||
# Get the current prompt on the fly and make it a title
|
||||
LP_TITLE="$(_lp_title "$LP_PS1")"
|
||||
|
||||
# Insert it in the prompt
|
||||
LP_PS1="${LP_TITLE}${LP_PS1}"
|
||||
|
||||
# vim: set et sts=4 sw=4 tw=120 ft=sh:
|
137
zsh/modules/prompt/external-themes/liquidprompt/liquid.theme
Normal file
137
zsh/modules/prompt/external-themes/liquidprompt/liquid.theme
Normal file
@ -0,0 +1,137 @@
|
||||
|
||||
####################################
|
||||
# LIQUID PROMPT DEFAULT THEME FILE #
|
||||
####################################
|
||||
|
||||
# Special characters
|
||||
# Be sure to use characters that exists in the font you use. You can use several
|
||||
# characters at once.
|
||||
# Below is an example of how to fallback to ASCII if the term is not Unicode-capable.
|
||||
# Defaults to UTF-8 characters.
|
||||
if [[ "$(locale -k LC_CTYPE | sed -n 's/^charmap="\(.*\)"/\1/p')" == *"UTF-8"* ]]; then
|
||||
# If charset is UTF-8.
|
||||
LP_MARK_BATTERY="⌁" # in front of the battery charge
|
||||
LP_MARK_ADAPTER="⏚" # displayed when plugged
|
||||
LP_MARK_LOAD="⌂" # in front of the load
|
||||
LP_MARK_TEMP="θ" # in front of the temp
|
||||
LP_MARK_PROXY="↥" # indicate a proxy in use
|
||||
LP_MARK_HG="☿" # prompt mark in hg repositories
|
||||
LP_MARK_SVN="‡" # prompt mark in svn repositories
|
||||
LP_MARK_GIT="±" # prompt mark in git repositories
|
||||
LP_MARK_FOSSIL="⌘" # prompt mark in fossil repositories
|
||||
LP_MARK_DISABLED="⌀" # prompt mark in directory with disabled VCS info
|
||||
LP_MARK_UNTRACKED="*" # if git has untracked files
|
||||
LP_MARK_STASH="+" # if git has stashs
|
||||
LP_MARK_SHORTEN_PATH=" … " # prompt mark in shortened paths
|
||||
LP_MARK_PERM=":" # separator between host and path
|
||||
else
|
||||
# If charset is anything else, fallback to ASCII chars
|
||||
LP_MARK_BATTERY="b"
|
||||
LP_MARK_ADAPTER="p"
|
||||
LP_MARK_LOAD="c"
|
||||
LP_MARK_TEMP="T"
|
||||
LP_MARK_PROXY="^"
|
||||
LP_MARK_HG="m"
|
||||
LP_MARK_SVN="="
|
||||
LP_MARK_GIT="+"
|
||||
LP_MARK_FOSSIL="f"
|
||||
LP_MARK_DISABLED="!"
|
||||
LP_MARK_UNTRACKED="*"
|
||||
LP_MARK_STASH="+"
|
||||
LP_MARK_SHORTEN_PATH=" ... "
|
||||
LP_MARK_PERM=":"
|
||||
fi
|
||||
|
||||
LP_MARK_BRACKET_OPEN="[" # open bracket
|
||||
LP_MARK_BRACKET_CLOSE="]" # close bracket
|
||||
#LP_MARK_DEFAULT="" # default prompt mark
|
||||
LP_MARK_PREFIX=" " # prompt mark prefix
|
||||
LP_PS1_PREFIX=""
|
||||
LP_PS1_POSTFIX=""
|
||||
|
||||
# Colors
|
||||
# Available colors are:
|
||||
# BOLD, BLACK, BOLD_GRAY, WHITE, BOLD_WHITE,
|
||||
# RED, BOLD_RED, WARN_RED, CRIT_RED, DANGER_RED,
|
||||
# GREEN, BOLD_GREEN, YELLOW, BOLD_YELLOW, BLUE,
|
||||
# BOLD_BLUE, PURPLE, PINK, CYAN, BOLD_CYAN
|
||||
# Set to a null string "" if you do not want color.
|
||||
|
||||
# Current working directory
|
||||
LP_COLOR_PATH="$BOLD" # as normal user
|
||||
LP_COLOR_PATH_ROOT="$BOLD_YELLOW" # as root
|
||||
|
||||
# Color of the proxy mark
|
||||
LP_COLOR_PROXY="$BOLD_BLUE"
|
||||
|
||||
# Jobs count
|
||||
LP_COLOR_JOB_D="$YELLOW" # Detached (aka screen sessions)
|
||||
LP_COLOR_JOB_R="$BOLD_YELLOW" # Running (xterm &)
|
||||
LP_COLOR_JOB_Z="$BOLD_YELLOW" # Sleeping (Ctrl-Z)
|
||||
|
||||
# Last error code
|
||||
LP_COLOR_ERR="$PURPLE"
|
||||
|
||||
# Prompt mark
|
||||
LP_COLOR_MARK="$BOLD" # as user
|
||||
LP_COLOR_MARK_ROOT="$BOLD_RED" # as root
|
||||
LP_COLOR_MARK_SUDO="$BOLD_RED" # when sudo credentials are cached
|
||||
|
||||
# Current user
|
||||
LP_COLOR_USER_LOGGED="" # user who logged in
|
||||
LP_COLOR_USER_ALT="$BOLD" # user but not the one who logged in
|
||||
LP_COLOR_USER_ROOT="$BOLD_YELLOW" # root
|
||||
|
||||
# Hostname
|
||||
LP_COLOR_HOST="" # local host
|
||||
LP_COLOR_SSH="$BLUE" # connected via SSH
|
||||
LP_COLOR_SU="$BOLD_YELLOW" # connected remotely but in new environment through su/sudo
|
||||
LP_COLOR_TELNET="$WARN_RED" # connected via telnet
|
||||
LP_COLOR_X11_ON="$GREEN" # connected with X11 support
|
||||
LP_COLOR_X11_OFF="$YELLOW" # connected without X11 support
|
||||
|
||||
# Separation mark (aka permission in the working dir)
|
||||
LP_COLOR_WRITE="$GREEN" # have write permission
|
||||
LP_COLOR_NOWRITE="$RED" # do not have write permission
|
||||
|
||||
# VCS
|
||||
LP_COLOR_UP="$GREEN" # repository is up to date / a push have been made
|
||||
LP_COLOR_COMMITS="$YELLOW" # some commits have not been pushed
|
||||
LP_COLOR_COMMITS_BEHIND="$BOLD_RED" # some commits have not been pushed
|
||||
LP_COLOR_CHANGES="$RED" # there is some changes to commit
|
||||
LP_COLOR_DIFF="$PURPLE" # number of lines impacted by current changes
|
||||
|
||||
# Battery
|
||||
LP_COLOR_CHARGING_ABOVE="$GREEN" # charging and above threshold
|
||||
LP_COLOR_CHARGING_UNDER="$YELLOW" # charging but under threshold
|
||||
LP_COLOR_DISCHARGING_ABOVE="$YELLOW" # discharging but above threshold
|
||||
LP_COLOR_DISCHARGING_UNDER="$RED" # discharging and under threshold
|
||||
|
||||
# Time
|
||||
LP_COLOR_TIME="$BLUE"
|
||||
|
||||
# Brackets inside screen/tmux
|
||||
LP_COLOR_IN_MULTIPLEXER="$BOLD_BLUE"
|
||||
|
||||
# Virtual environment
|
||||
LP_COLOR_VIRTUALENV="$CYAN"
|
||||
|
||||
# Runtime
|
||||
LP_COLOR_RUNTIME="$YELLOW"
|
||||
|
||||
# Color map (for battery and load levels, and temperature)
|
||||
# Range from 0 (nothing special) to 9 (alert)
|
||||
LP_COLORMAP=(
|
||||
""
|
||||
"$GREEN"
|
||||
"$BOLD_GREEN"
|
||||
"$YELLOW"
|
||||
"$BOLD_YELLOW"
|
||||
"$RED"
|
||||
"$BOLD_RED"
|
||||
"$WARN_RED"
|
||||
"$CRIT_RED"
|
||||
"$DANGER_RED"
|
||||
)
|
||||
|
||||
# vim: set et sts=4 sw=4 tw=120 ft=sh:
|
1974
zsh/modules/prompt/external-themes/liquidprompt/liquidprompt
Executable file
1974
zsh/modules/prompt/external-themes/liquidprompt/liquidprompt
Executable file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
source ${0%/*}/liquidprompt
|
@ -0,0 +1,165 @@
|
||||
|
||||
####################################
|
||||
# LIQUID PROMPT CONFIGURATION FILE #
|
||||
####################################
|
||||
|
||||
# If you want to use different themes and features,
|
||||
# you can load the corresponding files here:
|
||||
#source ~/.config/liquidprompt/nojhan.theme
|
||||
#LP_PS1_FILE=~/.config/liquidprompt/nojhan.ps1
|
||||
|
||||
#############
|
||||
# BEHAVIOUR #
|
||||
#############
|
||||
|
||||
# Display the battery level when the level is below this threshold.
|
||||
# Recommended value is 75
|
||||
LP_BATTERY_THRESHOLD=75
|
||||
|
||||
# Display the load average when the load is above this threshold.
|
||||
# Recommended value is 60
|
||||
LP_LOAD_THRESHOLD=60
|
||||
|
||||
# Display the temperature when the temperate is above this threshold (in
|
||||
# degrees Celsius).
|
||||
# Recommended value is 60
|
||||
LP_TEMP_THRESHOLD=60
|
||||
|
||||
# Use the shorten path feature if the path is too long to fit in the prompt
|
||||
# line.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_SHORTEN_PATH=1
|
||||
|
||||
# The maximum percentage of the screen width used to display the path before
|
||||
# removing the center portion of the path and replacing with '...'.
|
||||
# Recommended value is 35
|
||||
LP_PATH_LENGTH=35
|
||||
|
||||
# The number of directories (including '/') to keep at the beginning of a
|
||||
# shortened path.
|
||||
# Recommended value is 2
|
||||
LP_PATH_KEEP=2
|
||||
|
||||
# Determine if the hostname should always be displayed, even if not connecting
|
||||
# through network.
|
||||
# Defaults to 0 (do not display hostname when locally connected)
|
||||
# set to 1 if you want to always see the hostname
|
||||
# set to -1 if you want to never see the hostname
|
||||
LP_HOSTNAME_ALWAYS=0
|
||||
|
||||
# Use the fully qualified domain name (FQDN) instead of the short hostname when
|
||||
# the hostname is displayed
|
||||
LP_ENABLE_FQDN=0
|
||||
|
||||
# Always display the user name, even if the user is the same as the one logged
|
||||
# in.
|
||||
# Defaults to 1 (always display the user name)
|
||||
# set to 0 if you want to hide the logged user (it will always display different
|
||||
# users)
|
||||
LP_USER_ALWAYS=1
|
||||
|
||||
# Display the percentages of load/batteries along with their
|
||||
# corresponding marks. Set to 0 to only print the colored marks.
|
||||
# Defaults to 1 (display percentages)
|
||||
LP_PERCENTS_ALWAYS=1
|
||||
|
||||
# Use the permissions feature and display a red ':' before the prompt to show
|
||||
# when you don't have write permission to the current directory.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_PERM=1
|
||||
|
||||
# Enable the proxy detection feature.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_PROXY=1
|
||||
|
||||
# Enable the jobs feature.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_JOBS=1
|
||||
|
||||
# Enable the load feature.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_LOAD=1
|
||||
|
||||
# Enable the battery feature.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_BATT=1
|
||||
|
||||
# Enable the 'sudo credentials' feature.
|
||||
# Be warned that this may pollute the syslog if you don't have sudo
|
||||
# credentials, and the sysadmin will hate you.
|
||||
LP_ENABLE_SUDO=0
|
||||
|
||||
# Enable the VCS features with the root account.
|
||||
# Recommended value is 0
|
||||
LP_ENABLE_VCS_ROOT=0
|
||||
|
||||
# Enable the Git special features.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_GIT=1
|
||||
|
||||
# Enable the Subversion special features.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_SVN=1
|
||||
|
||||
# Enable the Mercurial special features.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_HG=1
|
||||
|
||||
# Enable the Fossil special features.
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_FOSSIL=1
|
||||
|
||||
# Enable the Bazaar special features.
|
||||
# Recommanded value is 1
|
||||
LP_ENABLE_BZR=1
|
||||
|
||||
# Show time of when the current prompt was displayed. (Must be enabled and
|
||||
# disabled in the config file and not after liquidprompt has already been
|
||||
# sourced.)
|
||||
LP_ENABLE_TIME=0
|
||||
|
||||
# Show runtime of the previous command if over LP_RUNTIME_THRESHOLD
|
||||
# Recommended value is 0
|
||||
LP_ENABLE_RUNTIME=0
|
||||
|
||||
# Minimal runtime (in seconds) before the runtime will be displayed
|
||||
# Recommended value is 2
|
||||
LP_RUNTIME_THRESHOLD=2
|
||||
|
||||
# Display the virtualenv that is currently activated, if any
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_VIRTUALENV=1
|
||||
|
||||
# Display the enabled software collections, if any
|
||||
# Recommended value is 1
|
||||
LP_ENABLE_SCLS=1
|
||||
|
||||
# Show average system temperature
|
||||
LP_ENABLE_TEMP=1
|
||||
|
||||
# When showing the time, use an analog clock instead of numeric values.
|
||||
# The analog clock is "accurate" to the nearest half hour.
|
||||
# You must have a unicode-capable terminal and a font with the "CLOCK"
|
||||
# characters.
|
||||
# Recommended value is 0
|
||||
LP_TIME_ANALOG=0
|
||||
|
||||
# Use the prompt as the title of the terminal window
|
||||
# The content is not customizable, the implementation is very basic,
|
||||
# and this may not work properly on exotic terminals, thus the
|
||||
# recommended value is 0
|
||||
# See LP_TITLE_OPEN and LP_TITLE_CLOSE to change escape characters to adapt this
|
||||
# feature to your specific terminal.
|
||||
LP_ENABLE_TITLE=0
|
||||
|
||||
# Enable Title for screen and byobu
|
||||
LP_ENABLE_SCREEN_TITLE=0
|
||||
|
||||
# Use different colors for the different hosts you SSH to
|
||||
LP_ENABLE_SSH_COLORS=0
|
||||
|
||||
# Specify a list of complete and colon (":") separated paths in which, all vcs
|
||||
# will be disabled
|
||||
LP_DISABLED_VCS_PATH=""
|
||||
|
||||
# vim: set et sts=4 sw=4 tw=120 ft=sh:
|
@ -0,0 +1,48 @@
|
||||
|
||||
# Simulator for "pmset -g batt" for testing the implementation of
|
||||
# battery display on MacOS X
|
||||
|
||||
pmset()
|
||||
{
|
||||
case "$pmset_sim" in
|
||||
iMac|no-battery)
|
||||
# https://github.com/nojhan/liquidprompt/issues/315
|
||||
cat <<EOF
|
||||
Now drawing from 'AC Power'
|
||||
EOF
|
||||
;;
|
||||
attached)
|
||||
# https://github.com/nojhan/liquidprompt/issues/326#issuecomment-66120495
|
||||
cat <<'EOF'
|
||||
Now drawing from 'AC Power'
|
||||
-InternalBattery-0 37%; AC attached; not charging
|
||||
EOF
|
||||
;;
|
||||
charging)
|
||||
# https://github.com/nojhan/liquidprompt/issues/326
|
||||
cat <<'EOF'
|
||||
Now drawing from 'AC Power'
|
||||
-InternalBattery-0 8%; charging; 2:46 remaining
|
||||
EOF
|
||||
;;
|
||||
discharging)
|
||||
# https://github.com/nojhan/liquidprompt/issues/326
|
||||
cat <<'EOF'
|
||||
Now drawing from 'Battery Power'
|
||||
-InternalBattery-0 9%; discharging; (no estimate)
|
||||
EOF
|
||||
;;
|
||||
warning-Early)
|
||||
# https://github.com/nojhan/liquidprompt/issues/326
|
||||
cat <<'EOF'
|
||||
Now drawing from 'Battery Power'
|
||||
-InternalBattery-0 7%; discharging; 0:13 remaining
|
||||
Battery Warning: Early
|
||||
EOF
|
||||
;;
|
||||
*)
|
||||
echo "unsupported '$pmset_sim' pmset simulation"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
351
zsh/modules/prompt/external-themes/liquidprompt/test.sh
Executable file
351
zsh/modules/prompt/external-themes/liquidprompt/test.sh
Executable file
@ -0,0 +1,351 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# Run the testsuite with both bash and zsh
|
||||
if [ -z "$BASH_VERSION$ZSH_VERSION" ]; then
|
||||
for sh in bash zsh
|
||||
do
|
||||
if [ -x /bin/$sh ]; then
|
||||
/bin/$sh "$0"
|
||||
elif [ -x /usr/bin/$sh ]; then
|
||||
/usr/bin/$sh "$0"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
print_ok()
|
||||
{
|
||||
local OK="\\033[1;32m"
|
||||
local RAZ="\\033[0;39m"
|
||||
local cols=$1
|
||||
local name=$2
|
||||
# printf "\e${OK}%-${cols}s %-${cols}s\n${RAZ}" "$name" "OK"
|
||||
printf "${OK}%-${cols}s %-${cols}s\n${RAZ}" "$name" "OK"
|
||||
}
|
||||
|
||||
print_no()
|
||||
{
|
||||
local NOK="\\033[1;31m"
|
||||
local RAZ="\\033[0;39m"
|
||||
local cols=$1
|
||||
local name=$2
|
||||
local sub=$3
|
||||
local line=$4
|
||||
# printf "\e${NOK}%-${cols}s %-${cols}s #%-5s\n${RAZ}" "$name" "$sub" "$line"
|
||||
printf "${NOK}%-${cols}s %-${cols}s #%-5s\n${RAZ}" "$name" "$sub" "$line"
|
||||
}
|
||||
|
||||
assert()
|
||||
{
|
||||
local has=$1
|
||||
local name=$2
|
||||
local sub=$3
|
||||
local line=$4
|
||||
|
||||
if [[ -z "$sub" ]]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
|
||||
cols=20
|
||||
|
||||
if [[ $has == 1 ]] ; then
|
||||
if [[ "$PS1" == *$sub* ]]
|
||||
then
|
||||
print_ok $cols "has $name"
|
||||
else
|
||||
print_no $cols "has $name" $sub $line
|
||||
fi
|
||||
elif [[ $has == 0 ]] ; then
|
||||
if [[ "$PS1" != *$sub* ]]
|
||||
then
|
||||
print_ok $cols " no $name"
|
||||
else
|
||||
print_no $cols " no $name" $sub $line
|
||||
fi
|
||||
else
|
||||
if [[ "$PS1" == $sub ]]
|
||||
then
|
||||
print_ok $cols " is $name"
|
||||
else
|
||||
print_no $cols " is $name" $sub $line
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
assert_has()
|
||||
{
|
||||
|
||||
assert 1 "$@"
|
||||
}
|
||||
|
||||
assert_not()
|
||||
{
|
||||
assert 0 "$@"
|
||||
}
|
||||
|
||||
assert_is()
|
||||
{
|
||||
assert 2 "$@"
|
||||
}
|
||||
|
||||
log_prompt()
|
||||
{
|
||||
echo -e "$PS1" 1>&2
|
||||
}
|
||||
|
||||
#####################
|
||||
# REDEFINE COMMANDS #
|
||||
#####################
|
||||
|
||||
command()
|
||||
{
|
||||
echo "fake command $@" 1>&2
|
||||
echo "/bin/fake"
|
||||
}
|
||||
|
||||
uname()
|
||||
{
|
||||
echo "fake uname $@" 1>&2
|
||||
echo Linux
|
||||
}
|
||||
|
||||
nproc()
|
||||
{
|
||||
echo "fake nproc $@" 1>&2
|
||||
echo 2
|
||||
}
|
||||
|
||||
# battery
|
||||
acpi()
|
||||
{
|
||||
echo "fake acpi $@" 1>&2
|
||||
if [[ "x$1" == --battery ]]; then
|
||||
echo 'Battery 0: Discharging, 55%, 01:39:34 remaining'
|
||||
elif [[ "x$1" == -t ]]; then
|
||||
echo 'Thermal 0: ok, 36.0 degrees C'
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
git()
|
||||
{
|
||||
echo "fake git $@" 1>&2
|
||||
case $1 in
|
||||
"rev-parse" )
|
||||
echo ".git";;
|
||||
"branch" )
|
||||
echo "* fake_test";;
|
||||
"diff" )
|
||||
echo "2 1 fake_file"
|
||||
return 1;;
|
||||
"status" )
|
||||
echo "# Untracked";;
|
||||
"rev-list" )
|
||||
echo 111;;
|
||||
esac
|
||||
}
|
||||
|
||||
# global variables
|
||||
export http_proxy="fake"
|
||||
|
||||
|
||||
##########################
|
||||
# Call the liquid prompt #
|
||||
##########################
|
||||
|
||||
# As if we were in an interactive shell
|
||||
export PS1="fake prompt \$"
|
||||
# load functions
|
||||
source ./liquidprompt
|
||||
|
||||
# Force liquid prompt function redefinition
|
||||
_lp_cpu_load()
|
||||
{
|
||||
echo "fake _lp_cpu_load $@" 1>&2
|
||||
echo "0.64"
|
||||
}
|
||||
|
||||
|
||||
################
|
||||
# ADHOC CONFIG #
|
||||
################
|
||||
|
||||
export LP_BATTERY_THRESHOLD=60
|
||||
export LP_LOAD_THRESHOLD=1
|
||||
export LP_MARK_PROXY="proxy"
|
||||
export LP_MARK_BATTERY="BATT"
|
||||
export LP_MARK_LOAD="LOAD"
|
||||
export LP_MARK_UNTRACKED="untracked"
|
||||
export LP_MARK_GIT="gitmark"
|
||||
export LP_USER_ALWAYS=1
|
||||
|
||||
|
||||
# Force erroneous command
|
||||
fake_error
|
||||
|
||||
# Force set prompt
|
||||
_lp_set_prompt
|
||||
|
||||
|
||||
#########
|
||||
# TESTS #
|
||||
#########
|
||||
|
||||
echo "FULL PROMPT"
|
||||
log_prompt
|
||||
|
||||
assert_has Battery_Mark BATT $LINENO
|
||||
assert_has Battery_Level 55% $LINENO
|
||||
assert_has Load_Mark LOAD $LINENO
|
||||
assert_has Load_Level 32% $LINENO
|
||||
assert_has User "[\\\u" $LINENO
|
||||
if [[ $LP_HOSTNAME_ALWAYS == 0 ]] ; then
|
||||
assert_not Hostname "\\\h" $LINENO
|
||||
else
|
||||
assert_has Hostname "\\\h" $LINENO
|
||||
fi
|
||||
assert_has Perms : $LINENO
|
||||
assert_has Path $(pwd | sed -e "s|$HOME|~|") $LINENO
|
||||
assert_has Proxy proxy $LINENO
|
||||
assert_has Error 127 $LINENO
|
||||
assert_has GIT_Branch fake_test $LINENO
|
||||
assert_has GIT_Changes "+2/-1" $LINENO
|
||||
assert_has GIT_Commits 111 $LINENO
|
||||
assert_has GIT_Untrack untracked $LINENO
|
||||
assert_has GIT_Mark gitmark $LINENO
|
||||
|
||||
# start hiding features
|
||||
echo "DISABLE BATTERY"
|
||||
export LP_ENABLE_BATT=0
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_not Battery_Mark BATT $LINENO
|
||||
assert_not Battery_level 55% $LINENO
|
||||
assert_not Error 127 $LINENO
|
||||
|
||||
echo "HIDE BATTERY LEVEL"
|
||||
export LP_ENABLE_BATT=1
|
||||
export LP_BATTERY_THRESHOLD=50
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_has Battery_Mark BATT $LINENO
|
||||
assert_not Battery_level 55% $LINENO
|
||||
assert_not Error 127 $LINENO
|
||||
|
||||
alias acpi="echo 'Battery 0: Full, 100%'"
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_not Battery_Mark BATT $LINENO
|
||||
|
||||
echo "DISABLE LOAD"
|
||||
export LP_ENABLE_LOAD=0
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_not Load_Mark LOAD $LINENO
|
||||
assert_not Load_Level 32% $LINENO
|
||||
|
||||
echo "HIDE LOAD"
|
||||
export LP_ENABLE_LOAD=1
|
||||
export LP_LOAD_THRESHOLD=40
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_not Load_Mark LOAD $LINENO
|
||||
assert_not Load_Level 32% $LINENO
|
||||
|
||||
echo "DISABLE PROXY"
|
||||
export LP_ENABLE_PROXY=0
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_not Proxy_Mark proxy $LINENO
|
||||
|
||||
echo "NO PROXY"
|
||||
export LP_ENABLE_PROXY=1
|
||||
export http_proxy=""
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_not Proxy_Mark proxy $LINENO
|
||||
|
||||
echo "DISABLE GIT"
|
||||
export LP_ENABLE_GIT=0
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_not GIT_Branch fake_test $LINENO
|
||||
assert_not GIT_Changes "+2/-1" $LINENO
|
||||
assert_not GIT_Commits 111 $LINENO
|
||||
assert_not GIT_Untrack untracked $LINENO
|
||||
assert_not GIT_Mark gitmark $LINENO
|
||||
assert_has User_Mark $ $LINENO
|
||||
|
||||
echo "NO GIT"
|
||||
export LP_ENABLE_GIT=1
|
||||
alias git="echo"
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_not GIT_Branch fake_test $LINENO
|
||||
assert_not GIT_Changes "+2/-1" $LINENO
|
||||
assert_not GIT_Commits 111 $LINENO
|
||||
assert_not GIT_Untrack untracked $LINENO
|
||||
assert_not GIT_Mark gitmark $LINENO
|
||||
assert_has User_Mark $ $LINENO
|
||||
|
||||
# create a deep dir tree
|
||||
current=$PWD
|
||||
for d in $(seq 20) ; do
|
||||
dirname=""
|
||||
for i in $(seq 5); do
|
||||
dirname="$dirname$d"
|
||||
done
|
||||
mkdir -p $dirname
|
||||
cd $dirname
|
||||
done
|
||||
|
||||
echo "DISABLE SHORTEN PATH"
|
||||
export LP_ENABLE_SHORTEN_PATH=0
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_has Path "$(pwd | sed -e "s|$HOME|~|")" $LINENO
|
||||
|
||||
echo "ENABLE SHORTEN PATH"
|
||||
export LP_ENABLE_SHORTEN_PATH=1
|
||||
export LP_PATH_LENGTH=35
|
||||
export LP_PATH_KEEP=1
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
assert_has Short_Path " … " $LINENO
|
||||
|
||||
# get back out of the deep tree
|
||||
cd $current
|
||||
|
||||
echo "LOCAL HOST NAME"
|
||||
_lp_set_prompt
|
||||
log_prompt
|
||||
# As the hostname is set once at the script start,
|
||||
# and not re-interpret at each prompt,
|
||||
# we cannot export the option in the test script.
|
||||
# We thus rely on the existing config.
|
||||
if [[ $LP_HOSTNAME_ALWAYS == 0 ]] ; then
|
||||
assert_not Hostname "\\\h" $LINENO
|
||||
else
|
||||
assert_has Hostname "\\\h" $LINENO
|
||||
fi
|
||||
|
||||
echo "prompt_OFF"
|
||||
prompt_OFF
|
||||
log_prompt
|
||||
assert_is Prompt "$ " $LINENO
|
||||
|
||||
echo "prompt_on"
|
||||
prompt_on
|
||||
export LP_USER_ALWAYS=1
|
||||
log_prompt
|
||||
assert_has User "\\\u" $LINENO
|
||||
assert_has Perms : $LINENO
|
||||
assert_has Path $(pwd | sed -e "s|$HOME|~|") $LINENO
|
||||
# assert_has Path "\\\w" $LINENO
|
||||
assert_has Prompt "$ " $LINENO
|
||||
|
Reference in New Issue
Block a user