banner
Geek

Geek

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

Pack web pages into desktop apps with one click using Rust command line.

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

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

Features#

🎐 Compared to traditional Electron packaging, it is nearly 20 times smaller, around 5MB.
🚀 Pake uses the Rust Tauri framework as its underlying technology, providing a faster and more lightweight performance compared to JS frameworks, with much smaller memory usage.
📦 It is not just a simple packaging tool, but also supports features such as shortcut key pass-through, immersive windows, dragging, style modification, ad blocking, and customization of minimalist product style.
👻 It is just a simple toy, replacing the old approach of packaging web pages with Rust, although PWA is also good.

Package 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 the desktop application#

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

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

*If you encounter rustc errors, please see the end of the text

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


However, the default icon is not ideal. Let's find a website to convert a JPG to ICNS.

👉JPG to ICNS - Online Image Converter (aconvert.com)

  • For MacOS, the icon must be in .icns format.
  • For Windows, the icon must be in .ico format.
  • For Linux, the icon must be in .png format.

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


Package Chatbot UI#

Chatbot UI is deployed locally, so it can be packaged to avoid entering the website 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 error "zsh: command not found: rustc"👇

  • 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 opened 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.