Get rid of lsb-release dependency (#16)

У всех линуксов уже давно есть /etc/os-release, и можно на него опираться, упрощая жизнь и уменьшая количество зависимостей для конфига.

Reviewed-on: #16
Reviewed-by: Stanislav Nikitin <pztrn@pztrn.name>
Co-authored-by: Vladimir Hodakov <vladimir@hodakov.me>
Co-committed-by: Vladimir Hodakov <vladimir@hodakov.me>
This commit was merged in pull request #16.
This commit is contained in:
2026-06-19 16:12:01 +05:00
committed by Stanislav Nikitin
parent b9a618a514
commit f655fbf527
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -6,9 +6,9 @@ OS_RELEASE=`uname -r`
OS_ARCH=`uname -m`
# Distro detection.
LSBRELEASE=$(which lsb_release)
if [ $? -eq 0 ]; then
DISTRO=`lsb_release -i -s`
if [[ -f /etc/os-release ]]; then
. /etc/os-release
DISTRO=${ID}
else
# BSDs OS and macOS can be detected via uname.
DISTRO=${OS}
+3 -3
View File
@@ -1,10 +1,10 @@
AUTOSUGGESTIONS_PATH="/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
if [ "${DISTRO}" = "Arch" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "EnveavourOS" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "arch" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "endeavouros" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [[ "${DISTRO}" = "Darwin" && "${OS_ARCH}" == "arm64" ]]; then AUTOSUGGESTIONS_PATH="/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [[ "${DISTRO}" = "Darwin" && "${OS_ARCH}" == "x86_64" ]]; then AUTOSUGGESTIONS_PATH="/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "VoidLinux" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh/plugins/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "voidlinux" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh/plugins/zsh-autosuggestions.zsh"; fi
if [ -f "${AUTOSUGGESTIONS_PATH}" ]; then
source "${AUTOSUGGESTIONS_PATH}"