summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2009-03-10 11:55:08 +0100
committerHugues Hiegel <hugues@hiegel.fr>2009-06-04 23:35:36 +0200
commit595765301aae9c7dafa01aa3d89b654968cb2380 (patch)
treead96699a5a0a2178f8badde09077e6e60da4d26d
parent0016ab05ecd2959c3a69d42d34ada53c13a18d96 (diff)
[ZSHRC] OS-specific config
-rw-r--r--zshrc13
1 files changed, 12 insertions, 1 deletions
diff --git a/zshrc b/zshrc
index 01700cb..657a810 100644
--- a/zshrc
+++ b/zshrc
@@ -14,6 +14,7 @@
#
# If you want to make user, host or network specific configurations,
# add your specific scripts to the folders
+# - "sys:$(uname -s)" for OS-specific conf,
# - "user:$(whoami)" for user-specific conf,
# - "host:$(hostname -s)" for host-specific conf,
# - "net:$(domainname)" for network-specific conf,
@@ -28,6 +29,7 @@ mkdir -p $ZDOTDIR
# Useful environment variables which may be used
# at any time - We compute them now to avoid calling
# the required processes each time we'll need.
+OSNAME=`uname -s`
USER=${USER:-`whoami`}
UID=${UID:-`id -u`}
HOST=$HOST:r
@@ -49,15 +51,24 @@ if [ -d $ZDOTDIR ]; then
for i in "net:$DOMAIN"\
"host:$HOST"\
+ "sys:$OSNAME"\
"user:$USER"\
"user:$SUDO_USER"\
"net:$DOMAIN/host:$HOST"\
+ "net:$DOMAIN/sys:$OSNAME"\
"net:$DOMAIN/user:$USER"\
"net:$DOMAIN/user:$SUDO_USER"\
+ "net:$DOMAIN/host:$HOST/sys:$OSNAME"\
"net:$DOMAIN/host:$HOST/user:$USER"\
"net:$DOMAIN/host:$HOST/user:$SUDO_USER"\
+ "net:$DOMAIN/host:$HOST/sys:$OSNAME"\
+ "net:$DOMAIN/host:$HOST/sys:$OSNAME/user:$USER"\
+ "net:$DOMAIN/host:$HOST/sys:$OSNAME/user:$SUDO_USER"\
+ "host:$HOST/sys:$OSNAME"\
"host:$HOST/user:$USER"\
- "host:$HOST/user:$SUDO_USER"
+ "host:$HOST/user:$SUDO_USER"\
+ "host:$HOST/sys:$OSNAME/user:$USER"\
+ "host:$HOST/sys:$OSNAME/user:$SUDO_USER"
do
specific_script=${script:h}/$i/${${script:t}/??_/}
if test -f $specific_script