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
695bd740
Commit
695bd740
authored
Apr 05, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #217 from dylanaraps/distro_func
Moved getdistro to a seperate function take 2
parents
a02f8577
71a94a55
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
neofetch
neofetch
+14
-20
No files found.
neofetch
View file @
695bd740
...
@@ -452,7 +452,10 @@ esac
...
@@ -452,7 +452,10 @@ esac
# Distro {{{
# Distro {{{
case
"
$os
"
in
getdistro
()
{
[
!
-z
"
$distro
"
]
&&
return
case
"
$os
"
in
"Linux"
)
"Linux"
)
if
type
-p
lsb_release
>
/dev/null 2>&1
;
then
if
type
-p
lsb_release
>
/dev/null 2>&1
;
then
distro
=
"
$(
lsb_release
-d
2>/dev/null |
awk
-F
':'
'/Description/ {printf $2}'
)
"
distro
=
"
$(
lsb_release
-d
2>/dev/null |
awk
-F
':'
'/Description/ {printf $2}'
)
"
...
@@ -507,14 +510,19 @@ case "$os" in
...
@@ -507,14 +510,19 @@ case "$os" in
distro=
${
distro
//
}
distro=
${
distro
//
}
distro=
${
distro
/Microsoft
}
distro=
${
distro
/Microsoft
}
;;
;;
esac
esac
distro=
${
distro
//+( )/
}
distro=
${
distro
//+( )/
}
ascii_distro="
$distro
"
ascii_distro="
$distro
"
getdistro () {
# Get architecture
# Get architecture
[ "
$os_arch
" == "
on
" ] &&
\
[ "
$os_arch
" == "
on
" ] &&
\
distro+="
$(
uname
-m
)
"
distro+="
$(
uname
-m
)
"
[ "
$osx_codename
" == "
off
" ] &&
\
distro=
${
distro
/
${
codename
}
/Mac OS X
}
[ "
$osx_buildversion
" == "
off
" ] &&
\
distro=
${
distro
/
${
osx_build
}}
}
}
...
@@ -2886,27 +2894,13 @@ done
...
@@ -2886,27 +2894,13 @@ done
# }}}
# }}}
# OS overides {{{
# Overide OS X codename
case
"
$osx_codename
"
in
"off"
)
distro
=
${
distro
/
${
codename
}
/Mac OS X
}
;;
esac
case
"
$osx_buildversion
"
in
"off"
)
distro
=
${
distro
/
${
osx_build
}}
;;
esac
# }}}
# Call Functions and Finish Up {{{
# Call Functions and Finish Up {{{
# Restore cursor and clear screen on ctrl+c
# Restore cursor and clear screen on ctrl+c
trap
'printf "\033[?25h"; clear; exit'
2
trap
'printf "\033[?25h"; clear; exit'
2
# Get colors / bold
getdistro
colors
colors
bold
bold
...
...
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