Skip to content

Screenshot and screen recorder quick settings - #2

Open
wayne-tbl wants to merge 4 commits into
FuriLabs:forkyfrom
wayne-tbl:screen-capture
Open

Screenshot and screen recorder quick settings#2
wayne-tbl wants to merge 4 commits into
FuriLabs:forkyfrom
wayne-tbl:screen-capture

Conversation

@wayne-tbl

@wayne-tbl wayne-tbl commented Aug 17, 2026

Copy link
Copy Markdown

The two capture quick settings, moved here out of phosh#3 at review request: quick settings belong in this repo, and the shell keeps only what they need.

Screenshot tile. Folds the drawer away and counts down before the shutter, so what lands in the file is the screen rather than the quick settings it was taken from. The delay comes from io.furios.phosh.shell screenshot-delay.

Updated 18 Aug: the tile no longer links against any phosh symbol. It was calling phosh_shell_fold_top_panel() and phosh_screenshot_manager_take_screenshot_delayed(), which meant phosh had to export fork-only symbols. It is now a single g_dbus_connection_call to io.furios.Shell.Screenshot.ScreenshotDelayed, and the source includes neither shell.h nor screenshot-manager.h. phosh-exported-symbols.txt.in is byte-identical to forky again as a result.

Screen recorder tile. One tap starts a recording, the next stops it. It drives /usr/libexec/phosh-screenrec, installed alongside the plugin; codec, bitrate, framerate, speed, audio source and whether touches are drawn are io.furios.phosh.shell keys. The script is installed as a file directly in libexecdir rather than under phosh/, because /usr/libexec/phosh is the shell binary itself and a directory cannot share the name.

Its notification carries a desktop-entry hint pointing at a NoDisplay entry. libnotify 0.8 sends --icon as the image-path hint and leaves app_icon empty, which otherwise leaves the notification header with no icon at all — and GIO rejects a desktop entry whose Exec does not exist, so the entry is a real one.

Depends on FuriLabs/phosh#3

That PR carries the D-Bus method this tile calls and the io.furios.phosh.shell keys both tiles read. The schema stays in phosh deliberately: the id is phosh's, a second package cannot extend it, and the Settings panel reads those keys whether or not this package is installed. So phosh#3 needs to land, and libphosh-0.45-dev be rebuilt from it, before this builds — CI here will fail until then, and that failure is the ordering rather than the code.

Testing

Both plugins built out-of-tree against a staged install of phosh#3 on an FLX1, and both tiles have been in daily use on two FLX1s. The D-Bus rework is newer than that: it compiles clean against the phosh tree with phosh's own warning flags, but the ScreenshotDelayed call has not yet been exercised on device.

One device fact worth knowing, not a bug in this code: the FLX1s ships its XDG media directories (Pictures, Videos) owned by uid/gid 1023 (Android media_rw) with ACLs, not writable by furios, so both tiles fail there until the owner is changed. The screenshot path is upstream phosh's g_get_user_special_dir(), so stock phosh fails the same way.

Folds the drawer away and counts down before the shutter, so what is
captured is the screen rather than the quick settings it was taken from.
The delay is io.furios.phosh.shell screenshot-delay, which phosh ships.

Signed-off-by: wayne <wayne@furilabs.com>
Drives /usr/libexec/phosh-screenrec, installed alongside it: one tap
starts a recording, the next stops it. Codec, bitrate, audio source and
whether touches are drawn are io.furios.phosh.shell keys, which phosh
ships.

The script is not in a phosh/ subdirectory because /usr/libexec/phosh is
the shell binary and a directory cannot share the name.

Its notification carries a desktop-entry hint pointing at a NoDisplay
entry: libnotify 0.8 sends --icon as the image-path hint and leaves
app_icon empty, which otherwise leaves the notification header iconless.

Signed-off-by: wayne <wayne@furilabs.com>
wf-recorder is what the recorder shells out to, so it is a hard
dependency. ffmpeg, libnotify-bin and pulseaudio-utils only affect
optional parts of the script -- remuxing, notifications and audio -- and
are Recommends.

Signed-off-by: wayne <wayne@furilabs.com>
wf-recorder cannot say why it failed -- it exits within a second whether
the screen is asleep or the file cannot be created -- so writing to a
directory we have no permission for was reported as "Is the screen
awake?", which sends the user looking in the wrong place entirely.

Check the directory before starting anything instead. This is a real
case rather than a hypothetical: the FLX1s ships its XDG media
directories owned by uid 1023 (Android media_rw), so nothing here can
write to Videos until the owner is changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant