Summary: | Use window title to suggest file names | ||
---|---|---|---|
Product: | [Applications] Spectacle | Reporter: | skaumo |
Component: | General | Assignee: | Boudhayan Gupta <me> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | infroma, null |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/spectacle/d47ab66eb9a2a0ce7a62dabbc3bf632898186b8e | Version Fixed In: | 18.04.0 |
Description
skaumo
2017-04-05 12:01:35 UTC
I'm going to implement this. I found that one way to get active window's title is to use xdotool. Is it OK to add additional dependency? Hi Roman, good to see you here, didn't know you already picked a bug when I wrote my comment in D10683 ;) I think skaumo got a great idea and it makes sense to implement this feature. (Some ideas in Bugzilla are not so great, so in the future just ask before starting on something, e.g. by opening a task for discussion on https://phabricator.kde.org/project/view/78/). > one way to get active window's title is to use xdotool In general calling external binaries is not the best idea. Could you try to find a C/C++ API for this, e.g. similar to what Spectacle is doing in "src/PlatformBackends/" to get to the image of the screen? I think there must be a way, because e.g. KWin and Plasma's taskbar can show the window title too. Perhaps ask on IRC for tips (but keep in mind that Spectacle must work in a non-Plasma environment too). Git commit d47ab66eb9a2a0ce7a62dabbc3bf632898186b8e by Roman Inflianskas. Committed on 06/03/2018 at 16:43. Pushed by romaninflianskas into branch 'master'. Add optional window title to filename templates Summary: Add '%T' placeholder for filename pattern to insert window title. Example filenames for pattern `%Y-%M-%D %H-%m-%S. %T`: 2018-02-21 19-11-55. romas : byobu.png 2018-02-21 19-12-20.png Example filenames for pattern `%T`: romas : byobu.png Screenshot.png Closes T8036 FIXED-IN: 18.04.0 Test Plan: Steps: # Go to `Configure... -> Save`. # Enter to `Default Save Filename -> Filename` tempate `%Y-%M-%D %H-%m-%S. %T`. # Press `OK`. # Save screenshot. # Observe that screenshot filename matches pattern. Examples of filenames with empty window title: > | Input | Result | > | --- | --- | > | Screenshot_%T_ProjectX | Screenshot_ProjectX | > | %T_ProjectX | ProjectX | > | Screenshot_%T | Screenshot | > | %T | Screenshot | Reviewers: rkflx, #spectacle Reviewed By: rkflx, #spectacle Subscribers: ngraham, rkflx Tags: #spectacle Maniphest Tasks: T8036 Differential Revision: https://phabricator.kde.org/D10709 M +1 -0 doc/index.docbook M +68 -13 src/ExportManager.cpp M +11 -0 src/ExportManager.h M +3 -1 src/Gui/SettingsDialog/SaveOptionsPage.cpp M +1 -0 src/PlatformBackends/ImageGrabber.h M +16 -2 src/PlatformBackends/X11ImageGrabber.cpp M +1 -0 src/PlatformBackends/X11ImageGrabber.h M +4 -2 src/SpectacleCore.cpp https://commits.kde.org/spectacle/d47ab66eb9a2a0ce7a62dabbc3bf632898186b8e |