-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 59a0e7d
Showing
23 changed files
with
1,277 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Format and Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
format-and-lint: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies (Ubuntu only) | ||
if: matrix.platform == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev | ||
- name: Rust setup | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy, rustfmt | ||
|
||
- name: Rust cache | ||
uses: swatinem/rust-cache@v2 | ||
with: | ||
workspaces: ./ -> target | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- name: Node setup and cache | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: pnpm | ||
|
||
- name: Install frontend dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Check code formatting | ||
run: pnpm format:check | ||
|
||
- name: Check code linting | ||
run: pnpm lint:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: install webkit2gtk | ||
if: matrix.platform == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y webkit2gtk-4.1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo test --all-targets --all-features -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/.vs | ||
.DS_Store | ||
.Thumbs.db | ||
*.sublime* | ||
.idea/ | ||
debug.log | ||
package-lock.json | ||
.vscode/settings.json | ||
yarn.lock | ||
|
||
/.tauri | ||
/target | ||
Cargo.lock | ||
node_modules/ | ||
|
||
dist-js | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
permissions/schemas/ | ||
permissions/autogenerated/ | ||
src/ | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"printWidth": 88 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "tauri-plugin-desktop-underlay" | ||
version = "0.0.1" | ||
authors = ["Yao Xiao <[email protected]> (https://charlie-xiao.github.io/)"] | ||
description = "Tauri plugin for making a window a desktop underlay, as if it were a wallpaper." | ||
edition = "2021" | ||
exclude = ["/examples", "/webview-dist", "/webview-src", "/node_modules"] | ||
links = "tauri-plugin-desktop-underlay" | ||
|
||
[build-dependencies] | ||
tauri-plugin = { version = "2.0.0-rc.7", features = ["build"] } | ||
|
||
[dependencies] | ||
anyhow = "1.0.86" | ||
tauri = { version = "2.0.0-rc.8" } | ||
|
||
[target."cfg(target_os = \"linux\")".dependencies] | ||
gtk = "0.18.1" | ||
gdk = "0.18.0" | ||
|
||
[target."cfg(target_os = \"macos\")".dependencies] | ||
objc = "0.2.7" | ||
|
||
[target."cfg(target_os = \"windows\")".dependencies] | ||
windows = { version = "0.58.0", features = [ | ||
"Win32_UI_WindowsAndMessaging", | ||
"Win32_Foundation" | ||
] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Tauri Plugin desktop-underlay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const COMMANDS: &[&str] = &["set_desktop_underlay"]; | ||
|
||
fn main() { | ||
tauri_plugin::Builder::new(COMMANDS).build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { invoke } from "@tauri-apps/api/core"; | ||
|
||
/** | ||
* Determines if the window should be a desktop underlay. | ||
* | ||
* @param desktopUnderlay Whether the window should be a desktop underlay. | ||
*/ | ||
export async function setDesktopUnderlay(desktopUnderlay: boolean): Promise<void> { | ||
return await invoke<void>("plugin:desktop-underlay|set_desktop_underlay", { | ||
desktopUnderlay, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "tauri-plugin-desktop-underlay-api", | ||
"version": "0.0.1", | ||
"author": "Yao Xiao <[email protected]>", | ||
"description": "Tauri plugin for making a window a desktop underlay, as if it were a wallpaper.", | ||
"type": "module", | ||
"types": "./dist-js/index.d.ts", | ||
"main": "./dist-js/index.cjs", | ||
"module": "./dist-js/index.js", | ||
"exports": { | ||
"types": "./dist-js/index.d.ts", | ||
"import": "./dist-js/index.js", | ||
"require": "./dist-js/index.cjs" | ||
}, | ||
"files": [ | ||
"dist-js", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"prepublishOnly": "pnpm build", | ||
"pretest": "pnpm build", | ||
"tauri": "tauri", | ||
"build": "rollup -c", | ||
"format": "prettier --write . && cargo fmt", | ||
"format:check": "prettier --check . && cargo fmt -- --check", | ||
"lint": "cargo clippy --fix --allow-dirty --allow-staged -- -D warnings", | ||
"lint:check": "cargo clippy -- -D warnings" | ||
}, | ||
"dependencies": { | ||
"@tauri-apps/api": "^2.0.0-rc.4" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-typescript": "^11.1.6", | ||
"@tauri-apps/cli": "^2.0.0-rc.8", | ||
"prettier": "^3.3.3", | ||
"rollup": "^4.21.2", | ||
"tslib": "^2.7.0", | ||
"typescript": "^5.5.4" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
permissions/autogenerated/commands/set_desktop_underlay.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Automatically generated - DO NOT EDIT! | ||
|
||
"$schema" = "../../schemas/schema.json" | ||
|
||
[[permission]] | ||
identifier = "allow-set-desktop-underlay" | ||
description = "Enables the set_desktop_underlay command without any pre-configured scope." | ||
commands.allow = ["set_desktop_underlay"] | ||
|
||
[[permission]] | ||
identifier = "deny-set-desktop-underlay" | ||
description = "Denies the set_desktop_underlay command without any pre-configured scope." | ||
commands.deny = ["set_desktop_underlay"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## Default Permission | ||
|
||
Default permissions for the plugin. | ||
|
||
- `allow-desktop-underlay` | ||
|
||
## Permission Table | ||
|
||
<table> | ||
<tr> | ||
<th>Identifier</th> | ||
<th>Description</th> | ||
</tr> | ||
|
||
|
||
<tr> | ||
<td> | ||
|
||
`desktop-underlay:allow-set-desktop-underlay` | ||
|
||
</td> | ||
<td> | ||
|
||
Enables the set_desktop_underlay command without any pre-configured scope. | ||
|
||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
|
||
`desktop-underlay:deny-set-desktop-underlay` | ||
|
||
</td> | ||
<td> | ||
|
||
Denies the set_desktop_underlay command without any pre-configured scope. | ||
|
||
</td> | ||
</tr> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[default] | ||
description = "Default permissions for the plugin." | ||
permissions = ["allow-desktop-underlay"] |
Oops, something went wrong.