Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
sudo apt-get install -y --no-install-recommends libgtk-4-dev libadwaita-1-dev libdbus-1-dev pkg-config build-essential \
gnome-shell mutter kwin-wayland kde-spectacle qtwayland5 wl-clipboard sqlite3 dbus-user-session \
xdg-desktop-portal xdg-desktop-portal-gtk python3-gi gir1.2-gtk-4.0 psmisc procps \
imagemagick dbus-bin dbus-x11 libglib2.0-bin
imagemagick fonts-dejavu-core tesseract-ocr dbus-bin dbus-x11 libglib2.0-bin
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo build
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## Unreleased

### What is new

- **Window snapping** with the Mac's 17 positions, from the palette (`window left`, `corner`, `third`, `center`...) and the shortcuts `Ctrl+Alt+Shift+Arrows` and `Ctrl+Alt+Enter`. On KDE Plasma it works out of the box; on GNOME it needs the Menew extension version 2 (log out and in after updating).
- **Quick actions** in the palette: mute the microphone (`Ctrl+Alt+M`) or the sound, switch the sound output and input, dark mode, keep awake (also `awake 2h`), lock screen, empty trash, color picker, plain text clipboard, eject disks, brightness (also external displays with `ddcutil`), quit or force quit apps (`quit firefox`, `kill firefox`, "Quit all apps" with a never-quit list) and stop a server on a port (`port 3000`).
- **New note** with `Ctrl+Alt+J`.
- `menew run <id>` runs any of these from a terminal or a custom shortcut (`menew run qa.mic`, `menew run win.left`, `menew run note.new`), for GNOME 45 to 47, which have no GlobalShortcuts portal.

### Known limitations

- Quitting apps sends a signal: Wayland can't ask an app to close its windows.
- Snapping needs KWin or the GNOME extension; X11 sessions without either can't snap.
- Audio devices, brightness, eject and the new shortcuts were tested only on headless GNOME Shell 46 and KWin 5.27.

## 0.1.0-alpha.2

**Early preview for testers.** Screenshots with annotations, text from the screen, QR codes and the system monitor join the command palette, the clipboard history and notes. If you installed 0.1.0-alpha.1, Menew offers this update by itself.
Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"crates/menew-shortcuts",
"crates/menew-clipboard",
"crates/menew-ui",
"crates/menew-desktop",
"crates/menew",
]
resolver = "2"
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,18 @@ Every file in `~/.local/share/menew/scripts` (shell, Python, Node, Ruby) becomes

</details>

<details>
<summary>🪟 <b>Windows and quick actions</b>: <code>window left</code>, <code>mute</code>, <code>dark mode</code>, <code>awake 2h</code>, <code>port 3000</code></summary>

- **Window snapping** with the Mac's 17 positions (halves, corners, thirds, two thirds, center, almost full, fill, next display) from the palette, <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>Shift</kbd> <kbd>←</kbd>/<kbd>→</kbd>/<kbd>↑</kbd>/<kbd>↓</kbd> and <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>Enter</kbd>. KDE Plasma moves the window through a KWin script; GNOME needs the bundled Menew extension (version 2: log out and in after updating it).
- **Microphone and sound**: mute or unmute (<kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>M</kbd> for the mic), and switch the output or input device (`pactl`, PipeWire or PulseAudio).
- **Dark mode**, **keep awake** (`awake 2h`, `acordado 90m`, or until you turn it off), **lock screen**, **empty trash** (asks first), **color picker** (the `#RRGGBB` is copied), **plain text clipboard**, **eject disks**, **brightness** (`brightness 40`, also external displays with `ddcutil`).
- **Quit apps**: `quit firefox`, `kill firefox` (force), "Quit all apps" skips the apps in `never_quit` (`config.json`). Wayland has no way to ask an app to close its windows, so Menew sends it a signal.
- **Ports in use**: `port 3000` shows the server listening there and <kbd>Enter</kbd> stops it.
- Every action also runs from a terminal or a custom shortcut: `menew run qa.mic`, `menew run win.left`, `menew run note.new`.

</details>

<details>
<summary>🔔 <b>Tray icon and start at login</b></summary>

Expand All @@ -194,7 +206,7 @@ The language follows `LC_ALL` / `LANG`.

</details>

Not here yet (see [docs/parity.md](docs/parity.md)): Memory, recordings, pinning a screenshot on the screen, screen recording, scrolling capture, asking about the screen, window management, on-device AI and agents. They are on the roadmap of the Mac app and will come to Linux as far as the platform allows.
Not here yet (see [docs/parity.md](docs/parity.md)): Memory, recordings, pinning a screenshot on the screen, screen recording, scrolling capture, asking about the screen, on-device AI and agents. They are on the roadmap of the Mac app and will come to Linux as far as the platform allows.

## Install

Expand Down Expand Up @@ -240,6 +252,10 @@ cargo run -p menew
| <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>N</kbd> | Paste the next item of the paste queue |
| <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>Shift</kbd> <kbd>S</kbd> | Capture the screen and annotate it |
| <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>Shift</kbd> <kbd>T</kbd> | Copy the text of an area of the screen |
| <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>M</kbd> | Mute or unmute the microphone |
| <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>Shift</kbd> <kbd>←</kbd> <kbd>→</kbd> <kbd>↑</kbd> <kbd>↓</kbd> | Snap the window to that half |
| <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>Enter</kbd> | Make the window fill the screen |
| <kbd>Ctrl</kbd> <kbd>Alt</kbd> <kbd>J</kbd> | New note |
| <kbd>Ctrl</kbd> <kbd>Z</kbd> / <kbd>Ctrl</kbd> <kbd>S</kbd> / <kbd>Ctrl</kbd> <kbd>C</kbd> | In the editor: undo / save / copy |
| <kbd>Tab</kbd> | Switch between Apps and Clipboard in the palette |
| <kbd>↑</kbd> <kbd>↓</kbd> / <kbd>Enter</kbd> / <kbd>Esc</kbd> | Move / run or copy / close |
Expand All @@ -264,6 +280,7 @@ The app has **no telemetry, no analytics and no account**, and makes no network
- Your recent picks are stored in `~/.local/share/menew/recents.json` (item ids only, never copied text); scripts, quick links and world clocks live in `~/.local/share/menew/scripts` and `~/.config/menew/config.json`.
- "Clear history" in the tray deletes every unpinned entry and the image files that go with them.
- Notes live in `~/.local/share/menew/notes/notes.json` (the same format as the Mac). **Normal notes are plain text in that file.** Protected and password notes keep only their title there: the rest is in the Secret Service of your keyring (`application=app.menew.Menew`), never in a plain file. Opening one asks for your password through polkit; where the polkit policy is not installed (AppImage) or there is no authentication agent, the keyring unlocked at login is the only protection, and the notes window says so.
- Quick actions and window snapping run your desktop's own tools locally (`pactl`, `gsettings`, `systemd-inhibit`, `loginctl`, `gio`, `lsblk`, `udisksctl`, `ddcutil`, a KWin script or the Menew GNOME extension) and send nothing anywhere. The color picker goes through the screenshot portal and keeps only the color.
- The optional paste simulation only writes a <kbd>Ctrl</kbd> <kbd>V</kbd> key press to `/dev/uinput`; it never reads keyboard input.

## FAQ
Expand Down
3 changes: 3 additions & 0 deletions crates/menew-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pub struct Config {
pub auto_update_check: bool,
/// Metrics shown in the tray Title and ToolTip, from `cpu cpuGraph ram net disk battery` (the Mac's `menuBarItems`). Empty (the default) samples nothing until the settings window of Phase 11 lets the user opt in.
pub monitor_tray_items: Vec<String>,
/// Apps "Quit all apps" never closes (`neverQuit` on the Mac): desktop ids or program names.
pub never_quit: Vec<String>,
}

impl Default for Config {
Expand All @@ -57,6 +59,7 @@ impl Default for Config {
clipboard_ocr: true,
auto_update_check: true,
monitor_tray_items: Vec::new(),
never_quit: vec![],
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions crates/menew-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub mod markdown;
pub mod monitor;
pub mod notes;
pub mod palette;
pub mod quick_actions;
pub mod ocr;
pub mod paste;
pub mod paste_queue;
Expand All @@ -31,11 +32,14 @@ pub mod search;
pub mod sha256;
pub mod snippets;
pub mod strings;
mod strings_r1;
pub mod sys;
pub mod text_transforms;
pub mod time_zones;
pub mod timers;
#[cfg(unix)]
pub mod updates;
pub mod windows;

pub use calculator::{evaluate, CalcResult};
pub use clipboard_db::{ClipKind, ClipboardDatabase, ClipboardEntry};
Expand Down
11 changes: 11 additions & 0 deletions crates/menew-core/src/palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ pub enum ItemAction {
QrShow(Option<String>),
/// Show the QR window in its Wi-Fi mode.
QrWifi,
/// A command run by the daemon (quick actions `qa.*`, notes `note.*`, screenshots `cap.*`,
/// windows `win.*`, the Menew window `win.open:*`...), see `crates/menew/src/commands.rs`.
Command(String),
}

impl ItemAction {
Expand Down Expand Up @@ -180,6 +183,7 @@ impl ItemAction {
ItemAction::QrShow(None) => "qr-show".into(),
ItemAction::QrShow(Some(t)) => format!("qr-show:{t}"),
ItemAction::QrWifi => "qr-wifi".into(),
ItemAction::Command(c) => format!("command:{c}"),
}
}
}
Expand Down Expand Up @@ -287,6 +291,9 @@ pub struct PaletteContext<'a> {
pub clip: ClipContext<'a>,
/// The notes: protected ones have only their title in `text`.
pub notes: &'a [Note],
/// Items of the other features (quick actions, notes, screenshots, windows), already built for
/// the text typed. They are searched and ranked like the Menew actions.
pub extra: &'a [PaletteItem],
}

const SUGGESTIONS: [&str; 4] = ["action.clipboard", "action.focus", "action.clearclip", "action.uuid"];
Expand Down Expand Up @@ -590,6 +597,7 @@ fn commands(ctx: &PaletteContext) -> Vec<PaletteItem> {
.icon(Icon::Symbol("application-exit-symbolic"))
.act(ItemAction::Quit),
);
out.extend(ctx.extra.iter().cloned());
for app in ctx.apps {
let sub = app.generic_name.as_deref().or(app.comment.as_deref()).unwrap_or("");
let kw = format!("{} {}", app.keywords.join(" "), app.generic_name.clone().unwrap_or_default());
Expand Down Expand Up @@ -769,6 +777,7 @@ mod tests {
autostart_on: false,
clip: Default::default(),
notes: &[],
extra: &[],
};
results(&ctx, query, &|_| vec![])
}
Expand Down Expand Up @@ -847,6 +856,7 @@ mod tests {
autostart_on: false,
clip: Default::default(),
notes: &[],
extra: &[],
};
let out = results(&ctx, "appy", &|_| vec![]);
assert_eq!(out.len(), MAX_RESULTS + 1);
Expand All @@ -872,6 +882,7 @@ mod tests {
autostart_on: false,
clip: Default::default(),
notes: &[],
extra: &[],
};
let hit = |id: i64, t: &str| ClipHit { id, title: t.into(), text: t.into(), kind: ClipKind::Text };
let out = results(&ctx, "history", &|_| vec![hit(1, "my history notes")]);
Expand Down
Loading
Loading