GNOME Bugzilla – Bug 684662
Default filename for screenshots is problematic
Last modified: 2014-04-28 14:32:51 UTC
Originally filed in Launchpad against the Ubuntu package, filing upstream. Press "printscreen" and you'll get a default filename of:- "Screenshot from YYYY-MM-DD HH:MM:SS.png" Fine for browsing in nautilus and double clicking on, but this format (specifically the colons) has been a bane for me for some time. 1. Tab completion fails:- -rw-rw-r-- 1 alan alan 751K Sep 23 01:10 Screenshot from 2012-09-23 01:10:33.png # tab completion works as far as here alan@deep-thought:~/Pictures$ scp Screenshot\ from\ 2012-09-2 Screenshot\ from\ 2012-09-21\ 19\:40\:46.png Screenshot\ from\ 2012-09-23\ 01\:01\:41.png Screenshot\ from\ 2012-09-23\ 01\:10\:33.png # get to here and it won't finish the filename off. alan@deep-thought:~/Pictures$ scp Screenshot\ from\ 2012-09-23\ 01\: 2. scp fails. alan@deep-thought:~/Pictures$ scp Screenshot\ from\ 2012-09-23\ 01\:10\:33.png popey.com: ssh: Could not resolve hostname Screenshot from 2012-09-23 01: Name or service not known 3. Ubuntu one file link in thunderbird fails See bug https://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/1054803 Whilst I can see an argument for fixing the bugs in all those other applications, wouldn't it make more sense to just not have mad filenames created in the first place. I propose:- "Screenshot_from_YYYY-MM-DD_HH-MM-SS.png"
Another issue with using ":" is that this is a disallowed character on windows, so sharing screenshots over to those systems causes issues.
IMHO, spaces are fine, any non-broken software will deal with them nicely, and it can be escaped or quoted just fine. The *real* problem are the colons: not only they confuse scp/ssh, but they are an *illegal* character on NTFS under Windows. So my suggestion is: "Screenshot from YYYY-MM-DD HH-MM-SS.png" And since anyone will have their own suggestion, besides changing the default please provide a way for each user to choose its own filename format, like Shutter does. If not via GUI, at least via gconf/dconf.
OS X uses '.' instead of ':'. For example: Screen Shot 2013-02-09 at 2.14.44 PM.png
Even though spaces can be handled they are still inconvenient in many cases. So personally I would like to be able to get rid of those as well. For what it's worth my proposal is "Screenshot_YYYYMMDD_HHMMSS.png" to keep the name relatively short. Would it be possible to make the name configurable?
Created attachment 259021 [details] Avoid using colons in screenshot file names. WARNING: not tested, I am on a windows machine right now :-)
Found the upstream bug after posting things to the launchpad bug (sorry for the noise). If I read well the source code, while the messages is localized (see just below when the "Screenshot from" text is added), the date-time format is not. Clearly the best solution would be to make it user-definable (am I hearing the screams of Gnome designers?) but nevertheless I think that the default should be sensible --- and that means generating files that are Windows-compatibles. So for example I propose this minimalist patch: --- /root/src/screenshot-filename-builder.c.orig Tue Nov 5 08:15:09 2013 +++ /root/src/screenshot-filename-builder.c Tue Nov 5 08:17:18 2013 @@ -132,7 +132,7 @@ GDateTime *d; d = g_date_time_new_now_local (); - origin = g_date_time_format (d, "%Y-%m-%d %H:%M:%S"); + origin = g_date_time_format (d, "%Y-%m-%d %H-%M-%S"); g_date_time_unref (d); } else which just get rid of the colons, do not touch the translation strings, put just one dot in the filename before the file type, and makes everyone half-happy :-) WARNING: not tested, I am on a windows machine right now :-), trying to solve the mystery of the screenshots files not mirrored by Dropbox...
Confirm I have the same issues as the OP with gnome-screenshot 3.4.1-0ubuntu1.1 in Ubuntu 12.04 LTS. I second the request for a better default format eg: replacing the colons with dots or dashes as suggested by others. User definable would be even better, but a windows-compatible default is essential.
*** This bug has been marked as a duplicate of bug 698740 ***
Weird that *this* bug was marked as duplicate, and not the other way around.