From 9598e8ba094194bbebea6438eaf64b57da9730fb Mon Sep 17 00:00:00 2001 From: the_4n0nym0u53 Date: Sun, 23 Jan 2022 19:04:32 +0100 Subject: [PATCH] Optimize Zsh config for Termux --- zsh/.config/zsh/.zlogout | 2 +- zsh/.config/zsh/.zprofile | 2 +- zsh/.config/zsh/aliases.zsh | 25 ++++++++++++++++--------- zsh/.config/zsh/gpg.zsh | 11 ++++++----- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/zsh/.config/zsh/.zlogout b/zsh/.config/zsh/.zlogout index 7b3f923..1eb0adf 100644 --- a/zsh/.config/zsh/.zlogout +++ b/zsh/.config/zsh/.zlogout @@ -8,6 +8,6 @@ function kill_services { pkill "^pipewire$" } -[[ $(tty) == "/dev/tty1" ]] && [[ $(lsb_release -si) == "Artix" ]] && +[[ $(uname -o) != "Android" ]] && [[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]] && kill_services >/dev/null unfunction kill_services diff --git a/zsh/.config/zsh/.zprofile b/zsh/.config/zsh/.zprofile index c3f5761..b5ed071 100644 --- a/zsh/.config/zsh/.zprofile +++ b/zsh/.config/zsh/.zprofile @@ -1,4 +1,4 @@ -if [[ $(tty) == "/dev/tty1" ]] && [[ $(lsb_release -si) == "Artix" ]]; then +if [[ $(uname -o) != "Android" ]] && [[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]]; then export $(gnome-keyring-daemon --start) export XDG_CURRENT_DESKTOP="Unity" export GTK_USE_PORTAL=1 diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh index 800089c..93504e9 100644 --- a/zsh/.config/zsh/aliases.zsh +++ b/zsh/.config/zsh/aliases.zsh @@ -2,25 +2,32 @@ alias btctl="bluetoothctl" alias cl="clear" alias cp="cp -i" -alias exa="exa -aFghl --color=always --git --icons" alias grep="grep --color=always" -alias l="lsd -hlA --color=always" -alias la="lsd -hl --color=always" -alias ll="lsd -hlaF --color=always" alias ls="ls --color=always" alias mkdir="mkdir -p" alias mv="mv -i" alias q="exit" alias rm="rm -i" alias srm="srm -i" +alias t="exa --tree -I '.git'" alias tmux="tmux -2u" -alias tree="exa --tree -I '.git'" alias u="update.sh" alias wl-copy="wl-copy -n" alias zgrep="zgrep --color=always" -if [[ $(lsb_release -si) == "Artix" ]]; then - alias code="codium --enable-features=UseOzonePlatform --ozone-platform=wayland" - alias poweroff="doas poweroff" - alias reboot="doas reboot" +if [[ $(uname -o) == "Android" ]]; then + alias l="exa -aFhl --color=always --git --icons" + alias la="exa -Fhl --color=always --git --icons" + alias ll="exa -aaFghl --color=always --git --icons" +else + alias exa="exa -aFhl --color=always --git --icons" + alias l="lsd -hlA --color=always" + alias la="lsd -hl --color=always" + alias ll="lsd -hlaF --color=always" + + if [[ $(lsb_release -si) == "Artix" ]]; then + alias code="codium --enable-features=UseOzonePlatform --ozone-platform=wayland" + alias poweroff="doas poweroff" + alias reboot="doas reboot" + fi fi diff --git a/zsh/.config/zsh/gpg.zsh b/zsh/.config/zsh/gpg.zsh index 22b27a4..2178374 100644 --- a/zsh/.config/zsh/gpg.zsh +++ b/zsh/.config/zsh/gpg.zsh @@ -1,5 +1,6 @@ -# Configuration for gpg-agent, used with YubiKey and ssh -export GPG_TTY=$TTY -export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) -gpgconf --launch gpg-agent -gpg-connect-agent updatestartuptty /bye &>/dev/null +if [[ $(uname -o) != "Android" ]]; then + export GPG_TTY=$TTY + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + gpgconf --launch gpg-agent + gpg-connect-agent updatestartuptty /bye &>/dev/null +fi