I have a load of virtual desktops running and I usually have one full screen application per desktop (so sort of like the Ratpoison WM but with an option to use it in other ways when needed). I want new windows to automatically be put in certain desktop numbers when they start up. What's the easiest way to do this?
How to Distribute Windows Over Virtual Desktops in GNOME
gnomemetacitywindow-manager
Related Solutions
Ok, found this for X windows:
FVWM Forums • View topic - Thumbnailing a Window on another Viewport
As to why you can't access a window (that is, take a picture of it when it is not on the same desk/page as the current viewport) is because windows that are not on the current page are unmapped. This is true when one changes pages/desks -- the windows are unmapped, and the windows on the current viewport are remapped.
So, I guess that means what I want is impossible? Although there are two workarounds:
- use
xrandr
to increase the virtual size of (each of the four) viewports
This is what works for me - first query to see which output you want, then execute:
$ xrandr -q
Screen 0: minimum 320 x 200, current 1024 x 600, maximum 4096 x 4096
LVDS1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x600 60.0*+
800x600 60.3 56.2
640x480 59.9
VGA1 disconnected (normal left inverted right x axis y axis)
$ xrandr --output LVDS1 --panning 1600x768
... see also X/Config/Resolution - Ubuntu Wiki
- Use
xvfb
for virtual render
Got this via x11 - Remote offscreen rendering - Server Fault, also see Xvfb - Wikipedia, the free encyclopedia for examples. This is what worked for me - each command goes in own terminal (as some of them are meant to be services)
# start xvfb as display 1 - note the "screen 0" there refers to "its own" screen 0; should set it to 24-bit color
Xvfb :1 -screen 0 1600x1200x24 -pixdepths 3 -fp /usr/share/fonts/X11/Type1
# start metacity on display 1 (would start gdm, but [Bug #598848: gdm no longer works with xvfb](https://bugs.launchpad.net/bugs/598848)
# needed to we have title bars, and possibility to move windows around
DISPLAY=:1 metacity
# start application (here web-browser arora) again on display 1
DISPLAY=:1 arora
# start vnc server, which will bridge display 1 to port 5900
# note - this command exists, however starts a server in background
x11vnc -display :1 -bg -nopw -listen localhost -xkb
# start vnc viewer on port 5900 - so we can see display 1:
# note also - when vncviewer exits, it also will kill the x11vnc server
vncviewer -FullColor=1 localhost:5900
The problem here is that not all parts of the OS are initialized - so there are no window decoration, and only basic X fonts; although, apps may find their own fonts, as seen below:
xvfb
looks almost ideal to me - since I could basically set up an "invisible" environment, as big as I want, and take screenshots directly from it (using xwd
). The problem is that I cannot have a window on "my" DISPLAY=:0, then switch it to the 'virtual' DISPLAY=:1 for screenshotting, then bring it back to DISPLAY=:0. Then one must set up an application specifically for xvfb
; and if so happens you need more size - then the whole chain above needs to be restarted.
On the other hand, I find working with 4 workspaces and large viewports (shwere the mouse moves you around within a viewport) a bit confusing - then again, can change the size there on the fly and nothing needs to be restarted; and plus I can use any of the usual screenshot tools (but I'd still have to switch viewports).
Needless to say, I'd still love to hear about a possible command line solution that could do this kind of screenshotting in one go :)
Tiling (snapping) windows can be enabled or disabled under Settings > Window Manager Tweak > Accessibility
.
But it seems that snapping windows to the margins of the screen becomes difficult or impossible when the changing of workspaces by dragging the window is also activated in "wrap workspaces when reaching the screen edge" - "with a dragged window" under 'Settings > Window Manager > Advanced' because the two actions interfere and the workspace-changing has precedence when the edge resistance level is very close to "small".
It seems to me a bit too much to ask that the same action (dragging a window to the screen edge) should be able to trigger without problems two different results.
To avoid the interference use a different option for workspace:"wrap workspaces when reaching the screen edge" - "with the mouse pointer" - if you must keep a screen edge action for changing workspaces.
Or even disable it completely. That will certainly ensure window snapping/tilling:
If the option "wrap workspaces when reaching the screen edge" - "with a dragged window" is enabled but the edge resistance is increased towards "wide", the window snapping/tiling takes complete precedence and at this point it's the "wrap workspaces" action that is not achieved at all.
Finding the edge resistance level where both actions are easily accessible is possible, but not very practical in my opinion, as you often get one instead of the other. (That may also depend on the hardware as well as human factor.)
Summing it up:
In order to get the window tiling working:
Be sure you have it enabled in Window Manager Tweaks->Accessibility.
Disable "wrap workspaces when reaching the screen edge" - "with a dragged window" under Settings > Window Manager > Advanced OR keep it enabled but set the edge resistance wide enough to make the tiling take precedence over wrapping workspaces.
My version of xfwm4: 4.12.3-2.
Best Answer
If you're using Compiz, install
compizconfig-settings-manager
, activate the "Place Windows" plugin, and in the "Fixed Window Placement" tab, you can adjust which windows should default to which viewport.