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
40e9162d
Commit
40e9162d
authored
Aug 04, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/dylanaraps/neofetch
parents
9225d0d6
edf6ba0e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
74 deletions
+43
-74
README.md
README.md
+0
-29
config
config/config
+0
-4
neofetch
neofetch
+43
-38
neofetch.1
neofetch.1
+0
-3
No files found.
README.md
View file @
40e9162d
...
@@ -335,7 +335,6 @@ Here's what my fetch alias looks like:
...
@@ -335,7 +335,6 @@ Here's what my fetch alias looks like:
```
sh
```
sh
alias
fetch2
=
"fetch
\
alias
fetch2
=
"fetch
\
--block_range 1 8
\
--block_range 1 8
\
--line_wrap off
\
--bold off
\
--bold off
\
--uptime_shorthand on
\
--uptime_shorthand on
\
--gtk_shorthand on
\
--gtk_shorthand on
\
...
@@ -395,7 +394,6 @@ alias fetch2="fetch \
...
@@ -395,7 +394,6 @@ alias fetch2="fetch \
title, @, underline, subtitle, colon, info
title, @, underline, subtitle, colon, info
--underline on/off enable/disable the underline.
--underline on/off enable/disable the underline.
--underline_char char Character to use when underlining title
--underline_char char Character to use when underlining title
--line_wrap on/off Enable/Disable line wrapping
--bold on/off Enable/Disable bold text
--bold on/off Enable/Disable bold text
...
@@ -518,33 +516,6 @@ know where it's stored then adding support won't be a problem!<br \>
...
@@ -518,33 +516,6 @@ know where it's stored then adding support won't be a problem!<br \>
## Issues and Workarounds
## Issues and Workarounds
#### The text is too long for my terminal window and wraps to the next line
There are a few ways to fix this.
*
Disable line wrapping with
`line_wrap=off`
in the script or with the launch flag
`--line_wrap off`
*
The uptime and gtk info lines each have a shorthand option that makes their output smaller. You can <br
\>
enable them by changing these variables or using these flags.
```
sh
# Config options
uptime_shorthand
=
"on"
gtk_shorthand
=
"on"
gpu_shorthand
=
"on"
birthday_shorthand
=
"on"
# Launch flags
--uptime_shorthand
on
--gtk_shorthand
on
--gpu_shorthand
on
--birthday_shorthand
on
```
*
Edit the config to make the subtitles shorter
*
Resizing the terminal so that the lines don't wrap.
#### The text is pushed over too far to the right
#### The text is pushed over too far to the right
The easiest way to fix this is to change the value of
`--gap`
or
`$gap`
<br
\>
The easiest way to fix this is to change the value of
`--gap`
or
`$gap`
<br
\>
...
...
config/config
View file @
40e9162d
...
@@ -212,10 +212,6 @@ colors=(distro)
...
@@ -212,10 +212,6 @@ colors=(distro)
# Text Options {{{
# Text Options {{{
# Toggle line wrapping
# --line_wrap on/off
line_wrap
=
"off"
# Toggle bold text
# Toggle bold text
# --bold on/off
# --bold on/off
bold
=
"on"
bold
=
"on"
...
...
neofetch
View file @
40e9162d
...
@@ -217,10 +217,6 @@ colors=(distro)
...
@@ -217,10 +217,6 @@ colors=(distro)
# Text Options {{{
# Text Options {{{
# Toggle line wrapping
# --line_wrap on/off
line_wrap
=
"off"
# Toggle bold text
# Toggle bold text
# --bold on/off
# --bold on/off
bold
=
"on"
bold
=
"on"
...
@@ -2215,18 +2211,11 @@ getascii () {
...
@@ -2215,18 +2211,11 @@ getascii () {
ascii="
$script_dir
/ascii/distro/
${
ascii
/ *
}
"
ascii="
$script_dir
/ascii/distro/
${
ascii
/ *
}
"
fi
fi
# We only use eval in the distro ascii files.
print="
$(
eval printf
"
$(
<
"
$ascii
"
)
"
)
"
else
case "
${
ascii_colors
[0]
}
" in
"
distro
") ascii_color="
$c1
" ;;
*) ascii_color="
\0
33[38
;
5
;
${
ascii_colors
[0]
}
m
" ;;
esac
print="
${
ascii_color
}$(
<
"
$ascii
"
)
"
fi
fi
# Eval colors
print="
$(
eval printf
"
$(
<
"
$ascii
"
)
"
)
"
# Set locale to get correct padding
# Set locale to get correct padding
export LC_ALL="
$SYS_LOCALE
"
export LC_ALL="
$SYS_LOCALE
"
...
@@ -2321,6 +2310,7 @@ getimage () {
...
@@ -2321,6 +2310,7 @@ getimage () {
# Calculate font size
# Calculate font size
font_width="
$((
term_width
/
columns
))
"
font_width="
$((
term_width
/
columns
))
"
font_height="
$((
term_height
/
lines
))
"
# Image size is half of the terminal
# Image size is half of the terminal
case "
$image_size
" in
case "
$image_size
" in
...
@@ -2486,6 +2476,14 @@ info () {
...
@@ -2486,6 +2476,14 @@ info () {
# Trim whitespace
# Trim whitespace
output
=
"
$(
trim
"
$output
"
)
"
output
=
"
$(
trim
"
$output
"
)
"
# Fix rendering issues with w3m and lines that
# wrap to the next line by adding a max line
# length.
if
[
"
$image
"
!=
"off"
]
&&
[
"
$image
"
!=
"ascii"
]
&&
[
"
$1
"
!=
"cols"
]
;
then
padding_num
=
"
${
padding
/\\033\[
}
"
output
=
"
$(
printf
"%.
$((
columns
-
${
padding_num
/C
}
-
gap
-
${#
subtitle
}))
s"
"
$output
"
)
"
fi
case
"
$1
"
in
case
"
$1
"
in
title
)
title
)
string
=
"
${
title_color
}${
bold
}${
output
}
"
string
=
"
${
title_color
}${
bold
}${
output
}
"
...
@@ -2516,16 +2514,26 @@ info () {
...
@@ -2516,16 +2514,26 @@ info () {
# Prin {{{
# Prin {{{
prin
()
{
prin
()
{
if
[
-z
"
$2
"
]
;
then
string
=
"
$1
${
2
:+:
$2
}
"
string
=
"
${
info_color
}${
1
}
"
length
=
"
${#
1
}
"
# Fix rendering issues with w3m and lines that
# wrap to the next line by adding a max line
# length.
if
[
"
$image
"
!=
"off"
]
&&
[
"
$image
"
!=
"ascii"
]
;
then
padding_num
=
"
${
padding
/\\033\[
}
"
string
=
"
$(
printf
"%.
$((
columns
-
${
padding_num
/C
}
-
gap
))
s"
"
$string
"
)
"
fi
else
# If $2 doesn't exist we format $1 as info
string
=
"
${
subtitle_color
}${
bold
}${
1
}
\0
33[0m"
if
[
-z
"
$2
"
]
;
then
s
tring+
=
"
${
colon_color
}
:
${
info_color
}${
2
}
"
s
ubtitle_color
=
"
$info_color
"
length
=
"
$((${#
subtitle
}
+
${#
2
}
+
1
))
"
bold
=
fi
fi
# Format the output
string
=
"
${
string
/
:/
"
\0
33[0m"
${
colon_color
}
:
${
info_color
}}
"
string
=
"
${
subtitle_color
}${
bold
}${
string
}
"
# Trim whitespace
# Trim whitespace
string
=
"
$(
trim
"
$string
"
)
"
string
=
"
$(
trim
"
$string
"
)
"
...
@@ -2999,7 +3007,6 @@ usage () { cat << EOF
...
@@ -2999,7 +3007,6 @@ usage () { cat << EOF
title, @, underline, subtitle, colon, info
title, @, underline, subtitle, colon, info
--underline on/off enable/disable the underline.
--underline on/off enable/disable the underline.
--underline_char char Character to use when underlining title
--underline_char char Character to use when underlining title
--line_wrap on/off Enable/Disable line wrapping
--bold on/off Enable/Disable bold text
--bold on/off Enable/Disable bold text
...
@@ -3143,7 +3150,6 @@ while [ "$1" ]; do
...
@@ -3143,7 +3150,6 @@ while [ "$1" ]; do
# Text Formatting
# Text Formatting
--underline
)
underline_enabled
=
"
$2
"
;;
--underline
)
underline_enabled
=
"
$2
"
;;
--underline_char
)
underline_char
=
"
$2
"
;;
--underline_char
)
underline_char
=
"
$2
"
;;
--line_wrap
)
line_wrap
=
"
$2
"
;;
--bold
)
bold
=
"
$2
"
;;
--bold
)
bold
=
"
$2
"
;;
# Color Blocks
# Color Blocks
...
@@ -3342,7 +3348,7 @@ if [ "$image" != "off" ] && [ "$image" != "ascii" ]; then
...
@@ -3342,7 +3348,7 @@ if [ "$image" != "off" ] && [ "$image" != "ascii" ]; then
fi
fi
# Disable line wrap
# Disable line wrap
[
"
$line_wrap
"
==
"off"
]
&&
printf
"
\0
33[?7l"
printf
"
\0
33[?7l"
# Move cursor to the top
# Move cursor to the top
[
"
$image
"
!=
"off"
]
&&
printf
"
\0
33[0H"
[
"
$image
"
!=
"off"
]
&&
printf
"
\0
33[0H"
...
@@ -3350,28 +3356,27 @@ fi
...
@@ -3350,28 +3356,27 @@ fi
# Print the info
# Print the info
printinfo
printinfo
# Dynamic prompt location.
# Dynamic prompt location {{{
case
"
$image
"
in
"ascii"
)
# Get cursor position
info_height
=
"
$(
stty
-echo
;
IFS
=
';'
read
-rdR
-t
1
-d
c
-p
$'
\0
33[6n
\0
33[c'
ROW COL
;
printf
"%s"
"
${
ROW
#*[
}
"
;
stty echo
)
"
# Set cursor position dynamically based on height of ascii/text.
# Get cursor position
[
"
${
lines
:-
0
}
"
-lt
"
${
info_height
:-
0
}
"
]
&&
lines
=
"
$info_height
"
info_height
=
"
$(
stty
-echo
;
IFS
=
';'
read
-rdR
-t
1
-d
c
-p
$'
\0
33[6n
\0
33[c'
ROW COL
;
printf
"%s"
"
${
ROW
#*[
}
"
;
stty echo
)
"
;;
"off"
)
;;
# Calculate image height in terminal cells.
# The '+ 3' adds a gap between the prompt and the content.
[
"
$image
"
!=
"ascii"
]
&&
[
"
$image
"
!=
"off"
]
&&
\
lines
=
"
$((${
height
:-
1
}
/
${
font_height
:-
1
}
+
3
))
"
# Calculate image height in terminal cells.
# If the info is higher than the ascii/image place the prompt
*
)
lines
=
"
$((${
width
:-
1
}
/
${
font_width
:-
1
}
/
2
+
3
))
"
;;
# based on the info height instead of the ascii/image height.
[
"
${
lines
:-
0
}
"
-lt
"
${
info_height
:-
0
}
"
]
&&
lines
=
"
$info_height
"
esac
# Set the prompt location
# Set the prompt location
[
"
$image
"
!=
"off"
]
&&
printf
"%b%s"
"
\0
33[
${
lines
:-
0
}
H"
[
"
$image
"
!=
"off"
]
&&
printf
"%b%s"
"
\0
33[
${
lines
:-
0
}
H"
# }}}
# Re-enable line wrap
# Re-enable line wrap
[
"
$line_wrap
"
==
"off"
]
&&
printf
"%b%s"
"
\0
33[?7h"
printf
"%b%s"
"
\0
33[?7h"
# If enabled take a screenshot
# If enabled take a screenshot
if
[
"
$scrot
"
==
"on"
]
;
then
if
[
"
$scrot
"
==
"on"
]
;
then
...
...
neofetch.1
View file @
40e9162d
...
@@ -105,9 +105,6 @@ enable/disable the underline.
...
@@ -105,9 +105,6 @@ enable/disable the underline.
.B \--underline_char 'char'
.B \--underline_char 'char'
Character to use when underlining title
Character to use when underlining title
.TP
.TP
.B \--line_wrap 'on/off'
Enable/Disable line wrapping
.TP
.B \--bold 'on/off'
.B \--bold 'on/off'
Enable/Disable bold text
Enable/Disable bold text
.TP
.TP
...
...
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