diff options
author | pks <pks@pks.rocks> | 2021-02-23 11:39:48 +0100 |
---|---|---|
committer | pks <pks@pks.rocks> | 2021-02-23 11:39:48 +0100 |
commit | 04c04517e564303250f50cf8ec69088f640d5fab (patch) | |
tree | 004b17388e72188b3e2b7cd0f29d3246254bcab4 | |
parent | 27d7810aebfe6c9ee2ec654ed438ac75a2f3e835 (diff) |
zsh: improvements
-rw-r--r-- | zsh/.zshrc | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -41,6 +41,8 @@ if [[ $? != 0 ]]; then _HOSTNAME=$HOST # $HOST is set by zsh fi +_USERNAME=$(whoami) + # ############################################################################# # ssh-agent # ############################################################################# @@ -57,7 +59,7 @@ function start_agent { } -if [[ $(whoami) != "root" ]]; then +if [[ $_USERNAME != "root" ]]; then if [ -f "${SSH_ENV}" ]; then . "${SSH_ENV}" > /dev/null ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { @@ -159,7 +161,7 @@ zstyle ':prompt:rtab' nameddirs yes # exports # ############################################################################# -if [[ $(whoami) == "root" ]]; then +if [[ $_USERNAME == "root" ]]; then umask 0022 else umask 0077 @@ -214,7 +216,7 @@ export CCACHE_PATH=/usr/bin case $_HOST_TYPE in Linux) - case `whoami` in + case $_USERNAME in root) export PATH=/home/pks/.local/bin:$PATH ;; @@ -287,7 +289,7 @@ chpwd zstyle ':prompt:rtab' fish yes zstyle ':prompt:rtab' nameddirs yes -case `whoami` in +case $_USERNAME in root) PROMPT="%{$bg[red]%}%{$fg[black]%}%m:%1v#%{$reset_color%} " ;; @@ -364,8 +366,7 @@ if [[ $_HOST_TYPE == "Linux" ]]; then ;; esac alias vgaext='xrandr --output VGA1 --mode 1024x768 --left-of LVDS1 --rotate right' - alias vga21='xrandr --output VGA1 --mode 1600x1200 --rate 60 --rotate right && xrandr --output LVDS1 --off' - alias vga22w='xrandr --output VGA1 --mode 1680x1050 --rate 60 --rotate left && xrandr --output LVDS1 --off' + alias vga21='xrandr --output VGA1 --mode 1600x1200 --rate 60 --rotate left && xrandr --output LVDS1 --off' alias reboot='sudo shutdown -r now' alias halt='sudo shutdown -h now' alias lp2p='/usr/bin/lp -o sides=two-sided-long-edge' |