summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorTim Otlik <t.otlik@vivaldi.net>2018-02-16 18:45:09 +0300
committerTim Otlik <t.otlik@vivaldi.net>2018-02-16 18:45:09 +0300
commitbba8bb883e6990ebd4216c1fe025e9d0fa9121a3 (patch)
tree8231898c1f4cf878258a4e5b13037ff06e3f1e10 /functions
parent845e74c5c3daff3f3d5a5f2a10edde279627c5b5 (diff)
add check of /etc/os-release for linux distros
Diffstat (limited to 'functions')
-rwxr-xr-x[-rw-r--r--]functions/colors.zsh0
-rwxr-xr-x[-rw-r--r--]functions/icons.zsh26
-rwxr-xr-x[-rw-r--r--]functions/utilities.zsh67
-rwxr-xr-x[-rw-r--r--]functions/vcs.zsh0
4 files changed, 66 insertions, 27 deletions
diff --git a/functions/colors.zsh b/functions/colors.zsh
index f421165c..f421165c 100644..100755
--- a/functions/colors.zsh
+++ b/functions/colors.zsh
diff --git a/functions/icons.zsh b/functions/icons.zsh
index 25546e77..5ae889e3 100644..100755
--- a/functions/icons.zsh
+++ b/functions/icons.zsh
@@ -278,20 +278,18 @@ case $POWERLEVEL9K_MODE in
FREEBSD_ICON $'\UF30E ' # 
ANDROID_ICON $'\uF17B' # 
LINUX_ARCH_ICON $'\uF300' # 
- LINUX_DEBIAN_ICON $'\uF302' # 
- LINUX_UBUNTU_ICON $'\uF30C' # 
- LINUX_CENTOS_ICON $'\uF301' # 
- LINUX_COREOS_ICON $'\uF30F' # 
- LINUX_ELEMENTARY_ICON $'\uF311' # 
- LINUX_FEDORA_ICON $'\uF303' # 
- LINUX_GENTOO_ICON $'\uF310' # 
- LINUX_MINT_ICON $'\uF304' # 
- LINUX_MAGEIA_ICON $'\uF306' # 
- LINUX_MANDRIVA_ICON $'\uF307' # 
- LINUX_OPENSUSE_ICON $'\uF308' # 
- LINUX_REDHAT_ICON $'\uF309' # 
- LINUX_SABAYON_ICON $'\uF313' # 
- LINUX_SLACKWARE_ICON $'\uF30A' # 
+ LINUX_DEBIAN_ICON $'\uF302' # 
+ LINUX_UBUNTU_ICON $'\uF30C' # 
+ LINUX_CENTOS_ICON $'\uF301' # 
+ LINUX_COREOS_ICON $'\uF30F' # 
+ LINUX_ELEMENTARY_ICON $'\uF311' # 
+ LINUX_FEDORA_ICON $'\uF303' # 
+ LINUX_GENTOO_ICON $'\uF310' # 
+ LINUX_MINT_ICON $'\uF304' # 
+ LINUX_MAGEIA_ICON $'\uF306' # 
+ LINUX_OPENSUSE_ICON $'\uF308' # 
+ LINUX_SABAYON_ICON $'\uF313' # 
+ LINUX_SLACKWARE_ICON $'\uF30A' # 
LINUX_ICON $'\uF17C' # 
SUNOS_ICON $'\uF185 ' # 
HOME_ICON $'\uF015' # 
diff --git a/functions/utilities.zsh b/functions/utilities.zsh
index 5f41f73e..89020b09 100644..100755
--- a/functions/utilities.zsh
+++ b/functions/utilities.zsh
@@ -102,24 +102,65 @@ case $(uname) in
OS_ICON=$(print_icon 'FREEBSD_ICON')
;;
Linux)
- OS='Linux'
- OS_ICON=$(print_icon 'LINUX_ICON')
-
- # Check if the OS is debian
- if [ `lsb_release -si`="Debian" ]; then
+ os_release_id="$(grep -E '^ID=([a-zA-Z]*)' /etc/os-release | cut -d '=' -f 2)"
+ case "$os_release_id" in
+ "arch")
+ OS='Arch'
+ OS_ICON=$(print_icon 'LINUX_ARCH_ICON')
+ ;;
+ "debian")
OS='Debian'
OS_ICON=$(print_icon 'LINUX_DEBIAN_ICON')
- fi
- # Check if the OS is ubuntu
- if [ `lsb_release -si`="Ubuntu" ]; then
+ ;;
+ "ubuntu")
OS='Ubuntu'
- OS_ICON=$(print_icon 'LINUX_Ubuntu_ICON')
- fi
- # Check if the OS is mint
- if [ `lsb_release -si`="Mint" ]; then
+ OS_ICON=$(print_icon 'LINUX_UBUNTU_ICON')
+ ;;
+ "elementary")
+ 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_ICON=$(print_icon 'LINUX_MINT_ICON')
- fi
+ ;;
+ *)
+ OS='Linux'
+ OS_ICON=$(print_icon 'LINUX_ICON')
+ ;;
+ esac
# Check if we're running on Android
case $(uname -o 2>/dev/null) in
diff --git a/functions/vcs.zsh b/functions/vcs.zsh
index e2e9f3a3..e2e9f3a3 100644..100755
--- a/functions/vcs.zsh
+++ b/functions/vcs.zsh