new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Tauri · Develop · all subjects

project setup

13 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

File System plugin setup - Rust initialization

To use the file system plugin in Rust, initialize it in lib.rs by calling `.plugin(tauri_plugin_fs::init())` in the tauri::Builder chain. The plugin must be added to Cargo.toml using `cargo add tauri-plugin-fs`. The FsExt trait should be imported with `use tauri_plugin_fs::FsExt;` to access scope methods.

File System plugin setup - JavaScript installation

Install the JavaScript bindings for the file system plugin using `npm install @tauri-apps/plugin-fs`, `yarn add @tauri-apps/plugin-fs`, `pnpm add @tauri-apps/plugin-fs`, or the equivalent for other package managers. Import functions like `exists`, `readFile`, `writeFile`, `BaseDirectory` from '@tauri-apps/plugin-fs'.

Global Shortcut plugin installation with auto setup

To install the Global Shortcut plugin automatically, run one of these commands in your project root: npm run tauri add global-shortcut, yarn run tauri add global-shortcut, pnpm tauri add global-shortcut, deno task tauri add global-shortcut, bun tauri add global-shortcut, or cargo tauri add global-shortcut.

Global Shortcut plugin manual installation - Cargo dependency

To manually install the Global Shortcut plugin, run this command in the src-tauri folder: cargo add tauri-plugin-global-shortcut --target 'cfg(any(target_os = "macos", windows, target_os = "linux"))'

Global Shortcut plugin initialization in lib.rs

To initialize the Global Shortcut plugin in lib.rs, add this code in the setup method: #[cfg(desktop)] app.handle().plugin(tauri_plugin_global_shortcut::Builder::new().build());

Global Shortcut JavaScript binding installation

Install the JavaScript guest binding using one of these commands: npm install @tauri-apps/plugin-global-shortcut, yarn add @tauri-apps/plugin-global-shortcut, pnpm add @tauri-apps/plugin-global-shortcut, deno add npm:@tauri-apps/plugin-global-shortcut, or bun add @tauri-apps/plugin-global-shortcut

Global Shortcut plugin is desktop-only

The Global Shortcut plugin only works on desktop platforms (macOS, Windows, and Linux). The plugin is conditionally compiled using #[cfg(desktop)] and the Cargo dependency is added with a platform target condition.

Install process plugin with yarn

To install the process plugin using yarn, run: yarn add @tauri-apps/plugin-process

Install process plugin with pnpm

To install the process plugin using pnpm, run: pnpm add @tauri-apps/plugin-process

Add process plugin to Cargo.toml

To add the process plugin to your project dependencies, run in the src-tauri folder: cargo add tauri-plugin-process

Initialize process plugin in lib.rs

Initialize the process plugin in src-tauri/src/lib.rs by adding .plugin(tauri_plugin_process::init()) to the tauri::Builder::default() chain.

File System plugin setup - automatic installation

To automatically install the fs plugin, use the command `npm run tauri add fs` (npm), `yarn run tauri add fs` (yarn), `pnpm tauri add fs` (pnpm), `deno task tauri add fs` (deno), `bun tauri add fs` (bun), or `cargo tauri add fs` (cargo).

File System plugin setup - manual installation

To manually install the fs plugin: (1) Run `cargo add tauri-plugin-fs` in the `src-tauri` folder. (2) Modify `src-tauri/src/lib.rs` to add `.plugin(tauri_plugin_fs::init())` to the tauri::Builder::default() chain. (3) Install JavaScript bindings using `npm install @tauri-apps/plugin-fs` (npm), `yarn add @tauri-apps/plugin-fs` (yarn), `pnpm add @tauri-apps/plugin-fs` (pnpm), `deno add npm:@tauri-apps/plugin-fs` (deno), or `bun add @tauri-apps/plugin-fs` (bun).

Give your agent this brain