From 0cd17de71cdb15c6c3039380605d23d0ccd38d3e Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Fri, 3 Mar 2023 19:38:34 +0100 Subject: [PATCH] Use /etc/os-release instead of lsb_release --- install.sh | 8 ++++---- scripts/.local/bin/update.sh | 4 ++-- zsh/.config/zsh/.zlogout | 2 +- zsh/.config/zsh/.zprofile | 2 +- zsh/.config/zsh/aliases.zsh | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index ad51a60..eada83c 100755 --- a/install.sh +++ b/install.sh @@ -8,12 +8,12 @@ command -v stow >/dev/null 2>&1 || { echo "Please install GNU Stow!"; exit 1; } sleep 0.5 echo "=> Determining OS..." -if [ "$(lsb_release -si)" = "Fedora" ]; then - set -- "alacritty" "nvim" "scripts" "zsh" - INSTALL="pkg install" -elif [ "$(lsb_release -si)" = "Artix" ]; then +if [ "$(. /etc/os-release && echo $ID)" = "artix" ]; then set -- "alacritty" "git" "mako" "nvim" "scripts" "sway" "swaylock" "swaynag" "waybar" "zsh" INSTALL="sudo pacman -S" +elif [ "$(. /etc/os-release && echo $ID)" = "fedora" ]; then + set -- "alacritty" "nvim" "scripts" "zsh" + INSTALL="sudo dnf install" else echo "OS not supported!" exit 1 diff --git a/scripts/.local/bin/update.sh b/scripts/.local/bin/update.sh index 2f62d01..4d1c8b5 100755 --- a/scripts/.local/bin/update.sh +++ b/scripts/.local/bin/update.sh @@ -1,7 +1,7 @@ #!/usr/bin/env dash -[ "$(lsb_release -si)" = "Artix" ] && { paru -Syu; echo; } -[ "$(lsb_release -si)" = "Fedora" ] && { sudo dnf --refresh upgrade; echo; } +[ "$(. /etc/os-release && echo $ID)" = "artix" ] && { paru -Syu; echo; } +[ "$(. /etc/os-release && echo $ID)" = "fedora" ] && { sudo dnf --refresh upgrade; echo; } command -v flatpak >/dev/null 2>&1 && { flatpak update; echo; } diff --git a/zsh/.config/zsh/.zlogout b/zsh/.config/zsh/.zlogout index 6a5bcd8..65f8f8c 100644 --- a/zsh/.config/zsh/.zlogout +++ b/zsh/.config/zsh/.zlogout @@ -5,6 +5,6 @@ kill_services() { pkill "^pipewire$" } -[[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]] && +[[ $(. /etc/os-release && echo $ID) == "artix" ]] && [[ $(tty) == "/dev/tty1" ]] && kill_services >/dev/null unfunction kill_services diff --git a/zsh/.config/zsh/.zprofile b/zsh/.config/zsh/.zprofile index 05b140f..6030b5b 100644 --- a/zsh/.config/zsh/.zprofile +++ b/zsh/.config/zsh/.zprofile @@ -1,4 +1,4 @@ -if [[ $(lsb_release -si) == "Artix" ]] && [[ $(tty) == "/dev/tty1" ]]; then +if [[ $(. /etc/os-release && echo $ID) == "artix" ]] && [[ $(tty) == "/dev/tty1" ]]; then export XDG_CURRENT_DESKTOP="Unity" export GTK_USE_PORTAL=1 export QT_QPA_PLATFORM="wayland" diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh index a020d52..8ea1f54 100644 --- a/zsh/.config/zsh/aliases.zsh +++ b/zsh/.config/zsh/aliases.zsh @@ -61,7 +61,7 @@ alias q="exit 0" alias visudo="sudo EDITOR=\"rvim -nc 'set nobackup nowritebackup'\" visudo" # Platform specific -if [[ $(lsb_release -si) == "Artix" ]]; then +if [[ $(. /etc/os-release && echo $ID) == "artix" ]]; then alias code="codium --enable-features=UseOzonePlatform --ozone-platform=wayland" alias pacin="sudo pacman -S" alias pacls="pacman -Qkl" @@ -73,7 +73,7 @@ if [[ $(lsb_release -si) == "Artix" ]]; then alias pacss="pacman -Ss" alias poweroff="sudo poweroff" alias reboot="sudo reboot" -elif [[ $(lsb_release -si) == "Fedora" ]]; then +elif [[ $(. /etc/os-release && echo $ID) == "fedora" ]]; then alias code="codium" alias dnfin="sudo dnf install" alias dnfqi="rpm -qi"