Teach the file manager to send and to shrink

Right-click a file to send it to your phone, or a video to make it
smaller. macOS has both behind the Share sheet and Quick Actions;
Windows has "Send to"; a stock Linux file manager has neither, and the
usual answer for the second one is a web uploader or an ffmpeg
incantation looked up again every time.

Neither adds machinery. Sending reuses panama-kdeconnect, the same
helper the Home & Phone page and quick settings already drive, so
there is one way to talk to a phone rather than two. The entry appears
only when a phone is actually reachable: an item that is present and
fails is worse than one that is absent, because the absence explains
itself.

The transcoder's two rules are both about not losing work. It never
writes to its input, and it never writes over an earlier output -- a
second run produces -2 rather than eating the first result. Verified
against a real encode: 1920x1080 became 854x480, with an even width
because H.264 rejects an odd one at the very end of a long encode,
which is the worst possible moment to find out.

Menus decide by mime type rather than extension, act on one file at a
time, and refuse anything that is not a local path. nautilus-python
turned out to be declared already; it now says it carries Panama's own
extensions too.
This commit is contained in:
Gabriel Brown
2026-08-22 06:52:04 -04:00
parent 05fd5346db
commit 68cbf892e9
7 changed files with 447 additions and 1 deletions
+22
View File
@@ -434,6 +434,28 @@ if [ -d "$PANAMA_QUADLET_DIR" ]; then
systemctl --user daemon-reload 2>/dev/null || true
fi
# Nautilus loads Python extensions from this directory. Linked per file rather
# than by symlinking the directory itself, the same way the quadlets and
# desktop entries are: Nautilus writes nothing here today, but a directory
# symlink into the repository is how machine state ends up in a tracked path.
PANAMA_NAUTILUS_DIR="$PANAMA_PATH/config/local/share/nautilus-python/extensions"
USER_NAUTILUS_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/nautilus-python/extensions"
if [ -d "$PANAMA_NAUTILUS_DIR" ]; then
mkdir -p "$USER_NAUTILUS_DIR"
for extension in "$PANAMA_NAUTILUS_DIR"/*.py; do
[ -e "$extension" ] || continue
extension_dst="$USER_NAUTILUS_DIR/$(basename "$extension")"
if [ -L "$extension_dst" ]; then
rm "$extension_dst"
elif [ -e "$extension_dst" ]; then
log "Keeping existing Nautilus extension at $extension_dst"
continue
fi
ln -s "$extension" "$extension_dst"
log "Linked Nautilus extension → $extension_dst"
done
fi
DEFAULT_APPS_HELPER="$PANAMA_PATH/config/dot/quickshell/scripts/panama-default-apps"
if [[ -x "$DEFAULT_APPS_HELPER" ]] && command -v xdg-mime >/dev/null 2>&1; then
update-desktop-database "$USER_APPLICATION_DIR" >/dev/null 2>&1 || true