diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-08-07 12:04:35 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-08-07 12:04:35 +0300 |
commit | 24a5261a395d5e1d531275b70ed48de479abe38a (patch) | |
tree | 699487012a588b062353292cdcc3c61591f483d6 /internal/p10k.zsh | |
parent | 38055589a89045da82719bd78a901a768d17f0b4 (diff) |
wizard: enable os_icon for users who like many icons
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-x | internal/p10k.zsh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 017b5c23..035475d6 100755 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4037,9 +4037,12 @@ _p9k_init() { Linux) _p9k_os='Linux' local os_release_id - [[ -f /etc/os-release && - "${(f)$((</etc/os-release) 2>/dev/null)}" =~ "ID=([A-Za-z]+)" ]] && os_release_id="${match[1]}" - case "$os_release_id" in + if [[ -r /etc/os-release ]]; then + local lines=(${(f)"$(</etc/os-release)"}) + lines=(${(@M)lines:#ID=*}) + (( $#lines == 1 )) && os_release_id=${lines[1]#ID=} + fi + case $os_release_id in *arch*) _p9k_set_os Linux LINUX_ARCH_ICON;; *debian*) _p9k_set_os Linux LINUX_DEBIAN_ICON;; *raspbian*) _p9k_set_os Linux LINUX_RASPBIAN_ICON;; |