├── .github └── workflows │ └── ci.yml ├── AppRun ├── LICENSE ├── README.md ├── com.wps.Office.desktop ├── create_appimage.sh ├── version ├── wps-launcher └── wps-launcher.v /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | push: 4 | tags: 5 | - '[0-9]+.[0-9]+.[0-9]+.[0-9]+' 6 | jobs: 7 | build: 8 | runs-on: ubuntu-20.04 9 | steps: 10 | - uses: actions/checkout@v1.2.0 11 | - name: Install unrpm 12 | run: | 13 | sudo apt-get update 14 | sudo apt-get install obs-build 15 | - name: Build AppImage 16 | run: | 17 | bash create_appimage.sh 18 | - name: Upload binaries to release 19 | uses: svenstaro/upload-release-action@v2 20 | with: 21 | repo_token: ${{ secrets.GITHUB_TOKEN }} 22 | file: WPS_Office-x86_64.AppImage 23 | asset_name: WPS_Office-$tag.x86_64.AppImage 24 | tag: ${{ github.ref }} 25 | overwrite: true 26 | -------------------------------------------------------------------------------- /AppRun: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ${APPDIR}/wps-launcher $* 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | wps-office-appimage 2 | ------ 3 | 4 | Automatically build wps-office appimage. see releases. 5 | -------------------------------------------------------------------------------- /com.wps.Office.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=WPS Office 3 | Comment=Use WPS Writer to edit articles and reports. 4 | Exec=AppRun 5 | GenericName=WPS Office 6 | MimeType=application/wps-office.wps;application/wps-office.wpt;application/wps-office.wpso;application/wps-office.wpss;application/wps-office.doc;application/wps-office.dot;application/vnd.ms-word;application/msword;application/x-msword;application/msword-template;application/wps-office.docx;application/wps-office.dotx;application/rtf;application/vnd.ms-word.document.macroEnabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.document;x-scheme-handler/ksoqing;x-scheme-handler/ksowps;x-scheme-handler/ksowpp;x-scheme-handler/ksoet;x-scheme-handler/ksowpscloudsvr;x-scheme-handler/ksowebstartupwps;x-scheme-handler/ksowebstartupet;x-scheme-handler/ksowebstartupwpp; 7 | StartupNotify=false 8 | Terminal=false 9 | Type=Application 10 | Categories=Office;WordProcessor;Spreadsheet;Presentation; 11 | X-DBUS-ServiceName= 12 | X-DBUS-StartupType= 13 | X-KDE-SubstituteUID=false 14 | X-KDE-Username= 15 | Icon=wps-office2019-kprometheus 16 | InitialPreference=3 17 | StartupWMClass=wpsoffice 18 | 19 | Actions=Writer;Spreadsheets;Presentation;Pdf; 20 | 21 | 22 | [Desktop Action Writer] 23 | Name=Writer 24 | X-GenericName=Writer 25 | X-Comment=Use WPS Writer to edit articles and reports. 26 | X-MimeType=application/wps-office.wps;application/wps-office.wpt;application/wps-office.wpso;application/wps-office.wpss;application/wps-office.doc;application/wps-office.dot;application/vnd.ms-word;application/msword;application/x-msword;application/msword-template;application/wps-office.docx;application/wps-office.dotx;application/rtf;application/vnd.ms-word.document.macroEnabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.document;x-scheme-handler/ksoqing;x-scheme-handler/ksowps;x-scheme-handler/ksowpp;x-scheme-handler/ksoet;x-scheme-handler/ksowpscloudsvr;x-scheme-handler/ksowebstartupwps;x-scheme-handler/ksowebstartupet;x-scheme-handler/ksowebstartupwpp; 27 | X-Categories=Office;WordProcessor; 28 | Exec=AppRun --writer %F 29 | X-StartupNotify=false 30 | 31 | [Desktop Action Spreadsheets] 32 | Name=Spreadsheets 33 | X-GenericName=Spreadsheets 34 | X-Comment=Use WPS Spreadsheets to analyze manage data. 35 | X-MimeType=application/wps-office.et;application/wps-office.ett;application/wps-office.ets;application/wps-office.eto;application/wps-office.xls;application/wps-office.xlt;application/vnd.ms-excel;application/msexcel;application/x-msexcel;application/wps-office.xlsx;application/wps-office.xltx;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 36 | Exec=AppRun --spreadsheets %F 37 | X-StartupNotify=false 38 | 39 | [Desktop Action Presentation] 40 | Name=Presentation 41 | X-GenericName=Presentation 42 | X-Comment=Use WPS Presentation to edit and play presentations. 43 | X-MimeType=application/wps-office.dps;application/wps-office.dpt;application/wps-office.dpss;application/wps-office.dpso;application/wps-office.ppt;application/wps-office.pot;application/vnd.ms-powerpoint;application/vnd.mspowerpoint;application/mspowerpoint;application/powerpoint;application/x-mspowerpoint;application/wps-office.pptx;application/wps-office.potx;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.openxmlformats-officedocument.presentationml.slideshow 44 | Exec=AppRun --presentation %F 45 | X-StartupNotify=false 46 | 47 | [Desktop Action Pdf] 48 | Name=PDF Reader 49 | X-GenericName=PDF Reader 50 | X-Categories=Office;WordProcessor; 51 | X-Comment=Kingsoft Pdf Reader 52 | X-MimeType=application/wps-office.pdf;application/pdf 53 | Exec=AppRun --pdf %F 54 | -------------------------------------------------------------------------------- /create_appimage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . version 4 | 5 | get_url() { 6 | local key="7f8faaaa468174dc1c9cd62e5f218a5b" 7 | local md5=$(echo -n $key$1$2 | md5sum | cut -d" " -f1) 8 | echo $md5 9 | } 10 | 11 | WPS_FILE="wps-office-${WPS_VERSION}.${WPS_RELEASE}-1.x86_64.rpm" 12 | WPS_PATH="/wps/download/ep/Linux2019/${WPS_RELEASE}/${WPS_FILE}" 13 | TIMESTAMP=$(date +%s) 14 | WPS_URL="https://wps-linux-personal.wpscdn.cn${WPS_PATH}?t=${TIMESTAMP}&k=$(get_url ${WPS_PATH} ${TIMESTAMP})" 15 | echo $WPS_URL 16 | 17 | APPDIR="WPS_Office-x86_64.AppDir" 18 | mkdir -p ${APPDIR} 19 | wget -c ${WPS_URL} -O ${APPDIR}/${WPS_FILE} 20 | cp -r AppRun ${APPDIR} 21 | cp -r com.wps.Office.desktop ${APPDIR} 22 | cp -r wps-launcher ${APPDIR} 23 | 24 | pushd ${APPDIR} 25 | chmod +x AppRun 26 | unrpm ${WPS_FILE} 27 | rm -rf ${WPS_FILE} 28 | cp -r usr/share/icons/hicolor/256x256/mimetypes/wps-office2019-kprometheus.png . 29 | cp -r usr/share/icons/hicolor/256x256/mimetypes/wps-office2019-kprometheus.png ./.DirIcon 30 | popd 31 | 32 | APPIMAGETOOL=$(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed 's/[()",{} ]/\n/g' | grep -o 'https.*continuous.*tool.*86_64.*mage$' | head -1) 33 | wget "$APPIMAGETOOL" -O ./appimagetool-x86_64.AppImage 34 | chmod +x appimagetool-x86_64.AppImage 35 | 36 | ARCH=x86_64 VERSION="${WPS_VERSION}" ./appimagetool-x86_64.AppImage -s ${APPDIR} 37 | -------------------------------------------------------------------------------- /version: -------------------------------------------------------------------------------- 1 | WPS_VERSION=11.1.0 2 | WPS_RELEASE=11720 3 | -------------------------------------------------------------------------------- /wps-launcher: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openSUSE-zh/wps-office-appimage/e7f7ff6d77194ce0f852923e8989ad56bde0c015/wps-launcher -------------------------------------------------------------------------------- /wps-launcher.v: -------------------------------------------------------------------------------- 1 | import ui 2 | import os 3 | 4 | const ( 5 | win_width = 512 6 | win_height = 512 7 | ) 8 | 9 | struct App { 10 | mut: 11 | window &ui.Window = unsafe {nil} 12 | } 13 | 14 | fn main() { 15 | if os.args.len > 1 { 16 | mut f := os.args[1].to_lower() 17 | if f.contains("~") { 18 | f.replace("~", os.home_dir()) 19 | println(f) 20 | } 21 | if f.ends_with(".doc") || f.ends_with(".docx") { 22 | mut process := os.new_process(os.resource_abs_path("opt/kingsoft/wps-office/office6/wps")) 23 | process.set_args([f]) 24 | process.run() 25 | } 26 | if f.ends_with(".xls") || f.ends_with(".xlsx") { 27 | mut process := os.new_process(os.resource_abs_path("opt/kingsoft/wps-office/office6/et")) 28 | process.set_args([f]) 29 | process.run() 30 | } 31 | if f.ends_with(".ppt") || f.ends_with(".pptx") { 32 | mut process := os.new_process(os.resource_abs_path("opt/kingsoft/wps-office/office6/wpp")) 33 | process.set_args([f]) 34 | process.run() 35 | } 36 | if f.ends_with(".pdf") { 37 | mut process := os.new_process(os.resource_abs_path("opt/kingsoft/wps-office/office6/wpspdf")) 38 | process.set_args([f]) 39 | process.run() 40 | } 41 | } else { 42 | mut wps := os.resource_abs_path("usr/share/icons/hicolor/256x256/mimetypes/wps-office2019-wpsmain.png") 43 | mut et := os.resource_abs_path("usr/share/icons/hicolor/256x256/mimetypes/wps-office2019-etmain.png") 44 | mut wpp := os.resource_abs_path("usr/share/icons/hicolor/256x256/mimetypes/wps-office2019-wppmain.png") 45 | mut pdf := os.resource_abs_path("usr/share/icons/hicolor/256x256/mimetypes/wps-office2019-pdfmain.png") 46 | 47 | mut app := &App{} 48 | 49 | app.window = ui.window( 50 | width: win_width 51 | height: win_height 52 | title: 'WPS Office Launcher' 53 | mode: .resizable 54 | children: [ 55 | ui.row( 56 | children: [ 57 | ui.column( 58 | children: [ 59 | ui.picture(width: 256, height: 256, path: wps, on_click: click_wps), 60 | ui.picture(width: 256, height: 256, path: et, on_click: click_et) 61 | ] 62 | ), 63 | ui.column( 64 | children: [ 65 | ui.picture(width: 256, height: 256, path: wpp, on_click: click_wpp), 66 | ui.picture(width: 256, height: 256, path: pdf, on_click: click_wpspdf) 67 | ] 68 | ), 69 | ] 70 | ), 71 | ] 72 | ) 73 | ui.run(app.window) 74 | } 75 | } 76 | 77 | fn click_wps(pic &ui.Picture) { 78 | mut process := os.new_process(os.resource_abs_path("opt/kingsoft/wps-office/office6/wps")) 79 | process.run() 80 | } 81 | 82 | fn click_et(pic &ui.Picture) { 83 | mut process := os.new_process(os.resource_abs_path("opt/kingsoft/wps-office/office6/et")) 84 | process.run() 85 | } 86 | 87 | fn click_wpp(pic &ui.Picture) { 88 | mut process := os.new_process(os.resource_abs_path("opt/kingsoft/wps-office/office6/wpp")) 89 | process.run() 90 | } 91 | 92 | fn click_wpspdf(pic &ui.Picture) { 93 | mut process := os.new_process(os.resource_abs_path("opt/kingsoft/wps-office/office6/wpspdf")) 94 | process.run() 95 | } 96 | 97 | --------------------------------------------------------------------------------