add check of /etc/os-release for linux distros

pull/22/head
Tim Otlik 7 years ago
parent 845e74c5c3
commit bba8bb883e
No known key found for this signature in database
GPG Key ID: 64694C30F7E8E0D3

@ -278,20 +278,18 @@ case $POWERLEVEL9K_MODE in
FREEBSD_ICON $'\UF30E ' #  FREEBSD_ICON $'\UF30E ' # 
ANDROID_ICON $'\uF17B' #  ANDROID_ICON $'\uF17B' # 
LINUX_ARCH_ICON $'\uF300' #  LINUX_ARCH_ICON $'\uF300' # 
LINUX_DEBIAN_ICON $'\uF302' #  LINUX_DEBIAN_ICON $'\uF302' # 
LINUX_UBUNTU_ICON $'\uF30C' #  LINUX_UBUNTU_ICON $'\uF30C' # 
LINUX_CENTOS_ICON $'\uF301' #  LINUX_CENTOS_ICON $'\uF301' # 
LINUX_COREOS_ICON $'\uF30F' #  LINUX_COREOS_ICON $'\uF30F' # 
LINUX_ELEMENTARY_ICON $'\uF311' #  LINUX_ELEMENTARY_ICON $'\uF311' # 
LINUX_FEDORA_ICON $'\uF303' #  LINUX_FEDORA_ICON $'\uF303' # 
LINUX_GENTOO_ICON $'\uF310' #  LINUX_GENTOO_ICON $'\uF310' # 
LINUX_MINT_ICON $'\uF304' #  LINUX_MINT_ICON $'\uF304' # 
LINUX_MAGEIA_ICON $'\uF306' #  LINUX_MAGEIA_ICON $'\uF306' # 
LINUX_MANDRIVA_ICON $'\uF307' #  LINUX_OPENSUSE_ICON $'\uF308' # 
LINUX_OPENSUSE_ICON $'\uF308' #  LINUX_SABAYON_ICON $'\uF313' # 
LINUX_REDHAT_ICON $'\uF309' #  LINUX_SLACKWARE_ICON $'\uF30A' # 
LINUX_SABAYON_ICON $'\uF313' # 
LINUX_SLACKWARE_ICON $'\uF30A' # 
LINUX_ICON $'\uF17C' #  LINUX_ICON $'\uF17C' # 
SUNOS_ICON $'\uF185 ' #  SUNOS_ICON $'\uF185 ' # 
HOME_ICON $'\uF015' #  HOME_ICON $'\uF015' # 

@ -102,24 +102,65 @@ case $(uname) in
OS_ICON=$(print_icon 'FREEBSD_ICON') OS_ICON=$(print_icon 'FREEBSD_ICON')
;; ;;
Linux) Linux)
OS='Linux' os_release_id="$(grep -E '^ID=([a-zA-Z]*)' /etc/os-release | cut -d '=' -f 2)"
OS_ICON=$(print_icon 'LINUX_ICON') case "$os_release_id" in
"arch")
# Check if the OS is debian OS='Arch'
if [ `lsb_release -si`="Debian" ]; then OS_ICON=$(print_icon 'LINUX_ARCH_ICON')
;;
"debian")
OS='Debian' OS='Debian'
OS_ICON=$(print_icon 'LINUX_DEBIAN_ICON') OS_ICON=$(print_icon 'LINUX_DEBIAN_ICON')
fi ;;
# Check if the OS is ubuntu "ubuntu")
if [ `lsb_release -si`="Ubuntu" ]; then
OS='Ubuntu' OS='Ubuntu'
OS_ICON=$(print_icon 'LINUX_Ubuntu_ICON') OS_ICON=$(print_icon 'LINUX_UBUNTU_ICON')
fi ;;
# Check if the OS is mint "elementary")
if [ `lsb_release -si`="Mint" ]; then OS='Elementary'
OS_ICON=$(print_icon 'LINUX_ELEMENTARY_ICON')
;;
"fedora")
OS='Fedora'
OS_ICON=$(print_icon 'LINUX_FEDORA_ICON')
;;
"coreos")
OS='CoreOS'
OS_ICON=$(print_icon 'LINUX_COREOS_ICON')
;;
"gentoo")
OS='Gentoo'
OS_ICON=$(print_icon 'LINUX_GENTOO_ICON')
;;
"mageia")
OS='Mageia'
OS_ICON=$(print_icon 'LINUX_MAGEIA_ICON')
;;
"centos")
OS='CentOS'
OS_ICON=$(print_icon 'LINUX_CENTOS_ICON')
;;
"opensuse"|"tumbleweed")
OS='OpenSUSE'
OS_ICON=$(print_icon 'LINUX_OPENSUSE_ICON')
;;
"sabayon")
OS='Sabayon'
OS_ICON=$(print_icon 'LINUX_SABAYON_ICON')
;;
"slackware")
OS='Slackware'
OS_ICON=$(print_icon 'LINUX_SLACKWARE_ICON')
;;
"linuxmint")
OS='Mint' OS='Mint'
OS_ICON=$(print_icon 'LINUX_MINT_ICON') OS_ICON=$(print_icon 'LINUX_MINT_ICON')
fi ;;
*)
OS='Linux'
OS_ICON=$(print_icon 'LINUX_ICON')
;;
esac
# Check if we're running on Android # Check if we're running on Android
case $(uname -o 2>/dev/null) in case $(uname -o 2>/dev/null) in

Loading…
Cancel
Save