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
d2ca2508
Unverified
Commit
d2ca2508
authored
Apr 16, 2020
by
dylan
Committed by
GitHub
Apr 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1442 from Crestwave/osh
neofetch: add support for OSH
parents
76856625
d0d6d208
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
9 deletions
+30
-9
neofetch
neofetch
+30
-9
No files found.
neofetch
View file @
d2ca2508
...
...
@@ -30,7 +30,11 @@
version=7.0.0
bash_version=${BASH_VERSION/.*}
# Fallback to a value of '5' for shells which support bash
# but do not set the 'BASH_' shell variables (osh).
bash_version=${BASH_VERSINFO[0]:-5}
shopt -s eval_unsafe_arith &>/dev/null
sys_locale=${LANG:-C}
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-${HOME}/.config}
PATH=$PATH:/usr/xpg4/bin:/usr/sbin:/sbin:/usr/etc:/usr/libexec
...
...
@@ -1583,7 +1587,12 @@ get_shell() {
[[ $shell_version != on ]] && return
case ${shell_name:=${SHELL##*/}} in
bash) shell+=${BASH_VERSION/-*} ;;
bash)
[[ $BASH_VERSION ]] ||
BASH_VERSION=$("$SHELL" -c "printf %s \"\$BASH_VERSION\"")
shell+=${BASH_VERSION/-*}
;;
sh|ash|dash) ;;
...
...
@@ -1593,6 +1602,14 @@ get_shell() {
shell=${shell/version}
;;
osh)
if [[ $OIL_VERSION ]]; then
shell+=$OIL_VERSION
else
shell+=$("$SHELL" -c "printf %s \"\$OIL_VERSION\"")
fi
;;
tcsh)
shell+=$("$SHELL" -c "printf %s \$tcsh")
;;
...
...
@@ -2338,7 +2355,7 @@ get_gpu() {
{ unset -v gpu; continue; }
case $gpu in
*"
a
dvanced"*)
*"
A
dvanced"*)
brand="${gpu/*AMD*ATI*/AMD ATI}"
brand="${brand:-${gpu/*AMD*/AMD}}"
brand="${brand:-${gpu/*ATI*/ATi}}"
...
...
@@ -2352,13 +2369,13 @@ get_gpu() {
gpu="$brand $gpu"
;;
*"
nvidia
"*)
*"
NVIDIA
"*)
gpu="${gpu/*\[}"
gpu="${gpu/\]*}"
gpu="NVIDIA $gpu"
;;
*"
i
ntel"*)
*"
I
ntel"*)
gpu="${gpu/*Intel/Intel}"
gpu="${gpu/\(R\)}"
gpu="${gpu/Corporation}"
...
...
@@ -2369,7 +2386,7 @@ get_gpu() {
[[ -z "$(trim "$gpu")" ]] && gpu="Intel Integrated Graphics"
;;
*"
virtualb
ox"*)
*"
VirtualB
ox"*)
gpu="VirtualBox Graphics Adapter"
;;
...
...
@@ -3974,7 +3991,7 @@ get_window_size() {
#
# False positive.
# shellcheck disable=2141
case $
{BASH_VERSINFO[0]}
in
case $
bash_version
in
4|5) IFS=';t' read -d t -t 0.05 -sra term_size ;;
*) IFS=';t' read -d t -t 1 -sra term_size ;;
esac
...
...
@@ -4222,7 +4239,7 @@ display_image() {
# Add a tiny delay to fix issues with images not
# appearing in specific terminal emulators.
((
BASH_VERSINFO[0]
>3)) && sleep 0.05
((
bash_version
>3)) && sleep 0.05
printf '%b\n%s;\n%s\n' "0;1;$xoffset;$yoffset;$width;$height;;;;;$image" 3 4 |\
"${w3m_img_path:-false}" -bg "$background_color" &>/dev/null
;;
...
...
@@ -4261,7 +4278,11 @@ info() {
[[ "$prin" ]] && return
# Update the variable.
output="$(trim "${!2:-${!1}}")"
if [[ "$2" ]]; then
output="$(trim "${!2}")"
else
output="$(trim "${!1}")"
fi
if [[ "$2" && "${output// }" ]]; then
prin "$1" "$output"
...
...
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