Big Screen
Kwin Scripts
Score 54%
Description:

Feeling insufficient?
If you install this, your Pen... errrr... Screen will become very large.


It sort of implements the NETWM Large Desktop concept as exists in eg. fvwm.

The active screen edges trigger a shift of "normal" windows, similar to "xrandr --panning", but the desktop etc. stay in place (and the "size" is not limited by the GPU when compositing)

The shift is by default 50% of the smallest screen width/height, ie. eg. the upper half becomes the lower half and the lower half drops out of the screen. This can easily be changed in the script source.

It's also different from the stacked virtual desktops as implemented in KWin in that you can make windows randomly large and shift the viewport (windows lap over to the next "notvirtualdesktop")

--- TODO:
- handle activities
- make a config GUI?

--- Comments:
"I installed this and my P... Screen grew HUUGE and now I can please all the gir... windows and no longer feel insufficient!"
-- Anonymous User

--- Disclaimer:
Any other growth is not guaranteed.
Other things might actually shrink - and I deny responsibility for such!
=)
Last changelog:

3 years ago

1.3
-----
* added option to align to the panning grid (affects window activation)

1.2
----
* only move currentTab (ie. a tabgroup once instead of n times)

1.1
------------
* added shortcuts
* added config GUI (script needs to be reloaded to update config!)
* allow to only use vertical or horizontal edges or neither

herrbatka

1 year ago

hi, does this work with plasma 5?

Report

C

thomas12777

1 year ago

Supposingly. The script API didn't change, but I didn't actually test the script.

Report

herrbatka

1 year ago

Yes it works fine (besides config UI). BTW, this works:

var isOnCurrentActivity = function(client) {
for (var i = 0; i < client.activities.length; ++i)
{
if (client.activities[i] === workspace.currentActivity)
{
return true;
}
}
return false;
}

Report

herrbatka

3 years ago

Hi, I was getting annoyed by the center on screen and how it was messing my layout so I improved it a bit:

var centerActive = function(client) {
if (!client || client.desktopWindow || client.dock)
return;
if (client.x + client.width < 1 || client.x > workspace.displayWidth ||
client.y + client.height < 1 || client.y > workspace.displayHeight) {
var area = workspace.clientArea(KWin.ScreenArea, workspace.activeScreen, 0);
var dx = area.x + (area.width - client.width)/2 - client.x;
var dy = area.y + (area.height - client.height)/2 - client.y;
var tx = Math.round(dx / shiftX());
var ty = Math.round(dy / shiftY());
translateClients(tx*shiftX(), ty*shiftY());
}
}

Report

C

thomas12777

3 years ago

Thanks for sharing the idea.
If you look at the code, I altered it a bit, as it's legit to re-use vars and otoh shiftX/Y() should be cached (though it's not a hot path ;-)

Report

herrbatka

3 years ago

thanks, i don't know java script.

Report

herrbatka

3 years ago

I found one small problem related to the script: it treats window groups like a individual windows, so for instance group of two windows is moved twice by the 50% (100% total) instead of being moved only once by the 50%.

Report

C

thomas12777

3 years ago

Thanks for the notice - should be fixed with latest update.

Report

herrbatka

3 years ago

wow, that was fast! I didn't expect you to fix it just for me :D

Thanks. Tabbing feature introduces extra cases almost everywhere but I really like it.

Report

herrbatka

3 years ago

I'm wonder if it would be possible to add option to have keybind for scrolling desktop. For instance meta. Screen would be scrolled only if you are holding meta pressed.

Report

C

thomas12777

3 years ago

No.
It would be possible to add global shortcuts (so that you scroll without the mouse but by pressing a shortcut), but invocation of a modifier would require changes to the KWin core (what's probably not in the cards for KDE SC4)

Report

herrbatka

3 years ago

I think that I would prefer global shortcuts over current behavior. A lot of mouse travel and accidental edge hits are not very helpfull at all.

Report

herrbatka

3 years ago

Thanks.

It seems that configuration button is missing, but shortcuts works well and I disabled electric border in the code. Now I'm happy. :)

Report

C

thomas12777

3 years ago

How did you install the effect?
If installed with plasmapkg, scripts require a "-t kwinscript") to resolve this correctly. No idea whether i miss some metainfo or plasmapkg simply always requires this.

No idea about GHNS

plasmapkg -t kwinscript -u bigScreen.kwinscript

Report

herrbatka

3 years ago

I used GHNS. And there is no button, as I said.

Report

C

thomas12777

3 years ago

Ahhh, that's stupid.

Plasma/GHNS will install the script into the "wrong" location (it's detected, but config stuff won't work) unless the metadata say it's "kwinscript", but if they do, kwin won't load the script (expects "javascript") -> kwin bug, it seems (should look for kwinscript, not javascritp)

For proper installation, uninstall the script, download the file and install it as

plasmapkg -u bigScreen.kwinscript -t kwinscript

Report

herrbatka

3 years ago

yup, you are right.

BTW: This script is extreamly useful. I used to like this behavior long time ago, during fvwm days. It's nice to see this in KDE with the help of just few lines of code :-)

Report

herrbatka

3 years ago

One more thing: how this works? I used to think it basicly moves windows, but this appears to be more complex thing.

Report

C

thomas12777

3 years ago

No, it actually just moves windows around.
There's some multiscreen handling code and exclusion of windows on other virtual desktops (and yakuake), but that's more or less it.
And it of course centers a window out of sight on activation (by moving all windows accordingly)

Report

herrbatka

3 years ago

Ok, congrats. This is impressive hack :D

But I find it actually usefull, good job.

Report

herrbatka

3 years ago

Cool script! But it should be called "Enlarge Your Screen" instead ;-)

Report

C

thomas12777

3 years ago

I also thought about "Swedish-made screen enlarger pump" - but i'm not swedish :-P

Report

3 years ago

1.3
-----
* added option to align to the panning grid (affects window activation)

1.2
----
* only move currentTab (ie. a tabgroup once instead of n times)

1.1
------------
* added shortcuts
* added config GUI (script needs to be reloaded to update config!)
* allow to only use vertical or horizontal edges or neither

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
1.3
updated Mar 08 2014
added Feb 01 2014
downloads today
0
page views today 0