Even even faster

This commit is contained in:
Sam A. 2022-09-18 22:13:36 +02:00
parent b96a0a0358
commit a406bb543c
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
6 changed files with 26 additions and 28 deletions

View file

@ -8,6 +8,6 @@ kill_services() {
pkill "^pipewire$"
}
[[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]] \
&& kill_services >/dev/null
[[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]] &&
kill_services >/dev/null
unfunction kill_services

View file

@ -3,9 +3,9 @@ export PATH="$HOME/.local/bin:$PATH"
(( ${+commands[go]} )) && export PATH="$(go env GOPATH)/bin:$PATH"
# Essentials
[[ $(lsb_release -si) != "Debian" ]] && [[ $(lsb_release -si) != "Ubuntu" ]] \
&& export LANG="en_DK.UTF-8" \
|| { export LANG="en_US.UTF-8"; export TERM="xterm-256color"; }
[[ $(lsb_release -si) =~ "^Debian|Ubuntu$" ]] &&
export LANG="en_DK.UTF-8" ||
{ export LANG="en_US.UTF-8"; export TERM="xterm-256color"; }
export PAGER="less"
export EDITOR="nano"
(( ${+commands[vim]} )) && export EDITOR="vim"

View file

@ -17,7 +17,8 @@ static_file="$ZDOTDIR/.zsh_plugins.zsh"
# Clone antidote if necessary and generate a static plugin file
if [[ ! $static_file -nt $plugins_txt ]]; then
[[ -e $antidote_dir ]] || git clone --depth=1 https://github.com/mattmc3/antidote.git $antidote_dir
[[ -e $antidote_dir ]] ||
git clone --depth=1 https://github.com/mattmc3/antidote.git $antidote_dir
(
source $antidote_dir/antidote.zsh
antidote bundle <$plugins_txt >$static_file

View file

@ -37,10 +37,10 @@ alias unlock="udisksctl unlock -b"
alias unmount="udisksctl unmount -b"
# Misc.
(( ${+commands[tmux]} )) \
&& alias tmux="tmux -2u"
(( ${+commands[dotnet]} )) \
&& alias dnup="dotnet tool list --global | tail -n +3 | awk '{print \$1}' | xargs -l dotnet tool update --global"
(( ${+commands[tmux]} )) &&
alias tmux="tmux -2u"
(( ${+commands[dotnet]} )) &&
alias dnup="dotnet tool list --global | tail -n +3 | awk '{print \$1}' | xargs -l dotnet tool update --global"
alias cl="clear"
alias -g e="\$EDITOR"
alias grep="grep --color=always"
@ -69,7 +69,7 @@ elif [[ $(lsb_release -si) == "Fedora" ]]; then
alias dnfrm="sudo dnf remove"
alias dnfsi="sudo dnf info"
alias dnfss="sudo dnf search"
elif [[ $(lsb_release -si) == "Debian" ]] || [[ $(lsb_release -si) == "Ubuntu" ]]; then
elif [[ $(lsb_release -si) =~ "^Debian|Ubuntu$" ]]; then
alias aptin="sudo apt install"
alias aptqi="dpkg -s"
alias aptqs="dpkg -l"

View file

@ -2,13 +2,13 @@ bt() {
(( ${+commands[bluetoothctl]} )) || return 2
if [[ $1 == on ]]; then
(( ${+commands[connmanctl]} )) \
&& connmanctl enable bluetooth \
|| bluetoothctl power on
(( ${+commands[connmanctl]} )) &&
connmanctl enable bluetooth ||
bluetoothctl power on
elif [[ $1 == off ]]; then
(( ${+commands[connmanctl]} )) \
&& connmanctl disable bluetooth \
|| bluetoothctl power off
(( ${+commands[connmanctl]} )) &&
connmanctl disable bluetooth ||
bluetoothctl power off
else
bluetoothctl "$@"
fi
@ -19,13 +19,12 @@ doasedit() {
[[ $# -eq 0 ]] || return 1
doas -L
doas -u root sh -c \
"cp /etc/doas.conf /tmp/doas.conf \
&& rvim -n /tmp/doas.conf \
&& doas -C /tmp/doas.conf \
&& mv /tmp/doas.conf /etc/doas.conf \
&& echo 'ok' \
|| echo >&2 'error'"
doas -u root sh -c "cp /etc/doas.conf /tmp/doas.conf &&
rvim -n /tmp/doas.conf &&
doas -C /tmp/doas.conf &&
mv /tmp/doas.conf /etc/doas.conf &&
echo 'ok' ||
echo >&2 'error'"
local STATUS=$?
doas -L
@ -36,9 +35,7 @@ get_ip() {
(( ${+commands[curl]} )) || return 2
while [[ $# -gt 0 ]]; do
[[ $1 == --ip ]] \
&& local IP="?ip=$2" && shift \
|| local ARGS+=("$1")
[[ $1 == --ip ]] && local IP="?ip=$2" && shift || local ARGS+=("$1")
shift
done

View file

@ -1,4 +1,4 @@
if [[ $(lsb_release -si) != "Debian" ]] && [[ $(lsb_release -si) != "Ubuntu" ]]; then
if [[ $(lsb_release -si) =~ "^Debian|Ubuntu$" ]]; then
export GPG_TTY="$TTY"
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
gpgconf --launch gpg-agent