#tauri-plugin #wallpaper #window #desktop #icons #behind #set

sys tauri-plugin-wallpaper

A Tauri plugin to set your window as wallpaper behind desktop icons

4 releases (2 stable)

2.0.1 Jan 1, 2025
2.0.0 Dec 24, 2024
2.0.0-beta Oct 24, 2024
0.0.1 Mar 29, 2023

#899 in GUI

Download history 7/week @ 2024-09-25 6/week @ 2024-10-02 108/week @ 2024-10-23 6/week @ 2024-10-30 1/week @ 2024-12-04 3/week @ 2024-12-11 91/week @ 2024-12-18 51/week @ 2024-12-25 140/week @ 2025-01-01 9/week @ 2025-01-08

291 downloads per month

MIT license

14KB
228 lines

Tauri Plugin Wallpaper (✨)

A Tauri plugin to set your window as wallpaper behind desktop icons


license issues stars


Available platforms (🚧)

  • Windows
  • MacOS
  • Linux

Getting Started (✅)

Installation (⏬)

  • cargo

    cargo add tauri-plugin-wallpaper@2
    
  • npm

    npm install tauri-plugin-wallpaper@2
    

How to use (🌠)

  • cargo
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![show, hide])
        .plugin(tauri_plugin_wallpaper::init()) // add this line
        .setup(|app| {
            let app_handle = app.handle();
            let webview_window = app_handle.get_webview_window("wallpaper").unwrap();
            // attach window to wallpaper
            app_handle
                .wallpaper()
                .attach_window(&webview_window)
                .unwrap();
            // attach using window label identifier
            app_handle
                .wallpaper()
                .attach(AttachRequest::new("window_label"))
                .unwrap();

            // detach window from wallpaper
            app_handle
                .wallpaper()
                .detach_window(&webview_window)
                .unwrap();

            // detach using window label identifier
            app_handle
                .wallpaper()
                .detach(DetachRequest::new("window_label"))
                .unwrap();

            // reset wallpaper
            app_handle.wallpaper().reset().unwrap();
            Ok(())
        })
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
  • npm
import wallpaper from "tauri-plugin-wallpaper";
// or import { attach, detach, reset } from "tauri-plugin-wallpaper";

// Attach current window as wallpaper
wallpaper.attach();
// or using window label identifier
wallpaper.attach("window-label");

// detach current window from wallpaper
wallpaper.detach();
// or using window label identifier
wallpaper.detach("window-label");

// reset wallpaper
wallpaper.reset();

Permissions (🔑)

If you want to use the javascript bindings, you need to add the following permissions.

default.json

{
  "identifier": "default",
  "description": "enables the default permissions",
  "windows": [
    ...
  ],
  "permissions": [
    "core:default",
    "wallpaper:default" // add this line
  ]
}

See reference for more permissions options.


The End (💘)

Dependencies

~18–69MB
~1M SLoC