banner
Geek

Geek

🧠在家居士 | 🥦素食者 | 🏃🏻马拉松爱好者 | 📡AI降临派 | 过🪜技术资深学者 | 🤖科技狂 | 📤更新狂🆅 https://www.igeekbb.com/
twitter
github

Generate desktop apps with one-click packaging of web pages using Rust command line.

NameProject Address
Pakehttps://github.com/tw93/Pake

Supports Mac / Windows / Linux. For more information about common package downloads, one-click packaging on the command line, and custom development, please refer to the documentation below. You are also welcome to join the discussion area for communication.

Features#

🎐 Compared to traditional Electron shell packaging, it is nearly 20 times smaller, around 5M.
🚀 Pake uses the Rust Tauri framework at its core, providing a faster performance compared to JS frameworks and using less memory.
📦 It is not just a simple packaging tool, it also enables shortcut key passthrough, immersive windows, dragging, style rewriting, ad blocking, and customization of the product's minimalist style.
👻 It is just a simple toy, replacing the old idea of packaging web pages with Rust, and actually PWA is also good.

Packaging xLog Personal Homepage#

Create a virtual environment:#

python3 -m venv myenv

Activate the virtual environment:#

source myenv/bin/activate

Install using npm#

npm install -g pake-cli

CleanShot 2023-04-23 at 19.42.50 2@2x

Find the installation path of Pake#

npm bin -g

CleanShot 2023-04-23 at 20.06.29@2x

Edit the configuration file#

nano ~/.bash_profile

Add the PATH environment variable#

Add the following line at the end of the file: (the address may vary)

export PATH=$PATH:/Users/geek/.npm-packages/bin

CleanShot 2023-04-23 at 20.08.33@2x

Press Ctrl and X, then Y to save and exit.

Reload the Bash configuration file#

source ~/.bash_profile

Generate a desktop application#

Let's try it with my xLog homepage (it's slow the first time, but it will be faster afterwards)

pake https://x.geekbb.ml --name Geek --transparent

*If you encounter a rustc error, please see the note at the end

CleanShot 2023-04-23 at 20.32.51@2x

CleanShot 2023-04-23 at 20.33.45@2x

Demo#

GIF loading...
CleanShot 2023-04-23 at 21.26.04 2


But the default icon is not good, so let's find a website to convert a JPG to ICNS

👉JPG to ICNS - Convert image files online (aconvert.com)

  • Must be .icns on MacOS
  • Must be .ico on Windows
  • Must be .png on Linux

Change the default icon#

Add: --icon <path> at the end

pake https://x.geekbb.ml --name Geek --transparent --icon /Users/geek/Documents/123/Geek.icns

CleanShot 2023-04-23 at 21.47.15@2x


Packaging Chatbot UI#

Chatbot UI is deployed locally, so it can be packaged to avoid entering the URL every time

pake http://192.168.2.100:3000 --name Chatbot --transparent --icon /Users/geek/Documents/123/chatgpt.icns

Demo#

GIF loading...
CleanShot 2023-04-23 at 22.01.06 2


If you encounter the zsh: command not found: rustc error👇

  • Open the terminal and execute the following commands one by one:
curl --proto '=https' --tlsv 1.2 -sSf https://sh.rustup.rs | sh
  • Open the terminal and enter the following command to open the terminal's configuration file:
nano ~/.zshrc
  • Add the following code at the end of the file:
export PATH="$HOME/.cargo/bin:$PATH"
  1. This command adds $HOME/.cargo/bin to the PATH environment variable.

  2. Press Control + X, then press Y to save the changes and exit.

  3. Enter the following command to update the terminal's configuration file:

source ~/.zshrc

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.