cute-sway-recorder icon indicating copy to clipboard operation
cute-sway-recorder copied to clipboard

Feature: filename formatting

Open ketexon opened this issue 6 months ago • 4 comments

Filename Formatting

Filename formatting, similar to OBS's %CCYY-%MM-%DD %hh-%mm-%ss, would be useful for sorting files by name and automatic collision avoidance.

If we only want date/time formatting, we can use the syntax of strftime (%Y-%m-%d %H-%M-%S.mp4).

Random ID generation Considerations (not priority)

If we want to have the option for a random 5 ascii characters (eg. ~/Videos/%id.mp4 -> ~/Videos/bq2it.mp4), I think template strings would be the "best" option, since it can look the same as strftime, unlike % formatting and str.format. We could use % as a delimiter to match strftime and use %id as the placeholder. The only potential edge case would be if strftime implements %i, but we can handle that when it happens ;)

If we allow a random 5 ascii characters as a template placeholder, this makes the "Random name" button a little less useful, and maybe we should consider removing it (or replacing it with "Default name"). However, it could be useful if the user wants to know where the file will be saved before starting recording.

It might be a good idea for accessibility to show the realized filename after/before a recording is finished. Eg. a status line at the bottom that says Saved to "~/Videos/2024-46-07/27/24 14-46-02.mp4". This could also be the same place that displays #23 .

ketexon avatar Jul 27 '24 21:07 ketexon