Skip to content

Commit

Permalink
Fix Bugs
Browse files Browse the repository at this point in the history
Update relevant shell scripts.
  • Loading branch information
张天怿 authored and 张天怿 committed Aug 15, 2020
1 parent 3335e5a commit aa5343f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=https://" | 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=https://" | 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
Expand Down
2 changes: 1 addition & 1 deletion Intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions NVIDIA.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa5343f

Please sign in to comment.