From 24a5261a395d5e1d531275b70ed48de479abe38a Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 7 Aug 2019 11:04:35 +0200 Subject: wizard: enable os_icon for users who like many icons --- internal/configure.zsh | 2 +- internal/p10k.zsh | 9 ++++--- internal/wizard.zsh | 66 ++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 66 insertions(+), 11 deletions(-) (limited to 'internal') diff --git a/internal/configure.zsh b/internal/configure.zsh index 5b054291..d7a253d9 100644 --- a/internal/configure.zsh +++ b/internal/configure.zsh @@ -1,4 +1,4 @@ -typeset -gr __p9k_wizard_columns=76 +typeset -gr __p9k_wizard_columns=80 typeset -gr __p9k_wizard_lines=21 typeset -gr __p9k_zd=${${ZDOTDIR:-$HOME}:A} typeset -gr __p9k_zd_u=${${${(q-)__p9k_zd}/#(#b)$HOME(|\/*)/'~'$match[1]}//\%/%%} 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)$((/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)"$(/dev/null)" == Android ]]; then + echo ANDROID_ICON + else + case $uname in + SunOS) echo SUNOS_ICON;; + Darwin) echo APPLE_ICON;; + CYGWIN_NT-* | MSYS_NT-*) echo WINDOWS_ICON;; + FreeBSD|OpenBSD|DragonFly) echo FREEBSD_ICON;; + Linux) + local os_release_id + if [[ -r /etc/os-release ]]; then + local lines=(${(f)"$(