I’ve tried to figure out as much as I can, but still am unable to get it working using plasma-interactiveconsole --kwin
My version of Firefox is a flatpak. In System monitor ‘Processes’ it shows up as firefox-bin. In the ‘Applications’ menu it’s ‘org.mozilla.firefox’, but points to ‘org.mozilla.firefox.desktop’. I’ve played around with different changes to the script but so far it hasn’t worked when hitting the ‘Execute’ button. Below is what I’ve thought was the most correct version. However, please point out anything that’s not correct.
function onWindowAdded(win) {
if(win.resourceName == “org.mozilla.firefox” && win.resourceClass == “org.mozilla.firefox”){
console.log(“org.mozilla.firefox added!”)
var timer = new QTimer();
timer.timeout.connect(function() {
let geom = Object.assign({}, win.frameGeometry);
geom.height = 1,376
geom.width = 1,588
geom.x = 704
geom.y = 50
win.frameGeometry = geom
});
timer.interval = 1000; // milliseconds
timer.singleShot = true;
timer.start(5)
}
}
workspace.windowAdded.connect(onWindowAdded);
I’m also experiencing this issue on NixOS. It works fine on my other machine running Gentoo.
Is anyone else here by any chance also running NixOS? That would help further isolating the problem. If yes, I have some news: The firefox-unwrapped package does not seem to be affected, although you will have to create your own desktop file etc.
Another thing I noticed: It can also be fixed by either setting privacy.resistFingerprinting=true in about:config or disabling the feature to reopen previous tabs on startup.
to get the correct values of resource name and class, try printing these values for all your windows (firefox must be open):
for(const w of workspace.windowList()){
console.log("resourceName: ", w.resourceName, "\t\t resourceClass: ", w.resourceClass)
}
in order to get the printed values, use journalctl:
$ journalctl /usr/bin/kwin_wayland -f
Finally got it testing properly, then installed. I logged out and back in and it’s working as expected ![]()
One problem was that there is no ‘win.resourceName’. So I had to make that a blank. I was also adding “,” as a one-thousand separator. So getting rid of that finally provided the correct sizing.
Thank you very much!
Glad that it worked!