Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
39 changes: 39 additions & 0 deletions bin/omarchy-bluetooth-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# omarchy:summary=Accept files sent over Bluetooth from paired devices
# omarchy:group=bluetooth
# omarchy:args=<on|off|toggle|is-on>

# Receiving is BlueZ's Object Push profile: obexd (bluez-obex) serves the
# profile, and the agent the unit runs decides what happens to a push — only a
# sender BlueZ still lists as paired gets its file stored, in the download
# directory the agent resolves. Nothing here needs Wi-Fi or an app on the
# phone, so it works while the phone is on mobile data.
#
# The unit is the state. `on` enables it, so the receiver also comes up at the
# next login, `off` disables it, and the panel switch reads it back with
# `is-on`. Pairing runs through omarchy-bluetooth-device; the agent is what
# makes "paired devices only" true rather than the share sheet's manners.

case "${1:-}" in
on)
systemctl --user enable --now omarchy-bluetooth-files.service
;;
off)
systemctl --user disable --now omarchy-bluetooth-files.service
;;
toggle)
if systemctl --user is-enabled --quiet omarchy-bluetooth-files.service; then
systemctl --user disable --now omarchy-bluetooth-files.service
else
systemctl --user enable --now omarchy-bluetooth-files.service
fi
;;
is-on)
systemctl --user is-active --quiet omarchy-bluetooth-files.service
;;
*)
echo "Usage: omarchy-bluetooth-files <on|off|toggle|is-on>" >&2
exit 1
;;
esac
Loading