Smart trimming of window titles#9
Conversation
Add a new preference, "Smart title trimming". In the list of previews for an application, this shortens the titles of the windows in that application by removing common prefixes and suffixes from those titles. For example, if you have some Terminal windows open, with titles: ``` stuart@machine: ~ - Terminal stuart@machine: ~/Pictures - Terminal stuart@machine: ~/Documents - Terminal stuart@machine: ~/.local/share - Terminal ``` then these will likely be too long to be shown in their entirety in the window list. This preference changes the displayed titles in the window list to remove the common substrings at start and end, so the entries in the list would look like this: ``` … ~ … … ~/Pictures … … ~/Documents … … ~/.local/share … ``` The preference defaults to off. It's named "Smart title trimming" because more technical descriptive names such as "Remove common prefix and suffix from preview window titles" sound confusingly "techie".
|
I think this is a bit radical. It would be too confident to assume that all common prefix/suffix in titles is meaningless to all users. In my opinion, the current implementation of automatically setting the ellipsize mode according to the position of common text appears is good enough for most users. |
|
Fair enough! I can only tell you that I find the current setup difficult for Terminal windows, because the window list looks like this: and that's not very helpful. (The preview width adjustment doesn't change the width of the menu when there aren't visual previews). But I understand that this is maybe an unusual case and there's no need to have something in the main codebase to deal with it. (It is a preference, of course, so "smart title trimming" needs to be turned on in the preferences window; it wouldn't affect anyone unless they want it to.) Is this maybe something I can fix for myself with a plugin of some kind? Then I could write myself a plugin and install it and it wouldn't affect the base code. But I don't know whether it's possible to have plugins for dockbarx. |
It seems that you have not upgraded the dockbarx packages to And you can also change the width of title without touch the preview size |




Please note: this pull request is not intended for merging in its current state! This is to provide a basis for discussion, after the fixes suggested in #8.
In particular, I can't be sure this works. The title trimming works (I tested that), but now that I've added a new preference to the gsettings schema, I can't start up my version of dockbarx any more because it now throws an error:
Settings schema 'org.dockbarx.dockbarx' does not contain a key named 'preview-trim'. I don't know how to use my "updated" gsettings schema without forcing it to install instead of the standard one, and that will break the actual installation of dockbarx that I have on my desktop! So this is a proposal, which you might want to think about, and decide whether you like it, and maybe make changes to. The full description is below.Add a new preference, "Smart title trimming".
In the list of previews for an application, this shortens the titles of the windows in that application by removing common prefixes and suffixes from those titles. For example, if you have some Terminal windows open, with titles:
then these will likely be too long to be shown in their entirety in the window list. This preference changes the displayed titles in the window list to remove the common substrings at start and end, so the entries in the list would look like this:
The preference defaults to off. It's named "Smart title trimming" because more technical descriptive names such as "Remove common prefix and suffix from preview window titles" sound confusingly "techie".