Optimize Zsh and scripts for Termux

This commit is contained in:
the_4n0nym0u53 2022-01-23 19:26:28 +01:00
parent 9598e8ba09
commit f3038f239a
No known key found for this signature in database
GPG key ID: 35EE09F5481049BB
6 changed files with 11 additions and 8 deletions

View file

@ -1,7 +1,11 @@
#!/bin/dash #!/bin/dash
if [ "$(uname -o)" = "Android" ]; then
pkg upgrade
elif [ "$(uname -o)" = "GNU/Linux" ]; then
[ "$(lsb_release -si)" = "Artix" ] && paru [ "$(lsb_release -si)" = "Artix" ] && paru
[ "$(lsb_release -si)" = "Fedora" ] && sudo dnf upgrade [ "$(lsb_release -si)" = "Fedora" ] && sudo dnf upgrade
fi
command -v flatpak >/dev/null 2>&1 && { echo; flatpak update; } command -v flatpak >/dev/null 2>&1 && { echo; flatpak update; }
command -v npm >/dev/null 2>&1 && { echo; npm up -g; } command -v npm >/dev/null 2>&1 && { echo; npm up -g; }

View file

@ -8,6 +8,6 @@ function kill_services {
pkill "^pipewire$" pkill "^pipewire$"
} }
[[ $(uname -o) != "Android" ]] && [[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]] && [[ $(uname -o) == "GNU/Linux" ]] && [[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]] &&
kill_services >/dev/null kill_services >/dev/null
unfunction kill_services unfunction kill_services

View file

@ -1,4 +1,4 @@
if [[ $(uname -o) != "Android" ]] && [[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]]; then if [[ $(uname -o) == "GNU/Linux" ]] && [[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]]; then
export $(gnome-keyring-daemon --start) export $(gnome-keyring-daemon --start)
export XDG_CURRENT_DESKTOP="Unity" export XDG_CURRENT_DESKTOP="Unity"
export GTK_USE_PORTAL=1 export GTK_USE_PORTAL=1

View file

@ -3,7 +3,7 @@ export PATH="$PATH:$HOME/.local/bin"
(( ${+commands[go]} )) && export PATH="$PATH:$(go env GOPATH)/bin" (( ${+commands[go]} )) && export PATH="$PATH:$(go env GOPATH)/bin"
# Essentials # Essentials
export LANG="en_DK.UTF-8" [[ $(uname -o) == "Android" ]] && export LANG="en_US.UTF-8" || export LANG="en_DK.UTF-8"
export PAGER="less" export PAGER="less"
export EDITOR="nano" export EDITOR="nano"
(( ${+commands[vim]} )) && export EDITOR="vim" (( ${+commands[vim]} )) && export EDITOR="vim"

View file

@ -1,4 +1,3 @@
# Common aliases
alias btctl="bluetoothctl" alias btctl="bluetoothctl"
alias cl="clear" alias cl="clear"
alias cp="cp -i" alias cp="cp -i"
@ -19,7 +18,7 @@ if [[ $(uname -o) == "Android" ]]; then
alias l="exa -aFhl --color=always --git --icons" alias l="exa -aFhl --color=always --git --icons"
alias la="exa -Fhl --color=always --git --icons" alias la="exa -Fhl --color=always --git --icons"
alias ll="exa -aaFghl --color=always --git --icons" alias ll="exa -aaFghl --color=always --git --icons"
else elif [[ $(uname -o) == "GNU/Linux" ]]; then
alias exa="exa -aFhl --color=always --git --icons" alias exa="exa -aFhl --color=always --git --icons"
alias l="lsd -hlA --color=always" alias l="lsd -hlA --color=always"
alias la="lsd -hl --color=always" alias la="lsd -hl --color=always"

View file

@ -1,4 +1,4 @@
if [[ $(uname -o) != "Android" ]]; then if [[ $(uname -o) == "GNU/Linux" ]]; then
export GPG_TTY=$TTY export GPG_TTY=$TTY
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent gpgconf --launch gpg-agent