forked from mywhat/DDESwitchCard
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete CheckLocale.sh, use QLocale to get system locale; Rebuild SwitchGraphicsCardWidget.cpp and .h, adopt uniform design style as system plugins like "poweroff" "notification", avoid display issues.
- Loading branch information
Showing
18 changed files
with
211 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,90 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
cd $PWD | ||
|
||
# 获取系统语言环境 | Get system locale | ||
LANG=$(locale | grep LANGUAGE | cut -d "=" -f 2 | cut -d "_" -f 1) | ||
LANG=$(locale | grep LANGUAGE | cut -d '=' -f 2 | cut -d '_' -f 1) | ||
if [ "$LANG" != "zh" ] ; then | ||
LANG="en" | ||
fi | ||
|
||
readonly TIP1_zh="开始编译......." | ||
readonly TIP1_en="Compiling..." | ||
readonly TIP2_zh="编译完成" | ||
readonly TIP2_en="Complete" | ||
readonly TIP3_zh="构建软件包..." | ||
readonly TIP2_en="Compilation Complete" | ||
readonly TIP3_zh="构建软件包......" | ||
readonly TIP3_en="Building deb..." | ||
readonly TIP4_zh="----------包信息----------" | ||
readonly TIP4_en="---------Control---------" | ||
readonly TIP5_zh="构建完成,软件包位于当前目录" | ||
readonly TIP5_en="Complete. See deb in current dir." | ||
readonly TIP6_zh="清除文件..." | ||
readonly TIP5_en="Complete. See deb in current dir" | ||
readonly TIP6_zh="清除文件......" | ||
readonly TIP6_en="Deleting temp files..." | ||
readonly TIP7_zh="按任意键退出......" | ||
readonly TIP7_en="Press any key to exit..." | ||
|
||
eval "TIP1=\$TIP1_${LANG}" | ||
eval "TIP2=\$TIP2_${LANG}" | ||
eval "TIP3=\$TIP3_${LANG}" | ||
eval "TIP4=\$TIP4_${LANG}" | ||
eval "TIP5=\$TIP5_${LANG}" | ||
eval "TIP6=\$TIP6_${LANG}" | ||
eval "TIP7=\$TIP7_${LANG}" | ||
|
||
# 编译 | ||
echo "$TIP1" | ||
echo -e | ||
|
||
mkdir -p build && cd build | ||
cmake ../src | ||
make | ||
make -j4 | ||
cd .. | ||
|
||
echo -e | ||
echo "$TIP2" | ||
echo -e | ||
|
||
# 打包 | ||
echo "$TIP3" | ||
echo -e | ||
|
||
mkdir -p ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/bin/ | ||
mkdir -p ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/plugins/ | ||
mkdir -p ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/share/icons/ | ||
mkdir -p ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/share/oem-menuextensions/ | ||
mkdir -p ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/share/pkexec/ | ||
|
||
chmod 644 ./build/libswitch_graphics_card.so | ||
cp ./build/libswitch_graphics_card.so ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/plugins | ||
cp ./scripts/* ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/bin/ | ||
cp ./icons/* ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/share/icons/ | ||
cp ./oem-menuextensions/* ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/share/oem-menuextensions/ | ||
cp ./pkexec/* ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/share/pkexec/ | ||
|
||
find ./deb_uos/opt -type f -print0 | xargs -0 md5sum > ./deb_uos/DEBIAN/md5sums && sed -i "s#./deb_uos/opt#/opt#" ./deb_uos/DEBIAN/md5sums | ||
|
||
echo "$TIP4" | ||
echo -e | ||
|
||
cat ./deb_uos/DEBIAN/control | ||
|
||
echo -e | ||
echo "-------------------------" | ||
echo -e | ||
|
||
version=$(cat ./deb_uos/DEBIAN/control | grep "Version" | awk -F ' ' '{print $2}') | ||
|
||
fakeroot dpkg -b ./deb_uos ./dde-dock-graphics-plugin_"$version"_amd64.deb | ||
|
||
echo "$TIP5" | ||
echo -e | ||
|
||
# 清除模板中的文件 | ||
echo "$TIP6" | ||
echo -e | ||
|
||
rm -rf ./deb_uos/DEBIAN/md5sums | ||
rm -rf ./deb_uos/opt/apps/dde-dock-graphics-plugin/files/* | ||
|
||
# rm -rf ./build | ||
|
||
echo "$TIP7" | ||
read |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Package: dde-dock-graphics-plugin | ||
Version: 1.7.1 | ||
Version: 1.8 | ||
Maintainer: zty199 <[email protected]> | ||
Section: utils | ||
Source: https://github.com/mywhat/DDESwitchCard | ||
Homepage: https://github.com/zty199/dde-dock-switch_graphics_card | ||
Homepage: https://gitee.com/deepin-opensource/switch-graphics-card | ||
Architecture: amd64 | ||
Priority: optional | ||
Depends: mesa-utils, zenity | ||
Depends: mesa-utils, zenity, libnotify4 | ||
Conflicts: switch-graphics-card (<= 1.5) | ||
Replaces: switch-graphics-card (<= 1.5) | ||
Description: A simple dde-dock plugin for graphics card switch. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<RCC> | ||
<qresource prefix="/icons"> | ||
<file>icons/Intel_light.svg</file> | ||
<file>icons/NVIDIA_dark.svg</file> | ||
<file>icons/NVIDIA_light.svg</file> | ||
<file>icons/Intel_dark.svg</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.