From da3e638cf995998b1dd73b298f47a84dcf7b29e1 Mon Sep 17 00:00:00 2001 From: pztrn Date: Sun, 1 Mar 2015 09:57:58 +0500 Subject: [PATCH] * Fixed lsmod calling on systems different from Linux. * fbterm check now runs only on Linux and if lsmod is available. * Added OS and OS_RELEASE vars. * Themes now should also ends with .zsh. --- zsh/05-vars.zsh | 5 +++ zsh/40-prompt.zsh | 4 +-- zsh/50-aliases.zsh | 37 ---------------------- zsh/99-fbterm.zsh | 15 +++++++-- zsh/prompts/{pztrn.zsh-theme => pztrn.zsh} | 2 +- zshrc | 2 +- 6 files changed, 22 insertions(+), 43 deletions(-) create mode 100644 zsh/05-vars.zsh rename zsh/prompts/{pztrn.zsh-theme => pztrn.zsh} (98%) diff --git a/zsh/05-vars.zsh b/zsh/05-vars.zsh new file mode 100644 index 0000000..a29afac --- /dev/null +++ b/zsh/05-vars.zsh @@ -0,0 +1,5 @@ +# This file includes some variables that vital to all parts of +# this configuration. + +OS=`uname` +OS_RELEASE=`uname -r` \ No newline at end of file diff --git a/zsh/40-prompt.zsh b/zsh/40-prompt.zsh index 920b7b1..c309d71 100644 --- a/zsh/40-prompt.zsh +++ b/zsh/40-prompt.zsh @@ -4,8 +4,8 @@ autoload -Uz promptinit promptinit if [ "${PROMPT_THEME}" != "" ]; then - if [ -f ${CONFIG_PATH}/zsh/prompts/${PROMPT_THEME}.zsh-theme ]; then - source ${CONFIG_PATH}/zsh/prompts/${PROMPT_THEME}.zsh-theme + if [ -f ${CONFIG_PATH}/zsh/prompts/${PROMPT_THEME}.zsh ]; then + source ${CONFIG_PATH}/zsh/prompts/${PROMPT_THEME}.zsh else echo "Theme \"${PROMPT_THEME}\" could not be loaded. File does not exist or unreadable." fi diff --git a/zsh/50-aliases.zsh b/zsh/50-aliases.zsh index ad23fe8..734ec9b 100644 --- a/zsh/50-aliases.zsh +++ b/zsh/50-aliases.zsh @@ -1,42 +1,5 @@ alias screen="TERM=xterm screen" -# AION ^_^ -#alias aion="cd /data/Programs/aion/ && WINEPREFIX="/home/pztrn/.wine-aion" wine AWLite.exe" - -# SVN Add all in ABUILDS -#alias addall="cd /data/AgiliaLinux/ABUILDS && sh svnadd.sh" - -# VirtualBox Aliases -alias as-start='VBoxManage startvm "Arch Linux Server" --type headless' -alias as-stop='VBoxManage controlvm "Arch Linux Server" acpipowerbutton' - -alias x86_64-start='VBoxManage startvm "Agilia x86_64" --type headless' -alias x86_64-stop='VBoxManage controlvm "Agilia x86_64" acpipowerbutton' - -# QTile -alias qtcfg="nano ~/.config/qtile/config.py" - -# Games -alias regnum="/data/Programs/Regnum/rolauncher" -alias ut2004="aoss /data/Programs/UT2004/ut2004" - -#PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting -#source /home/pztrn/.rvm/scripts/rvm - -# Xilitra -alias xbs="/data/XILITRA/xbs/src/xbs.py" -alias deptracker="/data/XILITRA/xilitra-dev-tools/deptracker/deptracker" -alias xpkg="/data/XILITRA/xpkg/src/xpkg.py" - # Other alias clocksync="sudo ntpdate 0.pool.ntp.org" alias got="git" - -# Blogs -alias crotal="/data/.pyenv/versions/2.7.6/bin/crotal" - -#alias yasearch="yaourt -Ss" -#alias yainstall="yaourt -S" -#alias yadel="yaourt -Rd" -#alias sysupdate="yaourt -Syua" -#alias flvgrab="ffmpeg -f alsa -f x11grab -r 30 -s 1920x1080 -i :0.0 -acodec pcm_s16le -vcodec flv -sameq" diff --git a/zsh/99-fbterm.zsh b/zsh/99-fbterm.zsh index 2403c13..86f394a 100644 --- a/zsh/99-fbterm.zsh +++ b/zsh/99-fbterm.zsh @@ -1,7 +1,18 @@ # Launch fbterm on TTY login -# But first some pre-checks. nVidia proprietary drivers will not allow -# us to use it, so we should disable this. +# We should not use it on any system except linux. +if [[ "${OS}" != "Linux" ]]; then + return +fi + +# We should skip this file if no fbterm is installed. +FBTERM=`whereis fmterm | cut -d ":" -f 2` +if [[ "${FBTERM/fbterm}" == "${FBTERM}" ]]; then + return +fi + +# nVidia proprietary drivers will not allow us to use it, so we +# should disable this. NVIDIA_POWERED=0 lsmod | grep nvidia &> /dev/null diff --git a/zsh/prompts/pztrn.zsh-theme b/zsh/prompts/pztrn.zsh similarity index 98% rename from zsh/prompts/pztrn.zsh-theme rename to zsh/prompts/pztrn.zsh index e454647..bc24384 100644 --- a/zsh/prompts/pztrn.zsh-theme +++ b/zsh/prompts/pztrn.zsh @@ -39,7 +39,7 @@ prompt_pztrn_setup () { [[ -n "$WINDOW" ]] && p_win="$WINDOW" - if [[ $USER == "root" ]]; then + if [[ "$USER" == "root" ]]; then vars['usercolor']="%{$fg[red]%}" else vars['usercolor']="%{$fg[blue]%}" diff --git a/zshrc b/zshrc index 1889873..778f08c 100644 --- a/zshrc +++ b/zshrc @@ -16,7 +16,7 @@ PROMPT_THEME="pztrn" # FBTerm - should we use it? # nVidia users with proprietary drivers - sorry, you can't use it. -USE_FBTERM=1 +USE_FBTERM=0 ##################################################################### # INITIALIZATION