Adds user configurable Winprops tab to PaperWM extension settings ui#463
Conversation
Updated README.md and added table with some Winprop descriptions. Added special case Winprop value for preferredWidthStep = 3 which maximises the window on creation.
Defining a ratio seems cleaner and is then independent of the useful width steps (which is user configurable).
with units "px" or "%" (e.g. "50%" or "500px" etc.)
…exists (avoids duplicates). Means if multiple for the same wm_class are defined (for some strange reason) then will take the last one. Updated comments and the WARNING for unvalid units. Lastly, being more strict on the units (previously was lowercasing them so 'PX', 'Px', 'pX' would still work...).
new `preferredWidth` window property. Left reference to not currently being able to set the window height.
doubling up each spec in array).
WIP: adding list of json objects to schema. Addresses regex defined wm_class, serialise as string and the deserialise to create valiid RegExp before passing to defwinprop. Added functions to add winprops (from gsettings) and also remove gsetting winprops. Added initial version of WinpropsRow. Signals connected in tiling ready for winprop updating when winprops change. Removed old debug log entry. Added validation on inputs for WinPropsRow settings. Adding a row inserts at top and expands. Implemented searching - searches on wm_class and accelLabel. Improved view. Added several tooltips.
in the PaperWM extension settings.
|
@smichel17 @ccope @Gelbana @tadfisher - requesting thoughts, code review and/or testing (pretty pretty please!). This PR allows users to set their custom winprop settings in the extension settings ui and have them apply immediately (no more needing to restart gnome in X11 or gasp logout/login in wayland). |
filter function now searches in wm_class, title, and accelLabel (whether is scratch_layer or preferred width setting).
|
Hey @Gelbana, hope you're doing well! I added a request for review from you as I saw you had worked on some winprop related stuff previously. Keen to have you look through this PR if you're keen / when you're able to! |
|
I can't see any obvious issues (but I'm not too experienced with JS so take that with a grain of salt). One thing I found was an inconsistency with how the user.js and UI defined winprops interact when both contain rules that match the same window. For example:
Clarification regarding the priority of user.js and UI defined settings may be useful to add to the readme. |
Thanks so much @Gelbana! - good points too re cases where both To make things more consistent - maybe we have Either that, or the other way around - have settings defined winprops always take precedent. The advantage of that is that it's much easier to change the settings winprops (applies instantly) rather than changing what do you think? Either way I'll update the README.md to clarify preference order. |
defined winrprops. This was done since gsetting winprops as easier to add/remove/edit than user.js winprops (and can be added/removed/edited instantly without restarting shell). Hence, if a user want to fallabck to user.js winprops they simply need to delete the equivalent settings defined winprop (if it was the other way around then the user would have to restart the shell).
b79e343 to
c738d9b
Compare
|
Hey @Gelbana, I've now made the changes discussed above. To be consistent, winprops defined in the settings ui take precedence over winrprops defined in We do this by ordering winprops defined in the settings ui before those added via Feel free to do another test. Once you're happy could you please then Thanks! P.S. I also updated the |
|
Thanks @Gelbana! |
|
I think this is good, but incomplete.
Also, with regard to |
|
Thanks @smichel17, Just wondering if you're running what was merged? "Title" was added a few weeks back in this commit . I suppose I should update the video to reflect that.
Yeah, I toyed with moving the
Anyways, a button to reload I agree, create a new issue for this one as it may require some refactoring to address this. |
I really like this - will make it a ton easier as, yes, it's often a pain find |
Caught me 😆. I did a pretty quick review and only looked at the comments here (not even the code).
I think it's probably more convenient than my suggestion for creating the winprop rules. However, it's probably not something you're going to use most of the time, so it would clutter up the menu. For that reason, I'd rather not do it, unless you can only show the option when the settings dialog is open (in which case, yeah, opening the settings, then right click on another window -> "create rule for this window" would be awesome).
I think it would be a good idea to discourage people from putting code in Partially we're just running afoul of gnome's extension design here (lack of any extension api, requiring extensions to take care of disabling themselves, not having a way to start fresh). There's some extent to which I don't think it's the best use of our effort to work around gnome's limitations. That also applies to winprops a little— if looking glass were easier to use, we wouldn't need to solve this problem. |
All good!
Yeah, I agree, looking glass is a pain, and has some weird behaviour for me. Anyways, showing a list of windows in the settings ui (for user to select and have it populate wm_class or title) seems a better approach here.
Agree - never liked putting these in |
Fixes #462, closes #453, closes #304.
This PR adds a new tab to the PaperWM extensions settings ui that allows users to:
wm_classortitle) to open on scratch by default;wm_classortitle) width - supports both%andpxinput values;Notes:
preferredWidthproperty is ignored if a window is set toscratch_layer;wm_classortitleinput will not be applied/persisted (they won't show when you open the preference settings next time);user.jsconfiguration (which you can still do);Feedback super welcome!
See it in action in the video below (click the play button):
paperwm-winprops-settings.mp4