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
bbdcfc63
Commit
bbdcfc63
authored
Dec 24, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cols: Remove $start + $end in favor of ${block_range[@]}
parent
6ebb1f5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
config
config/config
+4
-6
neofetch
neofetch
+12
-3
No files found.
config/config
View file @
bbdcfc63
...
@@ -372,8 +372,7 @@ underline_char="-"
...
@@ -372,8 +372,7 @@ underline_char="-"
# Color block range
# Color block range
# Start/End refer to the range of colors
# The range of colors to print.
# to print in the blocks.
#
#
# Default: '0', '7'
# Default: '0', '7'
# Values: 'num'
# Values: 'num'
...
@@ -381,13 +380,12 @@ underline_char="-"
...
@@ -381,13 +380,12 @@ underline_char="-"
#
#
# Example:
# Example:
#
#
# Display colors 0-7 in the blocks.
# Display colors 0-7 in the blocks.
(8 colors)
# neofetch --block_range 0 7
# neofetch --block_range 0 7
#
#
# Display colors 0-15 in the blocks.
# Display colors 0-15 in the blocks.
(16 colors)
# neofetch --block_range 0 15
# neofetch --block_range 0 15
start
=
0
block_range
=(
0 7
)
end
=
7
# Toggle color blocks
# Toggle color blocks
#
#
...
...
neofetch
View file @
bbdcfc63
...
@@ -1805,6 +1805,10 @@ get_cols() {
...
@@ -1805,6 +1805,10 @@ get_cols() {
# Convert the width to space chars.
# Convert the width to space chars.
printf -v block_width "%${block_width}s"
printf -v block_width "%${block_width}s"
# Set variables.
start="${block_range[0]}"
end="${block_range[1]}"
# Generate the string.
# Generate the string.
for ((start; start<=end; start++)); do
for ((start; start<=end; start++)); do
case "$start" in
case "$start" in
...
@@ -2825,6 +2829,9 @@ get_user_config() {
...
@@ -2825,6 +2829,9 @@ get_user_config() {
source
"
$config_file
"
source
"
$config_file
"
err
"Config: Sourced user config. (
${
config_file
}
)"
err
"Config: Sourced user config. (
${
config_file
}
)"
# Check for deprecated options.
old_options
}
}
bar
()
{
bar
()
{
...
@@ -2972,6 +2979,9 @@ old_options() {
...
@@ -2972,6 +2979,9 @@ old_options() {
# Ascii_logo_size was removed in 2.1.0.
# Ascii_logo_size was removed in 2.1.0.
[[
"
$ascii_logo_size
"
]]
&&
err
"Config: ascii_logo_size is deprecated, use ascii_distro='{arch,crux,gentoo}_small' instead."
[[
"
$ascii_logo_size
"
]]
&&
err
"Config: ascii_logo_size is deprecated, use ascii_distro='{arch,crux,gentoo}_small' instead."
# $start and $end were replaced with ${block_range[@]} in 2.1.0.
[[
"
$start
"
&&
"
$end
"
]]
&&
{
err
"Config:
\$
start and
\$
end are deprecated, use block_range=(0 7) instead."
;
block_range
=(
"
$start
"
"
$end
"
)
;
}
}
}
cache_uname
()
{
cache_uname
()
{
...
@@ -3121,7 +3131,7 @@ COLOR BLOCKS
...
@@ -3121,7 +3131,7 @@ COLOR BLOCKS
--color_blocks on/off Enable/Disable the color blocks
--color_blocks on/off Enable/Disable the color blocks
--block_width num Width of color blocks in spaces
--block_width num Width of color blocks in spaces
--block_height num Height of color blocks in lines
--block_height num Height of color blocks in lines
--block_range
start end
Range of colors to print as blocks
--block_range
num num
Range of colors to print as blocks
BARS
BARS
...
@@ -3301,7 +3311,7 @@ get_args() {
...
@@ -3301,7 +3311,7 @@ get_args() {
# Color Blocks
# Color Blocks
"--color_blocks"
)
color_blocks
=
"
$2
"
;;
"--color_blocks"
)
color_blocks
=
"
$2
"
;;
"--block_range"
)
start
=
"
$2
"
;
end
=
"
$3
"
;;
"--block_range"
)
block_range
=(
"
$2
"
"
$3
"
)
;;
"--block_width"
)
block_width
=
"
$2
"
;;
"--block_width"
)
block_width
=
"
$2
"
;;
"--block_height"
)
block_height
=
"
$2
"
;;
"--block_height"
)
block_height
=
"
$2
"
;;
...
@@ -3408,7 +3418,6 @@ main() {
...
@@ -3408,7 +3418,6 @@ main() {
get_os
get_os
get_default_config 2>/dev/null
get_default_config 2>/dev/null
get_args
"
$@
"
get_args
"
$@
"
old_options
get_distro
get_distro
get_bold
get_bold
get_distro_colors
get_distro_colors
...
...
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