From 8ed98997287b6a197ad7b97a013cb2b49ef9682b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 26 Dec 2012 14:40:51 +0100 Subject: zshrc: only set up suffix aliases if X11 is running --- etc/.zshrc | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/etc/.zshrc b/etc/.zshrc index 49804d4..daafafa 100644 --- a/etc/.zshrc +++ b/etc/.zshrc @@ -243,26 +243,6 @@ bindkey -e # }}} # {{{ Aliases -# {{{ Suffix - -typeset -A alias_apps -alias_apps=( - archive extract - audio mplayer - document okular - image feh - video mplayer -) - -for meta in ${parameters[(I)mime_*]#mime_}; { - for format in $(eval echo '$'mime_${meta}); { - alias -s ${format}=${alias_apps[$meta]} - } -} - -unset filetypes meta format alias_apps - -# }}} # {{{ Defaults # To evade these defaults, use '=command' instead of 'command' @@ -511,6 +491,27 @@ done fi #}}} if [[ -e /tmp/.x-started ]] { #{{{ + # {{{ Suffix + + typeset -A alias_apps + alias_apps=( + archive extract + audio mplayer + document okular + image feh + video mplayer + ) + + for meta in ${parameters[(I)mime_*]#mime_}; { + for format in $(eval echo '$'mime_${meta}); { + alias -s ${format}=${alias_apps[$meta]} + } + } + + unset filetypes meta format alias_apps + + # }}} + alias 4d=4chan-dl alias 4v=4chan-view -- cgit v1.2.3