-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Liquidprompt Theme #1005
Merged
Merged
Liquidprompt Theme #1005
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
liquidprompt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/usr/bin/env bash | ||
# Wrapper to use liquidprompt with bashit | ||
|
||
targetdir="$BASH_IT/themes/liquidprompt/liquidprompt" | ||
gray="\[\e[1;90m\]" | ||
|
||
cwd="$PWD" | ||
if cd "$targetdir" &>/dev/null && git rev-parse --is-inside-work-tree &>/dev/null; then | ||
true | ||
else | ||
git clone https://github.com/nojhan/liquidprompt.git "$targetdir" && \ | ||
echo -e "Successfully cloned liquidprompt!\n More configuration in '$targetdir/liquid.theme'." | ||
fi | ||
cd "$cwd" | ||
|
||
export LP_ENABLE_TIME=1 | ||
export LP_HOSTNAME_ALWAYS=1 | ||
export LP_USER_ALWAYS=1 | ||
export LP_MARK_LOAD="📈 " | ||
export LP_BATTERY_THRESHOLD=${LP_BATTERY_THRESHOLD:-75} | ||
export LP_LOAD_THRESHOLD=${LP_LOAD_THRESHOLD:-60} | ||
export LP_TEMP_THRESHOLD=${LP_TEMP_THRESHOLD:-80} | ||
|
||
|
||
source "$targetdir/liquidprompt" | ||
prompt() { true; } | ||
export PS2=" ┃ " | ||
export LP_PS1_PREFIX="┌─" | ||
export LP_PS1_POSTFIX="\n└▪ " | ||
export LP_ENABLE_RUNTIME=0 | ||
|
||
_lp_git_branch() | ||
{ | ||
(( LP_ENABLE_GIT )) || return | ||
|
||
\git rev-parse --is-inside-work-tree >/dev/null 2>&1 || return | ||
|
||
local branch | ||
# Recent versions of Git support the --short option for symbolic-ref, but | ||
# not 1.7.9 (Ubuntu 12.04) | ||
if branch="$(\git symbolic-ref -q HEAD)"; then | ||
_lp_escape "$(\git rev-parse --short=5 -q HEAD 2>/dev/null):${branch#refs/heads/}" | ||
else | ||
# In detached head state, use commit instead | ||
# No escape needed | ||
\git rev-parse --short -q HEAD 2>/dev/null | ||
fi | ||
} | ||
|
||
_lp_time() { | ||
if (( LP_ENABLE_TIME )) && (( ! LP_TIME_ANALOG )); then | ||
LP_TIME="${gray}$(date +%d-%H:%M)${normal}" | ||
else | ||
LP_TIME="" | ||
fi | ||
} | ||
|
||
# Implementation using lm-sensors | ||
_lp_temp_sensors() | ||
{ | ||
local -i i | ||
for i in $(sensors -u | | ||
sed -n 's/^ temp[0-9][0-9]*_input: \([0-9]*\)\..*$/\1/p'); do | ||
(( $i > ${temperature:-0} )) && (( $i != 127 )) && temperature=i | ||
done | ||
} | ||
|
||
# Implementation using 'acpi -t' | ||
_lp_temp_acpi() | ||
{ | ||
local -i i | ||
for i in $(LANG=C acpi -t | | ||
sed 's/.* \(-\?[0-9]*\)\.[0-9]* degrees C$/\1/p'); do | ||
(( $i > ${temperature:-0} )) && (( $i != 127 )) && temperature=i | ||
done | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a directory
$BASH_IT/themes/liquidprompt/liquidprompt
, which is then shown as untracked to the Bash-it Git repo.Can you please add a
.gitignore
file inthemes/liquidprompt
, which ignores the nestedliquidprompt
folder?