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
25fa44b2
Commit
25fa44b2
authored
Dec 04, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Distro: Use /etc/lsb-release file instead
parent
b177d4f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
neofetch
neofetch
+10
-14
No files found.
neofetch
View file @
25fa44b2
...
@@ -83,26 +83,22 @@ get_distro() {
...
@@ -83,26 +83,22 @@ get_distro() {
source
"
$file
"
&&
break
source
"
$file
"
&&
break
done
done
# The 3rd line down matches the fold marker syntax. {{{
# If the os-release file identifies the system as "Ubuntu"
# we then use /etc/lsb-release to get the distro information.
# This is required since Linux Mint and other distros
# aren't using the os-release file correctly.
if
[[
"
$NAME
"
=
~
"Ubuntu"
]]
;
then
source
/etc/lsb-release
unset
NAME VERSION_ID PRETTY_NAME UBUNTU_CODENAME
fi
# Format the distro name.
case
"
$distro_shorthand
"
in
case
"
$distro_shorthand
"
in
"on"
)
distro
=
"
${
NAME
:-${
DISTRIB_ID
}}
${
VERSION_ID
:-${
DISTRIB_RELEASE
}}
"
;;
"on"
)
distro
=
"
${
NAME
:-${
DISTRIB_ID
}}
${
VERSION_ID
:-${
DISTRIB_RELEASE
}}
"
;;
"tiny"
)
distro
=
"
${
NAME
:-${
DISTRIB_ID
:-${
TAILS_PRODUCT_NAME
}}}
"
;;
"tiny"
)
distro
=
"
${
NAME
:-${
DISTRIB_ID
:-${
TAILS_PRODUCT_NAME
}}}
"
;;
"off"
)
distro
=
"
${
PRETTY_NAME
:-${
DISTRIB_DESCRIPTION
}}
${
UBUNTU_CODENAME
}
"
;;
"off"
)
distro
=
"
${
PRETTY_NAME
:-${
DISTRIB_DESCRIPTION
}}
${
UBUNTU_CODENAME
}
"
;;
esac
esac
# If the os-release file identifies the system as "Ubuntu"
# we then use lsb_release to get the distro information.
# This is required since Linux Mint and other distros
# aren't using the os-release file correctly.
if
[[
"
$distro
"
=
~
"Ubuntu"
]]
;
then
case
"
$distro_shorthand
"
in
"on"
)
lsb_flags
=
"-sir"
;;
"tiny"
)
lsb_flags
=
"-si"
;;
"on"
)
lsb_flags
=
"-sd"
;;
esac
distro
=
"
$(
lsb_release
$lsb_flags
)
"
fi
# Workarounds for distros that go against the os-release standard.
# Workarounds for distros that go against the os-release standard.
[[
-z
"
${
distro
//
}
"
]]
&&
distro
=
"
$(
awk
'/BLAG/ {print $1; exit}'
/etc/
*
ease /usr/lib/
*
ease
)
"
[[
-z
"
${
distro
//
}
"
]]
&&
distro
=
"
$(
awk
'/BLAG/ {print $1; exit}'
/etc/
*
ease /usr/lib/
*
ease
)
"
[[
-z
"
${
distro
//
}
"
]]
&&
distro
=
"
$(
awk
-F
'='
'{print $2; exit}'
/etc/
*
ease /usr/lib/
*
ease
)
"
[[
-z
"
${
distro
//
}
"
]]
&&
distro
=
"
$(
awk
-F
'='
'{print $2; exit}'
/etc/
*
ease /usr/lib/
*
ease
)
"
...
...
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