From 38937858736ff8a7483dbdd353c36aa190028aab Mon Sep 17 00:00:00 2001 From: Michael Louwrens Date: Sat, 10 Feb 2018 21:24:06 +0200 Subject: try out sudo icon changes --- functions/icons.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index e642da00..b29d0108 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -258,6 +258,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON $'\uE614 ' #  + SUDO_ICON $'\uE0A2' #  RUBY_ICON $'\uF219 ' #  AWS_ICON $'\uF270' #  AWS_EB_ICON $'\UF1BD ' #  @@ -332,6 +333,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON $'\u26A1' # ⚡ + SUDO_ICON $'\uE0A2' #  RUBY_ICON '' AWS_ICON 'AWS:' AWS_EB_ICON $'\U1F331 ' # 🌱 -- cgit v1.2.3 From 7fff5bd7a6c7c6d38c5984a1fa30571e89d14d1e Mon Sep 17 00:00:00 2001 From: Michael Louwrens Date: Mon, 12 Feb 2018 11:28:00 +0200 Subject: add new icons and add remote_sudo --- functions/icons.zsh | 5 ++++- powerlevel9k.zsh-theme | 15 ++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index b29d0108..6000e108 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -27,6 +27,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON $'\uE801' #  + SUDO_ICON $'\uF09C' #  RUBY_ICON $'\uE847 ' #  AWS_ICON $'\uE895' #  AWS_EB_ICON $'\U1F331 ' # 🌱 @@ -105,6 +106,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON $'\uF201' #  + SUDO_ICON $'\uF09C' #  RUBY_ICON $'\uF219 ' #  AWS_ICON $'\uF270' #  AWS_EB_ICON $'\U1F331 ' # 🌱 @@ -188,6 +190,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON '\u'$CODEPOINT_OF_OCTICONS_ZAP #  + SUDO_ICON '\u'$CODEPOINT_OF_AWESOME_UNLOCK #  RUBY_ICON '\u'$CODEPOINT_OF_OCTICONS_RUBY' ' #  AWS_ICON '\u'$CODEPOINT_OF_AWESOME_SERVER #  AWS_EB_ICON $'\U1F331 ' # 🌱 @@ -258,7 +261,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON $'\uE614 ' #  - SUDO_ICON $'\uE0A2' #  + SUDO_ICON $'\uF09C' #  RUBY_ICON $'\uF219 ' #  AWS_ICON $'\uF270' #  AWS_EB_ICON $'\UF1BD ' #  diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 2267ce64..8eb13bde 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -589,10 +589,11 @@ prompt_context() { local current_state="DEFAULT" typeset -AH context_states context_states=( - "ROOT" "yellow" - "SUDO" "yellow" - "DEFAULT" "yellow" - "REMOTE" "yellow" + "ROOT" "yellow" + "SUDO" "yellow" + "DEFAULT" "yellow" + "REMOTE" "yellow" + "REMOTE_SUDO" "yellow" ) local content="" @@ -608,7 +609,11 @@ prompt_context() { if [[ $(print -P "%#") == '#' ]]; then current_state="ROOT" elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then - current_state="REMOTE" + if sudo -n true 2>/dev/null; then + current_state="REMOTE_SUDO" + else + current_state="REMOTE" + fi elif sudo -n true 2>/dev/null; then current_state="SUDO" fi -- cgit v1.2.3 From 845e74c5c3daff3f3d5a5f2a10edde279627c5b5 Mon Sep 17 00:00:00 2001 From: Tim Otlik Date: Fri, 16 Feb 2018 12:56:47 +0100 Subject: added LINUX_*_ICON for several OS --- functions/icons.zsh | 17 ++++++++++++++++- functions/utilities.zsh | 16 ++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index e642da00..25546e77 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -151,7 +151,7 @@ case $POWERLEVEL9K_MODE in VCS_GIT_GITLAB_ICON $'\uF296 ' #  VCS_HG_ICON $'\uF0C3 ' #  VCS_SVN_ICON '(svn) ' - RUST_ICON $'\uE6A8' #  + RUST_ICON $'\uE6A8' #  PYTHON_ICON $'\ue63c' #  SWIFT_ICON '' GO_ICON '' @@ -277,6 +277,21 @@ case $POWERLEVEL9K_MODE in WINDOWS_ICON $'\uF17A' #  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_ICON $'\uF17C' #  SUNOS_ICON $'\uF185 ' #  HOME_ICON $'\uF015' #  diff --git a/functions/utilities.zsh b/functions/utilities.zsh index b4bfb838..5f41f73e 100644 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -105,6 +105,22 @@ case $(uname) in OS='Linux' OS_ICON=$(print_icon 'LINUX_ICON') + # Check if the OS is debian + if [ `lsb_release -si`="Debian" ]; then + OS='Debian' + OS_ICON=$(print_icon 'LINUX_DEBIAN_ICON') + fi + # Check if the OS is ubuntu + if [ `lsb_release -si`="Ubuntu" ]; then + OS='Ubuntu' + OS_ICON=$(print_icon 'LINUX_Ubuntu_ICON') + fi + # Check if the OS is mint + if [ `lsb_release -si`="Mint" ]; then + OS='Mint' + OS_ICON=$(print_icon 'LINUX_MINT_ICON') + fi + # Check if we're running on Android case $(uname -o 2>/dev/null) in Android) -- cgit v1.2.3 From bba8bb883e6990ebd4216c1fe025e9d0fa9121a3 Mon Sep 17 00:00:00 2001 From: Tim Otlik Date: Fri, 16 Feb 2018 16:45:09 +0100 Subject: add check of /etc/os-release for linux distros --- functions/colors.zsh | 0 functions/icons.zsh | 26 +++++++++---------- functions/utilities.zsh | 67 +++++++++++++++++++++++++++++++++++++++---------- functions/vcs.zsh | 0 4 files changed, 66 insertions(+), 27 deletions(-) mode change 100644 => 100755 functions/colors.zsh mode change 100644 => 100755 functions/icons.zsh mode change 100644 => 100755 functions/utilities.zsh mode change 100644 => 100755 functions/vcs.zsh (limited to 'functions') diff --git a/functions/colors.zsh b/functions/colors.zsh old mode 100644 new mode 100755 diff --git a/functions/icons.zsh b/functions/icons.zsh old mode 100644 new mode 100755 index 25546e77..5ae889e3 --- 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 old mode 100644 new mode 100755 index 5f41f73e..89020b09 --- 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 old mode 100644 new mode 100755 -- cgit v1.2.3 From da9ec721b7e0a3fc7191d9b80e246a57bdfebf41 Mon Sep 17 00:00:00 2001 From: Tim Otlik Date: Fri, 16 Feb 2018 17:31:17 +0100 Subject: add missing icons to compat set --- functions/icons.zsh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index 5ae889e3..e89b3431 100755 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -47,6 +47,18 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON $'\U1F608 ' # 😈 ANDROID_ICON $'\uE270' #  LINUX_ICON $'\uE271' #  + LINUX_DEBIAN_ICON 'Deb' + LINUX_UBUNTU_ICON 'Ubu' + LINUX_CENTOS_ICON 'Cen' + LINUX_COREOS_ICON 'Cor' + LINUX_ELEMENTARY_ICON 'Elm' + LINUX_MINT_ICON 'LMi' + LINUX_FEDORA_ICON 'Fed' + LINUX_GENTOO_ICON 'Gen' + LINUX_MAGEIA_ICON 'Mag' + LINUX_OPENSUSE_ICON 'OSu' + LINUX_SABAYON_ICON 'Sab' + LINUX_SLACKWARE_ICON 'Sla' SUNOS_ICON $'\U1F31E ' # 🌞 HOME_ICON $'\uE12C' #  HOME_SUB_ICON $'\uE18D' #  @@ -125,6 +137,18 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON $'\U1F608 ' # 😈 ANDROID_ICON $'\uE17B' #  LINUX_ICON $'\uF17C' #  + LINUX_DEBIAN_ICON 'Deb' + LINUX_UBUNTU_ICON 'Ubu' + LINUX_CENTOS_ICON 'Cen' + LINUX_COREOS_ICON 'Cor' + LINUX_ELEMENTARY_ICON 'Elm' + LINUX_MINT_ICON 'LMi' + LINUX_FEDORA_ICON 'Fed' + LINUX_GENTOO_ICON 'Gen' + LINUX_MAGEIA_ICON 'Mag' + LINUX_OPENSUSE_ICON 'OSu' + LINUX_SABAYON_ICON 'Sab' + LINUX_SLACKWARE_ICON 'Sla' SUNOS_ICON $'\uF185 ' #  HOME_ICON $'\uF015' #  HOME_SUB_ICON $'\uF07C' #  @@ -205,6 +229,18 @@ case $POWERLEVEL9K_MODE in APPLE_ICON '\u'$CODEPOINT_OF_AWESOME_APPLE #  FREEBSD_ICON $'\U1F608 ' # 😈 LINUX_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  + LINUX_DEBIAN_ICON 'Deb' + LINUX_UBUNTU_ICON 'Ubu' + LINUX_CENTOS_ICON 'Cen' + LINUX_COREOS_ICON 'Cor' + LINUX_ELEMENTARY_ICON 'Elm' + LINUX_MINT_ICON 'LMi' + LINUX_FEDORA_ICON 'Fed' + LINUX_GENTOO_ICON 'Gen' + LINUX_MAGEIA_ICON 'Mag' + LINUX_OPENSUSE_ICON 'OSu' + LINUX_SABAYON_ICON 'Sab' + LINUX_SLACKWARE_ICON 'Sla' SUNOS_ICON '\u'$CODEPOINT_OF_AWESOME_SUN_O' ' #  HOME_ICON '\u'$CODEPOINT_OF_AWESOME_HOME #  HOME_SUB_ICON '\u'$CODEPOINT_OF_AWESOME_FOLDER_OPEN #  @@ -365,6 +401,18 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON 'BSD' ANDROID_ICON 'And' LINUX_ICON 'Lx' + LINUX_DEBIAN_ICON 'Deb' + LINUX_UBUNTU_ICON 'Ubu' + LINUX_CENTOS_ICON 'Cen' + LINUX_COREOS_ICON 'Cor' + LINUX_ELEMENTARY_ICON 'Elm' + LINUX_MINT_ICON 'LMi' + LINUX_FEDORA_ICON 'Fed' + LINUX_GENTOO_ICON 'Gen' + LINUX_MAGEIA_ICON 'Mag' + LINUX_OPENSUSE_ICON 'OSu' + LINUX_SABAYON_ICON 'Sab' + LINUX_SLACKWARE_ICON 'Sla' SUNOS_ICON 'Sun' HOME_ICON '' HOME_SUB_ICON '' -- cgit v1.2.3 From ba0e940af376fc4653c801bb85519032c8cf7697 Mon Sep 17 00:00:00 2001 From: Tim Otlik Date: Fri, 16 Feb 2018 17:42:14 +0100 Subject: arch icon was missing --- functions/icons.zsh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'functions') diff --git a/functions/icons.zsh b/functions/icons.zsh index e89b3431..c327b1e6 100755 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -47,6 +47,7 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON $'\U1F608 ' # 😈 ANDROID_ICON $'\uE270' #  LINUX_ICON $'\uE271' #  + LINUX_ARCH_ICON 'Arc' LINUX_DEBIAN_ICON 'Deb' LINUX_UBUNTU_ICON 'Ubu' LINUX_CENTOS_ICON 'Cen' @@ -137,6 +138,7 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON $'\U1F608 ' # 😈 ANDROID_ICON $'\uE17B' #  LINUX_ICON $'\uF17C' #  + LINUX_ARCH_ICON 'Arc' LINUX_DEBIAN_ICON 'Deb' LINUX_UBUNTU_ICON 'Ubu' LINUX_CENTOS_ICON 'Cen' @@ -229,6 +231,7 @@ case $POWERLEVEL9K_MODE in APPLE_ICON '\u'$CODEPOINT_OF_AWESOME_APPLE #  FREEBSD_ICON $'\U1F608 ' # 😈 LINUX_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  + LINUX_ARCH_ICON 'Arc' LINUX_DEBIAN_ICON 'Deb' LINUX_UBUNTU_ICON 'Ubu' LINUX_CENTOS_ICON 'Cen' @@ -401,6 +404,7 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON 'BSD' ANDROID_ICON 'And' LINUX_ICON 'Lx' + LINUX_ARCH_ICON 'Arc' LINUX_DEBIAN_ICON 'Deb' LINUX_UBUNTU_ICON 'Ubu' LINUX_CENTOS_ICON 'Cen' -- cgit v1.2.3 From 80176c263f0d4343a043e3284082299d9bfc5b8d Mon Sep 17 00:00:00 2001 From: Tim Otlik Date: Mon, 19 Feb 2018 18:48:21 +0100 Subject: fix $OS variable for battery segment --- functions/utilities.zsh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'functions') diff --git a/functions/utilities.zsh b/functions/utilities.zsh index 89020b09..1f4df9bc 100755 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -102,58 +102,46 @@ case $(uname) in OS_ICON=$(print_icon 'FREEBSD_ICON') ;; Linux) + OS='Linux' 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') ;; "ubuntu") - OS='Ubuntu' 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') ;; *) -- cgit v1.2.3