From 46ee3f8206cf14f1b3abe3eeaf881b290156168a Mon Sep 17 00:00:00 2001 From: the_4n0nym0u53 Date: Sat, 5 Feb 2022 16:06:53 +0100 Subject: [PATCH] Zsh: Add Debian compatibility --- README.md | 2 +- ubuntu-install.sh => deb-install.sh | 4 ++-- zsh/.config/zsh/.zshenv | 7 +++++-- zsh/.config/zsh/aliases.zsh | 4 ++-- zsh/.config/zsh/gpg.zsh | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) rename ubuntu-install.sh => deb-install.sh (79%) diff --git a/README.md b/README.md index b01f400..ce71a5b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ $ chmod +x artix-install.sh $ ./artix-install.sh # For Artix $ ./fedora-install.sh # For Fedora $ ./termux-install.sh # For Termux -$ ./ubuntu-install.sh # For Ubuntu +$ ./deb-install.sh # For Debian and Ubuntu ``` Note that I use `doas` instead of `sudo` (only on Artix). If you prefer `sudo`, then change all instances of `doas` to `sudo`, or simply create a symlink `doas` pointing to `sudo`: diff --git a/ubuntu-install.sh b/deb-install.sh similarity index 79% rename from ubuntu-install.sh rename to deb-install.sh index 4af69a1..65c166f 100755 --- a/ubuntu-install.sh +++ b/deb-install.sh @@ -1,7 +1,7 @@ #!/bin/sh -if [ "$(lsb_release -si)" != "Ubuntu" ]; then - echo "This script is only intended to be used for a full setup on Ubuntu. Quitting..." +if [ "$(lsb_release -si)" != "Debian" ] && [ "$(lsb_release -si)" != "Ubuntu" ]; then + echo "This script is only intended to be used for a full setup on Debian or Ubuntu. Quitting..." exit 1 fi diff --git a/zsh/.config/zsh/.zshenv b/zsh/.config/zsh/.zshenv index 73c8a70..1e63d0a 100644 --- a/zsh/.config/zsh/.zshenv +++ b/zsh/.config/zsh/.zshenv @@ -3,18 +3,21 @@ export PATH="$PATH:$HOME/.local/bin" (( ${+commands[go]} )) && export PATH="$PATH:$(go env GOPATH)/bin" # Essentials +[[ $(uname -o) == "GNU/Linux" ]] \ + && [[ $(lsb_release -si) != "Debian" ]] \ + && [[ $(lsb_release -si) != "Ubuntu" ]] \ + && export LANG="en_DK.UTF-8" \ + || export LANG="en_US.UTF-8" export PAGER="less" export EDITOR="nano" (( ${+commands[vim]} )) && export EDITOR="vim" (( ${+commands[nvim]} )) && export EDITOR="nvim" -[[ $(uname -o) != "Android" ]] && [[ $(lsb_release -si) != "Ubuntu" ]] && export LANG="en_DK.UTF-8" || export LANG="en_US.UTF-8" # Less export LESS="-R" export LESSHISTFILE="/dev/null" # Tmux -[[ $(uname -o) == "GNU/Linux" ]] && [[ $(lsb_release -si) == "Ubuntu" ]] && export TERM="xterm-256color" [[ -n $TMUX ]] && export TERM="xterm-256color" # Secret variables diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh index cb98dbe..1bdb4f0 100644 --- a/zsh/.config/zsh/aliases.zsh +++ b/zsh/.config/zsh/aliases.zsh @@ -56,7 +56,7 @@ elif [[ $(uname -o) == "GNU/Linux" ]]; then alias dnfqs="sudo dnf list installed" alias dnfsi="sudo dnf info" alias dnfss="sudo dnf search" - elif [[ $(lsb_release -si) == "Ubuntu" ]]; then + elif [[ $(lsb_release -si) == "Debian" ]] || [[ $(lsb_release -si) == "Ubuntu" ]]; then alias aptin="sudo apt install" alias aptrm="sudo apt purge" alias aptqi="dpkg -s" @@ -66,7 +66,7 @@ elif [[ $(uname -o) == "GNU/Linux" ]]; then fi # ls'ing - if [[ $(lsb_release -si) == "Ubuntu" ]]; then + if [[ $(lsb_release -si) == "Debian" ]] || [[ $(lsb_release -si) == "Ubuntu" ]]; then alias l="ls -Ahl" alias la="ls -hl" alias ll="ls -aFhl" diff --git a/zsh/.config/zsh/gpg.zsh b/zsh/.config/zsh/gpg.zsh index bff2e98..7ca8a74 100644 --- a/zsh/.config/zsh/gpg.zsh +++ b/zsh/.config/zsh/gpg.zsh @@ -1,4 +1,4 @@ -if [[ $(uname -o) == "GNU/Linux" ]] && [[ $(lsb_release -si) != "Ubuntu" ]]; then +if [[ $(uname -o) == "GNU/Linux" ]] && [[ $(lsb_release -si) != "Debian" ]] && [[ $(lsb_release -si) != "Ubuntu" ]]; then export GPG_TTY=$TTY export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) gpgconf --launch gpg-agent