zsh/rc.os/Debian.zsh

66 lines
2.4 KiB
Bash

# vim: set syntax=zsh:
# Completion for apache 2 Debian tools
apache2_comp () {
typeset mods_available mods_enabled sites_available sites_enabled
mods_available=(/etc/apache2/mods-available/*)
sites_available=(/etc/apache2/sites-available/*)
mods_enabled=(/etc/apache2/mods-enabled/*)
sites_enabled=(/etc/apache2/sites-enabled/*)
# unicity, do a basename, and remove extension
mods_available=${(u)mods_available:t:r}
mods_enabled=${(u)mods_enabled:t:r}
sites_available=${(u)sites_available:t}
sites_enabled=${(u)sites_enabled:t}
compdef "_wanted site expl 'Apache 2 site' compadd $sites_available" a2ensite
compdef "_wanted site expl 'Apache 2 site' compadd $sites_enabled" a2dissite
compdef "_wanted mod expl 'Apache 2 module' compadd $mods_available" a2enmod
compdef "_wanted mod expl 'Apache 2 module' compadd $mods_enabled" a2dismod
}
[ -d /etc/apache2/sites-enabled ] &&
[ -d /etc/apache2/mods-enabled ] &&
apache2_comp
# Add name of (Debian) SCHROOT if exists
if [ -r /etc/debian_chroot ] ; then
chrootname=${$(< /etc/debian_chroot)//-*}
host="%{$fg[$user_color]%}%n:${chrootname}%{$reset_color%}~%{$fg[$host_color]%}%m"
else
host="%{$fg[$user_color]%}%n%{$reset_color%}~%{$fg[$host_color]%}%m"
fi
open_new_tab () {
if [[ -x `which guake` ]]; then
guake --new-tab=DUMB --rename-tab=$2 --execute-command=" command $* && logout; read; logout"
elif [[ -x `which yakuake` ]]; then
if [ "`qdbus org.kde.yakuake /yakuake/MainWindow_1 org.freedesktop.DBus.Properties.Get com.trolltech.Qt.QWidget visible`" = "false" ];then
qdbus org.kde.yakuake /yakuake/window toggleWindowState
fi
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession>/dev/null
qdbus org.kde.yakuake /yakuake/tabs org.kde.yakuake.setTabTitle "`qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.activeSessionId`" "$2">/dev/null
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.runCommand " command $* && exit; read; exit">/dev/null
else
command $*
fi
}
if [ "x$SSH_CLIENT" = "x" ]; then
USE_XTABS=True
fi
if [ -x "$(which -p vim)" ]; then
export EDITOR=vim
export VISUAL=vim
fi
alias vnc='xtigervncviewer -FullScreenAllMonitors=0 -FullScreen'
alias rdp='xfreerdp --cert-ignore --size 1900x1000 -u '$USER' -v'