Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
d142efe2
Commit
d142efe2
authored
Mar 03, 2016
by
Dylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added base support for progress bars
parent
0c165df0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
0 deletions
+74
-0
1.4.md
1.4.md
+6
-0
README.md
README.md
+6
-0
config
config/config
+15
-0
neofetch
neofetch
+47
-0
No files found.
1.4.md
View file @
d142efe2
...
@@ -8,6 +8,12 @@
...
@@ -8,6 +8,12 @@
### Info
### Info
-
Added the ability to print certain info as a progress bar.
-
Added
`--progress_char`
and
`$progress_char`
to set the character the progress bars<br
\>
will be drawn with.
-
Added
`--progress_colors`
to color the progress bars.
-
Added
`$progress_color_elapsed`
and
`$progress_color_total`
config options.
**Battery**
<br
\>
**Battery**
<br
\>
-
Added support for NetBSD
-
Added support for NetBSD
...
...
README.md
View file @
d142efe2
...
@@ -280,6 +280,12 @@ alias fetch2="fetch \
...
@@ -280,6 +280,12 @@ alias fetch2="fetch \
--block_range start end Range of colors to print as blocks
--block_range start end Range of colors to print as blocks
Progress Bars:
--progress_char char Character to use when drawing progress bars.
--progress_colors num num Colors to make the progress bar. Set in this order:
elapsed, total
Image:
Image:
--image type Image source. Where and what image we display.
--image type Image source. Where and what image we display.
Possible values: wall, shuffle, ascii,
Possible values: wall, shuffle, ascii,
...
...
config/config
View file @
d142efe2
...
@@ -217,6 +217,21 @@ prompt_height=1
...
@@ -217,6 +217,21 @@ prompt_height=1
# }}}
# }}}
# Progress Bars {{{
# Progress bar character
# --progress_char char
progress_char
=
"━"
# Progress bar colors
# --progress_colors col col
progress_color_elapsed
=
"6"
progress_color_total
=
"8"
# }}}
# Image Options {{{
# Image Options {{{
...
...
neofetch
View file @
d142efe2
...
@@ -237,6 +237,21 @@ prompt_height=1
...
@@ -237,6 +237,21 @@ prompt_height=1
# }}}
# }}}
# Progress Bars {{{
# Progress bar character
# --progress_char char
progress_char
=
"━"
# Progress bar colors
# --progress_colors col col
progress_color_elapsed
=
"6"
progress_color_total
=
"8"
# }}}
# Image Options {{{
# Image Options {{{
...
@@ -2227,6 +2242,25 @@ esac
...
@@ -2227,6 +2242,25 @@ esac
# }}}
# }}}
# Progress Bars {{{
bar() {
# Get the values
percent="
$1
"
length="
$2
"
inc=
$((
percent
*
length
/
100
))
# Create the bar with spaces
prog=
$(
printf
%
"
$inc
"
s
)
total=
$(
printf
%
"
$((
length
-
inc
))
"
s
)
# Set the colors and swap the spaces for
$progress_char
bar="
\033[38;5;
${
progress_color_elapsed
}
m
${
prog
// /
$progress_char
}
"
bar+="
\033[38;5;
${
progress_color_total
}
m
${
total
// /
$progress_char
}
"
printf "
%b%s\n
" "
${
bar
}${
clear
}
"
}
# }}}
# }}}
# }}}
...
@@ -2284,6 +2318,12 @@ usage () { cat << EOF
...
@@ -2284,6 +2318,12 @@ usage () { cat << EOF
--block_range start end Range of colors to print as blocks
--block_range start end Range of colors to print as blocks
Progress Bars:
--progress_char char Character to use when drawing progress bars.
--progress_colors num num Colors to make the progress bar. Set in this order:
elapsed, total
Image:
Image:
--image type Image source. Where and what image we display.
--image type Image source. Where and what image we display.
Possible values: wall, shuffle, ascii,
Possible values: wall, shuffle, ascii,
...
@@ -2397,6 +2437,13 @@ while [ "$1" ]; do
...
@@ -2397,6 +2437,13 @@ while [ "$1" ]; do
--block_range) start=
$2
; end=
$3
;;
--block_range) start=
$2
; end=
$3
;;
--block_width) block_width="
$2
" ;;
--block_width) block_width="
$2
" ;;
# Progress Bars
--progress_char) progress_char="
$2
" ;;
--progress_colors)
progress_color_elapsed="
$2
"
progress_color_total="
$3
"
;;
# Image
# Image
--image)
--image)
image="
$2
"
image="
$2
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment