Drop bin/omarchy-menu; sweep JSONC actions to bare commands
The shell now owns the menu — both data and dispatch. The 821-line bash bin was carrying the open path (cold spawn + jq pipeline + tempfile dance + IPC + poll) and a grab-bag of helpers that only existed inside it. Both go away in this commit. New bins for the few composite helpers that were genuinely worth keeping: - omarchy-install-app NAME PKG - omarchy-install-and-launch NAME PKG DESKTOP_ID - omarchy-install-font LABEL PKG FAMILY - omarchy-launch-config-editor PATH - omarchy-reminder-set-interactive - omarchy-capture-screenrecording-with-webcam Sweep through default/omarchy/omarchy-menu.jsonc rewrites: - present_terminal X -> omarchy-launch-floating-terminal-with-presentation X - install_terminal X -> omarchy-launch-floating-terminal-with-presentation 'omarchy-install-terminal X' - install / install_and_launch / install_font / open_in_editor -> new bins above - terminal X -> xdg-terminal-exec --app-id=org.omarchy.terminal X - default_browser_is X -> [[ "$(omarchy-default-browser)" == "X" ]] - default_terminal_is X / default_editor_is X / haptic_touchpad_is X same shape - $(hypr_config_file X) -> ~/.config/hypr/X.lua - show_custom_reminder_input -> omarchy-reminder-set-interactive - screenrecord_with_webcam -> omarchy-capture-screenrecording-with-webcam - stop_active_screenrecording -> omarchy-capture-screenrecording --stop-recording Hyprland bindings switch from `omarchy-menu X` to `omarchy-shell-ipc menu summon X` (the keybind hot path now skips bash entirely). The Bar.qml omarchy widget and the battery right-click do the same. ALT+PRINT becomes a one-liner: stop the recording if one is going, otherwise summon the screenrecord submenu. Measured: keybind-to-visible is ~30ms (was ~235ms). The shell's plugin keepLoaded:true stops being theoretical \u2014 the menu data lives in memory across opens, and the only work between keypress and paint is the IPC roundtrip and the layer-shell window mount.
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Pick a webcam and start a screen recording with it
|
||||
# omarchy:examples=omarchy capture screenrecording-with-webcam
|
||||
|
||||
set -o pipefail
|
||||
|
||||
webcam_list() {
|
||||
v4l2-ctl --list-devices 2>/dev/null | while IFS= read -r line; do
|
||||
if [[ $line != $'\t'* && -n $line ]]; then
|
||||
local name="$line"
|
||||
local device
|
||||
IFS= read -r device || break
|
||||
device=$(tr -d '\t' <<<"$device" | head -1)
|
||||
[[ -n $device ]] && echo "$device $name"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
devices=$(webcam_list)
|
||||
if [[ -z $devices ]]; then
|
||||
omarchy-notification-send "No webcam devices found" -u critical -t 3000
|
||||
exit 1
|
||||
fi
|
||||
|
||||
count=$(grep -c . <<<"$devices")
|
||||
if (( count == 1 )); then
|
||||
device="${devices%%[[:space:]]*}"
|
||||
else
|
||||
selection=$(omarchy-menu-select "Select Webcam" "$devices") || exit 1
|
||||
device="${selection%%[[:space:]]*}"
|
||||
fi
|
||||
|
||||
exec omarchy-capture-screenrecording \
|
||||
--with-desktop-audio --with-microphone-audio \
|
||||
--with-webcam --webcam-device="$device"
|
||||
Reference in New Issue
Block a user