Skip to content

Commit 403f6bd

Browse files
committed
Fix task bar icon bug in linux
1 parent d449417 commit 403f6bd

File tree

11 files changed

+155
-10
lines changed

11 files changed

+155
-10
lines changed

.github/workflows/android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
SOURCE_DIR: ${{github.workspace}}/.cache/source
3636
TOOLS_DIR: ${{github.workspace}}/.cache/tools
3737
INSTALL_DIR: ${{github.workspace}}/.cache/install
38-
VCPKGGITCOMMITID: 59aeb8fe8fe1c980de6bd5ba634cf21024522d81
38+
VCPKGGITCOMMITID: 4c5ae6b55f3e3e39d291679f89822f496cf190ee
3939
VCPKG_TARGET_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
4040
VCPKG_DEFAULT_HOST_TRIPLET: x64-linux
4141
ANDROID_ABI: ${{matrix.ANDROID_ABI}}

.github/workflows/appimage.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ jobs:
100100
export QMAKE=/usr/bin/qmake6
101101
${{github.workspace}}/Script/build_appimage.sh
102102
md5sum SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_Linux_`uname -m`.AppImage > SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_Linux_`uname -m`.AppImage.md5sum
103+
mkdir -p SetupSerialPortAssistantAppImage
104+
pushd SetupSerialPortAssistantAppImage
105+
cp ${{github.workspace}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_Linux_`uname -m`.AppImage .
106+
chmod a+rx SerialPortAssistant_`uname -m`.AppImage
107+
cp ${{github.workspace}}/build_appimage/AppDir/usr/share/applications/io.github.KangLin.SerialPortAssistant.desktop .
108+
cp ${{github.workspace}}/build_appimage/AppDir/usr/share/icons/hicolor/scalable/apps/io.github.KangLin.SerialPortAssistant.svg .
109+
cp ${{github.workspace}}/Script/install.sh .
110+
chmod a+rx install.sh
111+
popd
112+
7z a SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.zip SetupSerialPortAssistantAppImage
103113
104114
- name: core dump infomations
105115
if: false
@@ -166,8 +176,8 @@ jobs:
166176
./SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_Linux_$ARCH.AppImage \
167177
-f "${{github.workspace}}/update_appimage_${{matrix.qt_arch}}_qt${{matrix.qt_version}}.json" \
168178
--foc 1 \
169-
--file-name SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_Linux_$ARCH.AppImage \
170-
-u "https://github.com/KangLin/SerialPortAssistant/releases/download/${{env.SerialPortAssistant_VERSION}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_${ARCH}.AppImage;https://sourceforge.net/projects/SerialPortAssistant/${{env.SerialPortAssistant_VERSION}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_${ARCH}.AppImage?viasf=1" \
179+
--file-name ${{github.workspace}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.zip \
180+
-u "https://github.com/KangLin/SerialPortAssistant/releases/download/${{env.SerialPortAssistant_VERSION}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.zip;https://sourceforge.net/projects/SerialPortAssistant/${{env.SerialPortAssistant_VERSION}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.zip?viasf=1" \
171181
--md5 "${MD5SUM}" \
172182
-m "v${{env.SerialPortAssistant_VERSION}}"
173183
@@ -177,10 +187,11 @@ jobs:
177187
#fi
178188
179189
- name: Update artifact
180-
if: ${{ matrix.BUILD_TYPE == 'Release' }}
190+
if: ${{matrix.BUILD_TYPE == 'Release'}}
181191
uses: actions/upload-artifact@v4
182192
with:
183-
name: ${{ env.artifact_name }}_${{matrix.os}}
193+
name: ${{env.artifact_name}}_${{matrix.os}}
184194
path: |
185195
${{github.workspace}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_*.AppImage
196+
${{github.workspace}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}*.zip
186197
${{github.workspace}}/update_appimage_${{matrix.qt_arch}}_qt${{matrix.qt_version}}.json

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
uses: ./.github/workflows/msvc.yml
3131

3232
mingw:
33-
if: true
3433
uses: ./.github/workflows/mingw.yml
3534

3635
macos:
@@ -165,7 +164,7 @@ jobs:
165164
echo "|Windows 7 SP1 or later|[EXE](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_win64_msvc2022_64_qt6.9.2_Setup.exe)|[EXE](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_win32_msvc2019_qt5.15.2_Setup.exe)|[EXE](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_win64_msvc2022_arm64_qt6.9.2_Setup.exe) | ||" >> ${{github.workspace}}/Release.md
166165
echo "|Android|[APK](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_android_x86_64_qt6.9.2_Release.apk) | |[APK](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_android_arm64_v8a_qt6.9.2_Release.apk)| |Experiment|" >> ${{github.workspace}}/Release.md
167166
echo "|Macos|[App zip](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_macos-13.zip) [dmg](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_macos-13.dmg)||[App zip](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_macos-14.zip) [dmg](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_macos-14.dmg)||Experiment|" >> ${{github.workspace}}/Release.md
168-
echo "|Linux|[AppImage](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_Linux_x86_64.AppImage)| |[AppImage](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_Linux_aarch64.AppImage)| |sudo chmod u+x SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_Linux_x86_64.AppImage|" >> ${{github.workspace}}/Release.md
167+
echo "|Linux|[AppImage](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_ubuntu-24.04.zip)| |[AppImage](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_v${{env.SerialPortAssistant_VERSION}}_ubuntu-24.04_arm64.zip)| |unzip zip file. than run `install.sh` install desktop shotcuts, or run SerialPortAssistant_*.AppImage |" >> ${{github.workspace}}/Release.md
169168
echo "|Ubuntu 24.04|[DEB](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_ubuntu-24.04_amd64.deb)| |[DEB](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_ubuntu-24.04_arm64.deb)| |sudo apt install \"deb file\" |" >> ${{github.workspace}}/Release.md
170169
echo "|Ubuntu 22.04|| |[DEB](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_ubuntu-22.04_arm64.deb)| |sudo apt install \"deb file\" |" >> ${{github.workspace}}/Release.md
171170
echo "|Fedora 42|[RPM](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant-${{env.SerialPortAssistant_VERSION}}-1.fc42.x86_64.rpm)| |[RPM](https://github.com/KangLin/SerialPortAssistant/releases/download/${BRANCH_NAME}/SerialPortAssistant-${{env.SerialPortAssistant_VERSION}}-1.fc42.aarch64.rpm)| |sudo dnf install \"rpm file\" |" >> ${{github.workspace}}/Release.md

.github/workflows/docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ jobs:
4949
with:
5050
submodules: true
5151
fetch-depth: 0
52+
5253
- name: run docker
5354
run: |
5455
./Script/build_linux.sh --docker --docker-image="${{matrix.variant.image}}" --${{matrix.variant.PACKAGE}}
56+
5557
- name: Update artifact
5658
if: ${{matrix.variant.PACKAGE == 'rpm'}}
5759
uses: actions/upload-artifact@v4

.github/workflows/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
INSTALL_DIR: ${{github.workspace}}/.cache/install_macos
4343
qt_modules: "qtscxml qtmultimedia qtserialport qt5compat qtwebsockets qtpositioning qtwebchannel"
4444
artifact_name: build_macos
45-
VCPKGGITCOMMITID: 59aeb8fe8fe1c980de6bd5ba634cf21024522d81
45+
VCPKGGITCOMMITID: 4c5ae6b55f3e3e39d291679f89822f496cf190ee
4646
SerialPortAssistant_VERSION: v0.5.31
4747

4848
# Map the job outputs to step outputs

.github/workflows/msvc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
INSTALL_DIR: ${{github.workspace}}\.cache\install_${{matrix.qt_arch}}_Release
5252
CMAKE_GENERATOR: "Visual Studio 17 2022"
5353
CMAKE_GENERATOR_PLATFORM: ${{matrix.CMAKE_GENERATOR_PLATFORM}}
54-
VCPKGGITCOMMITID: 59aeb8fe8fe1c980de6bd5ba634cf21024522d81
54+
VCPKGGITCOMMITID: 4c5ae6b55f3e3e39d291679f89822f496cf190ee
5555
VCPKG_TARGET_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
5656
VCPKG_PLATFORM_TOOLSET: ${{matrix.VCPKG_PLATFORM_TOOLSET}}
5757
VCPKG_MANIFEST_DIR: "${{github.workspace}}${{matrix.VCPKG_MANIFEST_DIR}}"

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Enable input port name
77
- Add to deploy macos bundle app package
88
- Add windows arm64
9+
- Use [RabbitCommon v2.3.4](https://github.com/KangLin/RabbitCommon/releases/tag/v2.3.4)
910

1011
### Version: v0.5.31
1112
- Package

ChangeLog_zh_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- 允许输入端口名
77
- 增加 macos 分发捆绑包
88
- 增加 windows arm64 发行版本
9+
- 使用 [RabbitCommon v2.3.4](https://github.com/KangLin/RabbitCommon/releases/tag/v2.3.4)
910

1011
### 版本: v0.5.31
1112
- 打包

Script/build_linux.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,15 @@ if [ $DOCKER -eq 1 ]; then
188188
bash -e -x -c "
189189
tar -C ~ -xf /home/build/SerialPortAssistant.tar.gz
190190
~/SerialPortAssistant/Script/build_linux.sh --appimage --verbose ${BUILD_VERBOSE}
191-
cp ~/SerialPortAssistant/SerialPortAssistant_`uname -m`.AppImage /home/build/
191+
mkdir -p /home/build/install
192+
pushd /home/build/install
193+
cp ~/SerialPortAssistant/SerialPortAssistant_`uname -m`.AppImage .
194+
chmod a+rx SerialPortAssistant_`uname -m`.AppImage
195+
cp ~/SerialPortAssistant/build_appimage/AppDir/usr/share/applications/io.github.KangLin.SerialPortAssistant.desktop .
196+
cp ~/SerialPortAssistant/build_appimage/AppDir/usr/share/icons/hicolor/scalable/apps/io.github.KangLin.SerialPortAssistant.svg .
197+
cp ~/SerialPortAssistant/Script/install.sh .
198+
chmod a+rx install.sh
199+
popd
192200
"
193201
fi
194202
if [ $RPM -eq 1 ]; then

Script/install.sh

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#!/bin/bash
2+
3+
# Setup appimage shell script
4+
# Author: Kang Lin <kl222@126.com>
5+
6+
#set -v
7+
set -e
8+
#set -x
9+
10+
INSTALL_DIR=~/AppImage/io.github.KangLin.SerialPortAssistant
11+
usage_long() {
12+
echo "$0 [-h|--help] [--install=<install directory>]"
13+
echo " -h|--help: show help"
14+
echo "Directory:"
15+
echo " --install: Set install directory"
16+
exit
17+
}
18+
# [如何使用getopt和getopts命令解析命令行选项和参数](https://zhuanlan.zhihu.com/p/673908518)
19+
# [【Linux】Shell命令 getopts/getopt用法详解](https://blog.csdn.net/arpospf/article/details/103381621)
20+
if command -V getopt >/dev/null; then
21+
#echo "getopt is exits"
22+
#echo "original parameters=[$@]"
23+
# -o 或 --options 选项后面是可接受的短选项,如 ab:c:: ,表示可接受的短选项为 -a -b -c ,
24+
# 其中 -a 选项不接参数,-b 选项后必须接参数,-c 选项的参数为可选的
25+
# 后面没有冒号表示没有参数。后跟有一个冒号表示有参数。跟两个冒号表示有可选参数。
26+
# -l 或 --long 选项后面是可接受的长选项,用逗号分开,冒号的意义同短选项。
27+
# -n 选项后接选项解析错误时提示的脚本名字
28+
OPTS=help,install:
29+
ARGS=`getopt -o h,v:: -l $OPTS -n $(basename $0) -- "$@"`
30+
if [ $? != 0 ]; then
31+
echo "exec getopt fail: $?"
32+
exit 1
33+
fi
34+
#echo "ARGS=[$ARGS]"
35+
#将规范化后的命令行参数分配至位置参数($1,$2,......)
36+
eval set -- "${ARGS}"
37+
#echo "formatted parameters=[$@]"
38+
39+
while [ $1 ]
40+
do
41+
#echo "\$1: $1"
42+
#echo "\$2: $2"
43+
case $1 in
44+
--install)
45+
INSTALL_DIR=$2
46+
shift 2
47+
;;
48+
--) # 当解析到“选项和参数“与“non-option parameters“的分隔符时终止
49+
shift
50+
break
51+
;;
52+
-h | -help)
53+
usage_long
54+
shift
55+
;;
56+
*)
57+
usage_long
58+
break
59+
;;
60+
esac
61+
done
62+
fi
63+
64+
if [ -f ~/.local/share/applications/io.github.KangLin.SerialPortAssistant.AppImage.desktop ]; then
65+
OLD_UNINSTALL=$(dirname $(readlink -f ~/.local/share/applications/io.github.KangLin.SerialPortAssistant.AppImage.desktop))
66+
if [ -f $OLD_UNINSTALL/uninstall.sh ]; then
67+
echo ""
68+
$OLD_UNINSTALL/uninstall.sh
69+
fi
70+
fi
71+
72+
INSTALL_DIR=$(readlink -f $INSTALL_DIR)
73+
if [ ! -d $INSTALL_DIR ]; then
74+
mkdir -p $INSTALL_DIR
75+
fi
76+
77+
ROOT_DIR=$(dirname $(readlink -f $0))
78+
if [ ! -d /usr/share/icons/hicolor/scalable/apps ]; then
79+
mkdir -p /usr/share/icons/hicolor/scalable/apps
80+
fi
81+
82+
pushd $ROOT_DIR > /dev/null
83+
84+
APPIMAGE_FILE=`ls SerialPortAssistant_*.AppImage`
85+
if [ $INSTALL_DIR != $ROOT_DIR ]; then
86+
cp $APPIMAGE_FILE $INSTALL_DIR/$APPIMAGE_FILE
87+
cp io.github.KangLin.SerialPortAssistant.svg $INSTALL_DIR/io.github.KangLin.SerialPortAssistant.svg
88+
cp io.github.KangLin.SerialPortAssistant.desktop $INSTALL_DIR/io.github.KangLin.SerialPortAssistant.desktop
89+
fi
90+
91+
sed -i "s#Exec=.*#Exec=${INSTALL_DIR}/${APPIMAGE_FILE}#g" $INSTALL_DIR/io.github.KangLin.SerialPortAssistant.desktop
92+
if [ ! -f ~/.local/share/applications/io.github.KangLin.SerialPortAssistant.AppImage.desktop ]; then
93+
ln -s $INSTALL_DIR/io.github.KangLin.SerialPortAssistant.desktop ~/.local/share/applications/io.github.KangLin.SerialPortAssistant.AppImage.desktop
94+
fi
95+
if [ ! -d ~/.icons/hicolor/scalable/apps ]; then
96+
mkdir -p ~/.icons/hicolor/scalable/apps
97+
fi
98+
if [ ! -f ~/.icons/hicolor/scalable/apps/io.github.KangLin.SerialPortAssistant.svg ]; then
99+
ln -s $INSTALL_DIR/io.github.KangLin.SerialPortAssistant.svg ~/.icons/hicolor/scalable/apps/io.github.KangLin.SerialPortAssistant.svg
100+
fi
101+
102+
update-desktop-database ~/.local/share/applications
103+
104+
echo "echo \"Uninstall rabbit remote control in $(dirname $(readlink -f ~/.local/share/applications/io.github.KangLin.SerialPortAssistant.AppImage.desktop))\"" > $INSTALL_DIR/uninstall.sh
105+
echo "rm ~/.local/share/applications/io.github.KangLin.SerialPortAssistant.AppImage.desktop" >> $INSTALL_DIR/uninstall.sh
106+
echo "rm ~/.icons/hicolor/scalable/apps/io.github.KangLin.SerialPortAssistant.svg" >> $INSTALL_DIR/uninstall.sh
107+
echo "rm -fr $INSTALL_DIR" >> $INSTALL_DIR/uninstall.sh
108+
chmod u+x $INSTALL_DIR/uninstall.sh
109+
chmod u+x $INSTALL_DIR/$APPIMAGE_FILE
110+
111+
echo ""
112+
echo "Install rabbit remote control AppImage to \"$INSTALL_DIR\"."
113+
echo ""
114+
echo "If you want to uninstall it. Please execute:"
115+
echo " $INSTALL_DIR/unistasll.sh"
116+
echo ""
117+
118+
popd > /dev/null

0 commit comments

Comments
 (0)