kwin-scripts / kwin-tiling Goto Github PK
View Code? Open in Web Editor NEWTiling script for kwin
License: GNU General Public License v2.0
Tiling script for kwin
License: GNU General Public License v2.0
I have installed Kubuntu packages via Tasksel on a machine that was originally Xubuntu. After switching to KDE, I installed the kwin-tiling script via the KDE script install dialog.
When I have an external monitor plugged in and set to primary, my secondary monitor (arranged below the primary) does not having tiling. The monitors appear to be part of a single desktop in the virtual desktop pager I have on my main panel.
Just some comments about my experience with multimonitor setup.
I have a huge (32" - 2560x1440) main screen and a very small secondary screen (19" - 1280x1024).
Tiling is only active on my main screen and not on the secondary screen. This is actually fine by me but I'm guessing some people would like to have tiling on both screens. I would like to have a config option that would enable me to choose which monitor tiling is active on and which not. I would even prefer to be able to choose which virtual desktop tiling is enabled on so that I can have one virtual desktop with "normal" floating windows and the rest using tiling (and even some virtual desktops where one monitor is floating but the other one tiling etc.).
The main problem that I'm experiencing though is when I have a window on my secondary monitor and I try to maximize it, it jumps over to the main screen and gets maximized there. Furthermore it messes up the whole tiling of the main monitor.
The script description in kde indicates that:
// These may be removed in future versions, unless there is feedback requesting otherwise
M-h, M-j, M-k, M-l: Switch focus in corresponding direction
M-S-h, M-S-j, M-S-k, M-S-l: Move window in corresponding direction
The first thing that I do with any tiling WM is to change the keybindings to VIM motion keybindings. They are completely natural for VIM users and the main idea of having tiling WMs for me is not to have to use the mouse to move things around.
I also prefer organizing my window layout in a manual way so these motions are perfect for me.
When using onClientGeometryChanged, it's possible that we change the geometry before kwin allocates a pixmap, resulting in kwin not redrawing the client.
We can disable this, but it leads to clients changing their geometry on their own.
OR we could simply resize the tile when the client changes geometry.
The real solution however would be to fix this in kwin.
v1.3.1.2 works fine :)
After I turned kwin-tiling on Kwin keeps crashing often.
Although I installed all available debug symbols ([Install Debug Symbols] button in Crash Reporting Assistant) I can't report issue as I get This crash information is not useful enougth (…) error. I'm attaching traceback I have at the end of this post.
In addition, after turning kwin-tiling on, KDE/Plasma/KWin becomes unresponsive for quite long periods (from a few to several seconds) and generally desktop becomes unusable due to windows not refreshing and/or not changing size properly.
kwin-tiling 1.4
KDE 4.12.2
Fedora 20
I have one desktop and two monitors.
Traceback which is shown in CRA looks like this:
Application: KWin (kwin), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[Current thread is 1 (Thread 0x7fbaac2d5900 (LWP 1903))]
Thread 2 (Thread 0x7fba9d80e700 (LWP 1909)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x0000003ed6d8f09b in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x3ed708df00 <QTWTF::pageheap_memory>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2 0x0000003ed6d8f0d9 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3 0x0000003eb7207f33 in start_thread (arg=0x7fba9d80e700) at pthread_create.c:309
#4 0x0000003eb6af4ded in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Thread 1 (Thread 0x7fbaac2d5900 (LWP 1903)):
[KCrash Handler]
#6 KWin::Client::layoutDecorationRects (this=0x0, left=..., top=..., right=..., bottom=..., mode=mode@entry=KWin::Client::DecorationRelative) at /usr/src/debug/kde-workspace-4.11.6/kwin/client.cpp:554
#7 0x00000032870ffb93 in KWin::PaintRedirector::resizePixmaps (this=0x1711740) at /usr/src/debug/kde-workspace-4.11.6/kwin/paintredirector.cpp:228
#8 0x0000003287069aa0 in KWin::Client::resizeDecoration (this=this@entry=0x19276e0, s=...) at /usr/src/debug/kde-workspace-4.11.6/kwin/client.cpp:670
#9 0x00000032870ae3a8 in KWin::Client::setGeometry (this=this@entry=0x19276e0, x=0, y=0, w=0, h=0, force=force@entry=KWin::NormalGeometrySet) at /usr/src/debug/kde-workspace-4.11.6/kwin/geometry.cpp:1931
#10 0x000000328706c9fb in setGeometry (force=KWin::NormalGeometrySet, r=..., this=0x19276e0) at /usr/src/debug/kde-workspace-4.11.6/kwin/client.h:1216
#11 KWin::Client::qt_metacall (this=0x19276e0, _c=QMetaObject::WriteProperty, _id=7, _a=0x7fff52f8ad60) at /usr/src/debug/kde-workspace-4.11.6/x86_64-redhat-linux-gnu/kwin/client.moc:381
#12 0x0000003ebff8e404 in QMetaProperty::write (this=this@entry=0x7fff52f8ae90, object=object@entry=0x19276e0, value=...) at kernel/qmetaobject.cpp:2364
#13 0x0000003ed6df94aa in QScript::QtPropertyFunction::execute (this=this@entry=0x7fba9c61bf80, exec=exec@entry=0x7fba9c680608, thisValue=..., thisValue@entry=..., args=...) at bridge/qscriptqobject.cpp:1130
#14 0x0000003ed6df96c9 in QScript::QtPropertyFunction::call (exec=0x7fba9c680608, callee=0x7fba9c61bf80, thisValue=..., args=...) at bridge/qscriptqobject.cpp:1065
#15 0x0000003ed6cfdfb0 in QTJSC::NativeFuncWrapper::operator() (this=this@entry=0x7fff52f8b050, exec=exec@entry=0x7fba9c680608, jsobj=0x7fba9c61bf80, thisValue=..., argList=...) at ../3rdparty/javascriptcore/JavaScriptCore/runtime/CallData.cpp:46
#16 0x0000003ed6cfdfff in QTJSC::call (exec=exec@entry=0x7fba9c680608, functionObject=..., callType=<optimized out>, callData=..., thisValue=..., thisValue@entry=..., args=...) at ../3rdparty/javascriptcore/JavaScriptCore/runtime/CallData.cpp:59
#17 0x0000003ed6e027a8 in QScript::QObjectDelegate::put (this=0x1953080, object=0x7fba9c6182c0, exec=0x7fba9c680608, propertyName=..., value=..., slot=...) at bridge/qscriptqobject.cpp:1495
#18 0x0000003ed6cd96df in put (slot=..., value=..., propertyName=..., exec=0x7fba9c680608, this=0x7fff52f8b0f0) at ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h:658
#19 QTJSC::cti_op_put_by_id_generic (args=0x7fff52f8b140) at ../3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp:1224
#20 0x00007fba1003d857 in ?? ()
#21 0x00007fba9c680398 in ?? ()
#22 0x00007fba9c6182c0 in ?? ()
#23 0x00007fba0fcfbf90 in ?? ()
#24 0x0000000000000002 in ?? ()
#25 0x00007fba0d7f4ec0 in ?? ()
#26 0x00007fba9c680398 in ?? ()
#27 0x00007fba9cf16688 in ?? ()
#28 0xffff000000000000 in ?? ()
#29 0xffff000000000002 in ?? ()
#30 0x00007fba10060fd0 in ?? ()
#31 0x00007fba9cf3a858 in ?? ()
#32 0x00007fba9c680608 in ?? ()
#33 0x00007fba9cf16688 in ?? ()
#34 0x0000003ed708ddc8 in QTJSC::ExecutableAllocator::pageSize () from /lib64/libQtScript.so.4
#35 0x00007fba9cf15400 in ?? ()
#36 0x00007fff52f8b2e8 in ?? ()
#37 0x00007fff52f8b2e8 in ?? ()
#38 0xffff000000000000 in ?? ()
#39 0x00007fba9cf16688 in ?? ()
#40 0x0000003ed708ddc8 in QTJSC::ExecutableAllocator::pageSize () from /lib64/libQtScript.so.4
#41 0x00007fba9cf3a840 in ?? ()
#42 0x0000003ed6c92a91 in QTJSC::Interpreter::execute (this=0x7fff52f8b1e0, closure=..., exception=0x7fba9c680608) at ../3rdparty/javascriptcore/JavaScriptCore/jit/JITCode.h:79
#43 0x0000003ed6cf935c in call (this=0x7fff52f8b2c0) at ../3rdparty/javascriptcore/JavaScriptCore/interpreter/CachedCall.h:51
#44 QTJSC::arrayProtoFuncForEach (exec=0x7fba9c680398, thisValue=..., args=...) at ../3rdparty/javascriptcore/JavaScriptCore/runtime/ArrayPrototype.cpp:807
#45 0x00007fba100041b4 in ?? ()
#46 0x00007fba9c680350 in ?? ()
#47 0x0000000000000001 in ?? ()
#48 0x00007fba9c680200 in ?? ()
#49 0x00007fba0fdb7310 in ?? ()
#50 0x00007fba00000001 in ?? ()
#51 0x00007fba00000002 in ?? ()
#52 0x00007fba0d7f4e00 in ?? ()
#53 0x00007fba9c680200 in ?? ()
#54 0x00007fba9cf16688 in ?? ()
#55 0xffff000000000000 in ?? ()
#56 0xffff000000000002 in ?? ()
#57 0x00007fba1000ef20 in ?? ()
#58 0x00007fba9cf3a858 in ?? ()
#59 0x00007fba9c680330 in ?? ()
#60 0x00007fba9cf16688 in ?? ()
#61 0x0000003ed708ddc8 in QTJSC::ExecutableAllocator::pageSize () from /lib64/libQtScript.so.4
#62 0x00007fba9cf15400 in ?? ()
#63 0x00007fff52f8b5a8 in ?? ()
#64 0x00007fff52f8b5a8 in ?? ()
#65 0xffff000000000000 in ?? ()
#66 0x00007fba9cf16688 in ?? ()
#67 0x0000003ed708ddc8 in QTJSC::ExecutableAllocator::pageSize () from /lib64/libQtScript.so.4
#68 0x00007fba9cf3a840 in ?? ()
#69 0x0000003ed6c92a91 in QTJSC::Interpreter::execute (this=0x7fff52f8b4a0, closure=..., exception=0x7fba9c680398) at ../3rdparty/javascriptcore/JavaScriptCore/jit/JITCode.h:79
#70 0x0000003ed6cf935c in call (this=0x7fff52f8b580) at ../3rdparty/javascriptcore/JavaScriptCore/interpreter/CachedCall.h:51
#71 QTJSC::arrayProtoFuncForEach (exec=0x7fba9c680200, thisValue=..., args=...) at ../3rdparty/javascriptcore/JavaScriptCore/runtime/ArrayPrototype.cpp:807
#72 0x00007fba100041b4 in ?? ()
#73 0x00007fba9c6801b8 in ?? ()
#74 0x0000000000000001 in ?? ()
#75 0x00007fff52f8b6d0 in ?? ()
#76 0x00007fba0fcf7b60 in ?? ()
#77 0x00007fba100606c8 in ?? ()
#78 0x0000000000000002 in ?? ()
#79 0x00007fff52f8b780 in ?? ()
#80 0x00007fff52f8b720 in ?? ()
#81 0x00007fff52f8b730 in ?? ()
#82 0x0000003ebfe71c2a in ~QByteArray (this=0x7fff52f8b710, __in_chrg=<optimized out>) at ../../src/corelib/tools/qbytearray.h:401
#83 qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=511, msg=0x7fba100606c8 "I\211E\020\351\023\374\377\377H\211\347L\211l$XI\273 \252\315\326>", ap=0x7fba9c680200) at global/qglobal.cpp:2369
#84 0x00007fba9c61a080 in ?? ()
#85 0x00007fba9cf15400 in ?? ()
#86 0x0000000000000018 in ?? ()
#87 0x0000000000000000 in ?? ()
I'm looking for a simple way to resize a window to the size of half of the screen and to move it to the left or to the right side of the screen, so that I have two windows which fill the screen fully. Works in Windows: Windows-key + arrow left /right. I'd really like to have those shortcuts as well in KDE, and probably many other people would like that as well. So your script probably offers something valuable. Unfortunately it lacks of documentation a bit.
I installed kwin-tiling and went to the configuration menu. I understand that I can add in the first line some programms which will be ignored by kwin-tiling. But there is a second line, where I could add text, if I knew to which purpose?!
And what is the meaning of "Start As Master"?
In the last line of the config is a "0", but I can insert e.g. 15. Could you explain the purpose of that line as well?
I really appreciate your script, but as a more or less dumb user I need documentation, pleeeeaaaase. And when you are on it, could you give me a hint how to get Windows-key plus arrows left / right as shortcuts to arrange two windows side by side?
Thank you!
This is a great script, thank you much for creating it! Exactly what I have been wanting!
My only issue is that the keyboard shortcuts for "Move Window Up" and "Move Window Left" don't work. I'm still a noob with linux, so not sure if I did something wrong; but I would really appreciate any help to get these shortcuts working. Thanks!
It would be good to have some tests so that the project could progress instead of going into circles (assuming it starts moving in the first place :)).
Links of interest
Tutorial 3: Testing Graphical User Interfaces
Squish from Froglogic
This is a followup to #15
right now, tiling assumes that “workspace ID” and “screen ID” correctly identify an area to tile windows in.
but there is a third dimension: activity ID is orthogonal, so windows that are on the same screen and workspace should only be tiled with each other if they are also on the same activity.
See #32 - it'd be nice if some monitors could be set to floating, especially while multimonitor is so borked.
This requires listening to a proper screenChanged signal, otherwise we'd need to go back to the bad old days of watching floating clients, too.
Hi,
since awesome-wm and Plasma 5 don't play well together anymore, I'm looking for an alternative. I'm using kwin-tiling at home with one monitor and I really like it.
However, on multi-monitor setups it manages both screens like one big one. Thus, switching the virtual desktop of a laptop screen also switches the virtual desktop of the standalone screen. I really dislike this behaviour.
Thus, I have to questions:
Thanks for the great plugin btw.
This way, it is clearer which shortcuts are active if and only if kwin-tiling is active.
when opening the dialogs to log out, etc., they get tiled.
if the desktop is empty, they just don’t get vertically centered and instead appear at the top, but if there’s a window, it looks very strange and some buttons are obscured.
The multimonitor branch currently is very out of date, without changes from plasma5 branch, and probably many other things. Are there plans to update this branch or merge it's functionality into master?
Thanks, great script!
FFM selects the wrong client after another closes.
This is a timing issue:
I have a high dpi screen (144dpi) and the config menu is quite messed up (see screenshots).
Maybe the qSizePolicy
[1] is the right way to fix this issue.
Hi,
I've tried installing the script under the new Plasma 5 desktop but can't seem to get it working. I appreciate this isn't a very helpful bug report as it contains no information whatsoever, but I'm not sure what is relevant. I'd be happy to help with alpha/beta testing on plasma 5.
openSuse 13.1, GNU Emacs 24.3.1 (x86_64-suse-linux-gnu, GTK+ Version 3.10.2) of 2013-12-03 on build22, KDE 4.11.3, Kernel 3.12.3
Installed kwin-tiling, activated and tried to have Emacs on one side and okular on the other side of the screen. But Emacs kind of freezes after every command. I can unlock it by klicking on the icon for changing the window size, but you can't work this way, of course.
So maybe you, Fabian, you can have a look into this. At the first moment I was really surprised to see your approach, but probably you are right to use just a script.
Probably most people just wish to have two windows side by side, everything else won't be used much.
KWin freezes in the following usecase.
When minimum three windows are opened in tiling mode (in my case on the left part
one window and two windows on the right part) and I try to maximize one of these windows the desktop freezes.
To debug this attiude I enabled all debug options in 'kdebugdialog'. But neither ~/.xsession-errors nor /var/log/Xorg.0.log contained any error messages.
For me it's reproducable. Can anyone confirm this, too?
My Data:
Kubuntu 14.04 LTS
Qt: 4.8.6
KDE Development Platform: 4.13.1
KWin: 4.11.9
After switching from one desktop to another one (f.e. Ctrl-F1) the further lineup of the
windows change sometimes. F.e. when one window was maximized before another. After switching, both windows have the same size again and were placed next to each other.
Hello.
The assigned shortcuts for resizing windows in SystemSettings/Shortcuts/GlobalKeyboardShortcuts/Kwin just work
for moving windows left and right (Meta+Alt+L/H) but dont for up and down. I already reassigned both but still no reaction.
My versions:
Qt: 4.8.6
KDE Development Platform: 4.13.0
KWin: 4.11.9
add class name. pressing OK. open settings again. list is empty.
When installing kwin-tiling with plasmapkg --type kwinscript --install .
I get a dialog window titled Install Plasma Resources with the following content:
Plasma requires an additional service for this operation
declarativescript script engine
The following service is required. Do you want to search for this now?
[Continue] [Cancel]
When I press Continue button I get the following error
Failed to search for Plasma service
Could not find service in any configured software source
[Close]
How can I fix this?
I'm aware this is Plasma/KDE issue rather than kwin-tiling's one but I guess it's of great interest to people trying to install kwin-tiling and having the same problem.
I've also created issue at https://bugzilla.redhat.com/show_bug.cgi?id=1065688
There are already full on tiling WMs, but it would be cool if users could enable or disable tiling on-the-fly. It's ideal for people who want to try tiling without going all in.
Spirallayout currently does not resize, and I can't figure out the algorithm (which could also be completely layout-agnostic).
Patches welcome.
The gvim window and its content is totally transparent.
Not sure if it is bug in the script or KWin itself; or maybe it is by design? For me this is a disappointment. I hope it can be done.
When borders are turned off for the windows, it's very difficult to see which one is active. It would be nice to add a very thing colored border around the active window if its borders are turned off (that's how it works in xmonad).
Hi, i wanted to propose some ideas:
Sorry for my bad english, and thanks for the great script :)
It'd be swell if all our code could use the same base for desktop numbers, be it 0 or 1.
KWin usually expects 1-based (i.e. numbers like the user expects them), while most of our functions use 0-based.
If we used 1-based, we could of course always subtract 1 when using it as an array index.
If there are windows both in borderless and non-borderless mode in the workspace, or if they are all with borders, this shortcut should make them all borderless.
If they are all borderless, it should make them all with borders.
Opening new windows should consider if in borderless mode or not too.
The script has by default the window classes of plasma; I added the klipper and conky, but still tiles that windows.
KDE 4.13
Ubuntu 14.04
Your script version is: 1.6.2; installed from the master branch of your repository.
IMO this errors makes the tiling useless on KDE, nobody needs to tile the plasma widgets or the klipper window, nor conky.
well, title says it all.
After successfully installing kwin-tiling I discovered, that it makes my browser setup unusable. I use Iceweasel with the vim-mode plugin Pentadactyl. My OS is Debian/testing. All my software is from the usual repositories.
With unusable I mean that Iceweasel is
Since the severity itself may be low since Pentadactyl and kwin-tiling may be not seen together that often, it seems to be a good hint that there might be a bug hidden somewhere.
As we've learned in #18 and in various comments, this script can be fairly confusing, especially for users new to tiling.
I propose (and will probably also implement, but anyone reading this feel free to help) to create more/better documentation and to do it in one place. Since I don't have any actual site of my own, I'll probably do it here on github, and the README.org is a good start.
So, what needs to be documented?
Hi,
I am unable to install this script on Debian Testing. Following the description changes nothing besides that the folder is copied to somewhere else. Did you mean plasmapgk2 instead of plasmapkg?
I manually copied the folder to ~/.local/share/kservices5/ which made the 'Tiling Extension' turn up at Systemsteuerung -> Fensterverwaltung -> KWin-Scripte. It's German but since some here seem to be native German speakers I did not translate in order to avoid mistakes. However, when I try to open the settings it says Das Modul liefert am erwarteten Speicherort keine Konfigurationsdatei.
Do I do something wrong?
It looks like the tiling extension available for download in Window management > Kwin scripts does not work with Kubuntu 15.04/Plasma 5.
I like this plugin but the concept of pre-made layouts (one master on the side and splits on the other) is something I find lacking in flexibility. Is there a way to have a layout that allows me to split vertically or horizontally any section at will?
In xmonad when there are some windows in the left part of the screen and others in the right part of the screen, you can press meta+h/meta+l to shrink one side of the screen and expand the other.
IT would be good if kwin tiling could do the same. Maybe use only meta+j/k to switch between windows and meta+h/l to resize them?
I am not sure how this relates to #9. Most times I open gVim or a couple other programs (just happened with Shutter), the tiling layout will make room for the new window. I can see the background image only until I resize the window or the other ones.
This is pretty annoying as I always have to do something like maximize and un-maximize with every gVim window that I use.
This is what it looks like:
You can see how the KSnapshot window is still visible even though it should be hidden while taking the screenshot. I guess that the gVim window there is not properly repainted.
I'm asking out of curiosity and in the context of
One of the early (created in 1988) tiling WMs was Siemens' RTL, up to today a textbook example because of its algorithms of automated window scaling, placement and arrangement, and (de)iconification
from http://en.wikipedia.org/wiki/Tiling_window_manager
When a new instance of already opened app is being run and automatically put as a tab in the window of already running instance – because System Settings|Window Behavior|Advanced|Automatically group similar windows option is enabled – the original window is resized as if the newly opened window was separate from the original one and needed extra screen space.
Today I am no longer able to use the script, as it makes KWin unable to start. I want to help with this one so please tell me what do you need to know to debug this problem. Results of what commands should I post?
One of the awesome things I liked when using tilling window managers is focus follows mouse, which is easy enough to do in KDE. (Systemsettings -> Window Behaviour)
However, if I switch a windows' focus via a shortcut key (Alt+Tab, for instance), I'd like the mouse to jump to the center of the newly focused window.
Or would this be more appropriate as a separate script?
My only way to use multimonitor is to connect my laptop to my tv, so multimonitor is almost completely untested.
Patches welcome.
I just tried to install it on a fresh user on Kubuntu 15.04 with the instructions given. It will give the following:
pluginname: "kwin-script-tiling"
-- Copying "/home/tiling/.local/share/plasma/plasmoids/kwin-script-tiling/metadata.desktop" "/home/tiling/.local/share/kservices5/plasma-applet-kwin-script-tiling.desktop"
Could not register package as service (this is not necessarily fatal): "plasma-applet-kwin-script-tiling.desktop"
Successfully installed /home/tiling/kwin-tiling
When I try the --list
command, it does not list your script. It is shown in the KDE Systemsettings, though. When I try to access the configuration, it will tell me that the script does not provide a configuration file in a default location.
Am I doing something wrong? How can I install this on Plasma 5 on Kubuntu 15.04?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.