Use /etc/os-release instead of lsb_release

This commit is contained in:
Sam A. 2023-03-03 19:38:34 +01:00
parent 31220d31e6
commit 0cd17de71c
Signed by: samsapti
GPG Key ID: CBBBE7371E81C4EA
5 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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; }

View File

@ -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

View File

@ -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"

View File

@ -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"