aboutsummaryrefslogtreecommitdiff
path: root/config/zsh
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-11-15 18:52:09 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-11-15 18:52:09 +0100
commit4fe8f0bcef339aa9770819b431b67b2e063c83b4 (patch)
treead0a3529875bb2c2bb0e961e0c3688bb9d502bd6 /config/zsh
parent095400f236f7949b336d53a1310e444a892a6afb (diff)
parent125bcca5e7ed1b4527083bc2bcbdf66aa166d341 (diff)
downloaddotfiles-4fe8f0bcef339aa9770819b431b67b2e063c83b4.tar.gz
dotfiles-4fe8f0bcef339aa9770819b431b67b2e063c83b4.tar.bz2
dotfiles-4fe8f0bcef339aa9770819b431b67b2e063c83b4.zip
Merge branch 'master' of cacharle.xyz:/srv/git/dotfiles
Diffstat (limited to 'config/zsh')
-rw-r--r--config/zsh/.zshrc7
-rw-r--r--config/zsh/aliases.zsh7
-rwxr-xr-xconfig/zsh/zprofile20
3 files changed, 26 insertions, 8 deletions
diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc
index 77ee41e..92c55c5 100644
--- a/config/zsh/.zshrc
+++ b/config/zsh/.zshrc
@@ -62,7 +62,7 @@ chpwd() {
content="$(find . -maxdepth 1 | wc -l)"
([ "$content" -lt 20 ] && ls -l) ||
echo "$(pwd) contains $content entries"
- [ "$(stat -c "%U" .)" = "$USER" ] && touch . # to sort by last cd
+ [ "$(uname)" = 'Linux' ] && [ "$(stat -c "%U" .)" = "$USER" ] && touch . # to sort by last cd
}
# https://wiki.archlinux.org/title/Zsh#Shortcut_to_exit_shell_on_partial_command_line
@@ -92,4 +92,7 @@ export YSU_MESSAGE_POSITION="after" # you-should
# install pkgfile package on Arch Linux
# run `pkgfile --update`
-. /usr/share/doc/pkgfile/command-not-found.zsh
+if [ "$(uname)" = 'Linux' ]
+then
+ . /usr/share/doc/pkgfile/command-not-found.zsh
+fi
diff --git a/config/zsh/aliases.zsh b/config/zsh/aliases.zsh
index b2ca0a9..7957167 100644
--- a/config/zsh/aliases.zsh
+++ b/config/zsh/aliases.zsh
@@ -21,7 +21,12 @@ alias doas='doas ' # same for doas
alias info='info --vi-keys'
# ls
-alias ls='ls --color=auto -Fh'
+if [ "$(uname)" = 'Linux' ]
+then
+ alias ls='ls --color=auto -Fh'
+else
+ alias ls='ls -G -Fh'
+fi
alias ll="ls -l"
alias la="ls -A"
alias lla="ls -Al"
diff --git a/config/zsh/zprofile b/config/zsh/zprofile
index 5d5f01b..1388cd9 100755
--- a/config/zsh/zprofile
+++ b/config/zsh/zprofile
@@ -1,15 +1,25 @@
#!/bin/zsh
-export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:$HOME/.local/bin"
+if [ "$(uname)" = 'Linux' ]
+then
+ export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:$HOME/.local/bin"
+ export TERM='st-256color'
+ export MAIL='me@cacharle.xyz'
+ export SUDO='doas'
+elif [ "$(uname)" = 'Darwin' ]
+then
+ export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+ export PATH="$PATH:$HOME/.brew/bin:$HOME/git/dotfiles/bin:$HOME/bin:/usr/local/anaconda3/bin"
+ export TERM='xterm-256color'
+ export MAIL='charles.cabergs@colruytgroup.com'
+ export SUDO='sudo'
+fi
# applications
export EDITOR='vim'
-export TERM='st-256color'
export TERMINAL='st'
-export MAIL='me@cacharle.xyz'
export BROWSER='qutebrowser'
export BROWSERCLI='w3m'
-export SUDO='doas'
# XDG all the things
export XDG_CONFIG_HOME="$HOME/.config"
@@ -68,7 +78,7 @@ export MINIKUBE_IN_STYLE=false # disable cringe minikube emojies
export CLOUT_SYNC_DIR="clout-sync/"
export CLOUT_SYNC_PATH="${XDG_DATA_HOME:-$HOME/.sync}/$CLOUT_SYNC_DIR"
-if [ "$(tty)" = '/dev/tty1' ]
+if [ "$(uname)" = 'Linux' ] && [ "$(tty)" = '/dev/tty1' ]
then
startx "$XDG_CONFIG_HOME/x11/xinitrc"
poweroff