aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-xinternal/p10k.zsh9
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;;