Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
106 lines (95 loc) · 4.95 KB
/
Copy pathCargo.toml
File metadata and controls
106 lines (95 loc) · 4.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
[package]
name = "appkey"
version = "0.1.0"
edition = "2024"
rust-version = "1.95"
license = "MIT"
repository = "https://github.com/carevski/appkey"
description = "Global keyboard shortcuts that open an app, or focus it if it's already running."
publish = false
[dependencies]
anyhow = "1.0.104"
dirs = "7.0.0"
# Settings window. No bundled fonts (ui/font.rs loads the OS font, -1.4 MB);
# glow (OpenGL) is much smaller than wgpu.
eframe = { version = "0.36", default-features = false, features = ["accesskit", "glow", "x11", "wayland"] }
global-hotkey = "0.8.0"
serde = { version = "1.0.229", features = ["derive"] }
toml = { version = "1.1.8", default-features = false, features = ["parse", "serde", "display"] }
# Backends are picked per-OS below; default (GTK/libappindicator) is disabled on purpose.
tray-icon = { version = "0.26.1", default-features = false }
# macOS + Windows need a native event loop on the main thread for hotkeys and the tray.
[target.'cfg(any(target_os = "macos", windows))'.dependencies]
tao = { version = "0.37.1", default-features = false }
# Linux: no GTK. Hotkeys run on global-hotkey's own X11 thread; the tray uses
# StatusNotifierItem over D-Bus (ksni). Keep x11rb on the same minor as global-hotkey.
[target.'cfg(target_os = "linux")'.dependencies]
tray-icon = { version = "0.26.1", default-features = false, features = ["ksni"] }
x11rb = "0.13"
# Wayland desktops are driven over D-Bus (portal, KWin, GNOME Shell). zbus is already
# in the tree via AccessKit; serde_json parses what desktop scripts report back.
zbus = { version = "5.19", default-features = false, features = ["async-io", "blocking-api"] }
serde_json = "1"
# Clean shutdown on SIGTERM (both already in the tree).
signal-hook-registry = "1.4"
libc = "0.2"
# Already in the tree via tray-icon/tao; used to enumerate running apps.
[target.'cfg(target_os = "macos")'.dependencies]
objc2-app-kit = { version = "0.3.2", default-features = false, features = ["std", "libc", "NSRunningApplication", "NSWorkspace"] }
objc2-foundation = { version = "0.3.2", default-features = false, features = ["std", "NSArray", "NSBundle", "NSString", "NSURL"] }
[target.'cfg(windows)'.dependencies]
windows = { version = "0.62.2", features = [
"Win32_Foundation",
"Win32_Graphics_Dwm",
"Win32_System_Console",
"Win32_System_Threading",
"Win32_UI_WindowsAndMessaging",
] }
[lints.rust]
unsafe_op_in_unsafe_fn = "deny"
missing_debug_implementations = "warn"
[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
undocumented_unsafe_blocks = "warn"
unwrap_used = "warn"
module_name_repetitions = "allow"
missing_errors_doc = "allow"
# "Super small" is a feature: optimize release builds for size.
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true
# ---- Packaging (used by scripts/package-linux.sh; versions are set by CI) ----
[package.metadata.deb]
maintainer = "Vladimir Carevski <carevski@gmail.com>"
copyright = "Vladimir Carevski"
section = "utils"
priority = "optional"
# GUI libraries are loaded at runtime (dlopen), so list them explicitly.
depends = "libc6 (>= 2.35), libx11-6, libxcursor1, libxrandr2, libxi6, libxkbcommon-x11-0, libgl1, libegl1"
extended-description = """\
Tray app that gives applications global keyboard shortcuts. Pressing a shortcut \
focuses the app's most recently used window, or starts the app if it isn't running. \
Supports X11 desktops and, on Wayland, GNOME, KDE Plasma and Hyprland."""
assets = [
["target/release/appkey", "usr/bin/", "755"],
["packaging/linux/appkey.desktop", "usr/share/applications/", "644"],
["packaging/appkey.png", "usr/share/icons/hicolor/256x256/apps/", "644"],
["README.md", "usr/share/doc/appkey/README.md", "644"],
# GNOME Wayland helper; enabled by appkey on first run.
["packaging/gnome-extension/appkey@carevski.github.io/metadata.json", "usr/share/gnome-shell/extensions/appkey@carevski.github.io/", "644"],
["packaging/gnome-extension/appkey@carevski.github.io/extension.js", "usr/share/gnome-shell/extensions/appkey@carevski.github.io/", "644"],
]
[package.metadata.generate-rpm]
assets = [
{ source = "target/release/appkey", dest = "/usr/bin/appkey", mode = "755" },
{ source = "packaging/linux/appkey.desktop", dest = "/usr/share/applications/appkey.desktop", mode = "644" },
{ source = "packaging/appkey.png", dest = "/usr/share/icons/hicolor/256x256/apps/appkey.png", mode = "644" },
{ source = "README.md", dest = "/usr/share/doc/appkey/README.md", mode = "644", doc = true },
{ source = "LICENSE", dest = "/usr/share/licenses/appkey/LICENSE", mode = "644", doc = true },
{ source = "packaging/gnome-extension/appkey@carevski.github.io/metadata.json", dest = "/usr/share/gnome-shell/extensions/appkey@carevski.github.io/metadata.json", mode = "644" },
{ source = "packaging/gnome-extension/appkey@carevski.github.io/extension.js", dest = "/usr/share/gnome-shell/extensions/appkey@carevski.github.io/extension.js", mode = "644" },
]