From 5763d32ca312c2a8bac615abe7637eb3bb5b6101 Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Wed, 21 Feb 2024 00:45:07 +0300 Subject: [PATCH] Update modify-driver.sh --- data/modify-driver.sh | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/data/modify-driver.sh b/data/modify-driver.sh index ca442c5..59adcec 100755 --- a/data/modify-driver.sh +++ b/data/modify-driver.sh @@ -1,5 +1,64 @@ #! /bin/bash +WHO=$(whoami) +if [[ $WHO == "pikaos" ]]; then +if [[ -z $pkg ]] && [[ "$1" = "xone-dkms" ]] +then + pkg="xone-dkms xpadneo-dkms xpad-noone-dkms" +fi + +if [[ -z $pkg ]] && [[ "$1" = "vulkan-amdgpu-pro" ]] +then + pkg="vulkan-amdgpu-pro vulkan-amdgpu-pro:i386" +fi + +if [[ -z $pkg ]] && [[ "$1" = "amf-amdgpu-pro" ]] +then + pkg="amf-amdgpu-pro vulkan-amdgpu-pro vulkan-amdgpu-pro:i386" +fi + +if [[ -z $pkg ]] && [[ "$1" = "amdvlk" ]] +then + pkg="amdvlk amdvlk:i386" +fi + +if [[ -z $pkg ]] && [[ "$1" = "opencl-legacy-amdgpu-pro-icd" ]] +then + pkg="ocl-icd-libopencl1-amdgpu-pro ocl-icd-libopencl1-amdgpu-pro:i386 opencl-legacy-amdgpu-pro-icd opencl-legacy-amdgpu-pro-icd:i386" +fi + +if [[ -z $pkg ]] && [[ "$1" = "amdgpu-pro-oglp" ]] +then + pkg="amdgpu-pro-oglp amdgpu-pro-oglp:i386" +fi + +if [[ -z $pkg ]] +then + pkg="$1" +fi + +if dpkg -s "$1" +then + if echo $pkg | grep -i mesa + then + zenity --error --text "the following driver "$1" can not be removed only swapped" + else + echo "pikaos" | sudo -S bash -c "apt remove $pkg -y && sudo apt autoremove -y" + fi +else + if echo $pkg | grep -i nvidia + then + echo "pikaos" | sudo -S bash -c "apt update -y && apt purge nvidia-driver-* -y && apt install $pkg -y && sudo apt autoremove -y" + else + if echo $pkg | grep -i mesa-hybrid + then + echo "pikaos" | sudo -S bash -c "apt update -y && apt install mesa-stable -y && apt install mesa-hybrid -y && sudo apt autoremove -y" + else + echo "pikaos" | sudo -S bash -c "apt update -y && apt install $pkg -y && sudo apt autoremove -y" + fi + fi +fi +else if [[ -z $pkg ]] && [[ "$1" = "xone-dkms" ]] then pkg="xone-dkms xpadneo-dkms xpad-noone-dkms" @@ -56,3 +115,4 @@ else fi fi fi +fi