From aa5343fe95d6495123c02d83a3ac6e57185cb91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=A4=A9=E6=80=BF?= Date: Sat, 15 Aug 2020 13:27:04 +0800 Subject: [PATCH] Fix Bugs Update relevant shell scripts. --- Initialize.sh | 2 +- Intel.sh | 2 +- NVIDIA.sh | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Initialize.sh b/Initialize.sh index 5100f90..9d7d1c5 100755 --- a/Initialize.sh +++ b/Initialize.sh @@ -71,7 +71,7 @@ echo '#!/bin/sh file=$1 if [ "${file##*.}"x = "desktop"x ] then - __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia $(cat $file | grep "Exec=" | sed "s/^Exec=//" | sed 's/%.//' | sed 's/^"//g' | sed 's/" *$//g' | head -n 1) + __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia $(cat $file | grep "Exec=" | sed "s/^Exec=//" | sed "s/%.//" | sed "s/^\"//g" | sed "s/\" *$//g" | head -n 1) else __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia $file fi' | sudo tee /usr/bin/prime-run.bak > /dev/null diff --git a/Intel.sh b/Intel.sh index 757d07c..eb89ead 100755 --- a/Intel.sh +++ b/Intel.sh @@ -23,7 +23,7 @@ echo "即将切换至 Intel 显卡。在注销登录之前,请保存好当前 sh /opt/durapps/dde-dock-switch_graphics_card/bin/Initialize.sh # 启用 nvidia-prime -sudo mv /usr/bin/prime-run.bak /usr/bin/prime-run +sudo cp /usr/bin/prime-run.bak /usr/bin/prime-run # 修改 xorg.conf sudo cp /etc/X11/xorg.conf.bak /etc/X11/xorg.conf diff --git a/NVIDIA.sh b/NVIDIA.sh index 2efd83d..64f3d8e 100755 --- a/NVIDIA.sh +++ b/NVIDIA.sh @@ -22,6 +22,9 @@ echo '即将切换至 NVIDIA 显卡。在注销登录之前,请保存好当前 # 初始化 NVIDIA 相关配置文件 sh /opt/durapps/dde-dock-switch_graphics_card/bin/Initialize.sh +# 删除 nvidia-prime +sudo rm /usr/bin/prime-run + # 修改 xorg.conf sudo cp /etc/X11/xorg.conf.bak /etc/X11/xorg.conf sudo sed -i 's$Screen 0 "Screen0" 0 0$Screen 0 "DGPU" 0 0$g' /etc/X11/xorg.conf