2

I was wandering if there are some programs or methods, where I can do something similar like Terminal multiplexer - Wikipedia, the free encyclopedia - except where each region of the "multiplexer" application is a GUI window of an application all its own.

Here is an imaginary example - I'd, basically, like to write in terminal something like this (pseudocode):

$ gui-multiplexer-application --width 600 --height 600 \
  --command "scite" --heightratio 60
  --command "gnome-terminal -e 'PS1=\"$\"'" --heightratio rest

... which would, in turn, start up something like this (that image I montaged manually in Gimp):

gui-mplex

I don't need any methods to specifically connect these applications (if a command can be started with arguments, then I could use that) - what I would like is that both windows are moved in sync when you drag the master ("gui-multiplexer-application") window title bar; and hopefully, that the horizontal separator line is draggable, so one can readjust the height that the inner windows take up respectively (readjusting the width through the master bounds goes without saying, I guess).

Anything like this out there? (I'm on Ubuntu 11.04 with Gnome2; however, I imagine this kind of application would work on an X11 level, thus being hopefully portable between different DE/WM. )

EDIT: This is somewhat like a tiling window manager - however, a proper tiling window manager replaces the entire desktop; I instead would like a tiling window manager inside a window with a titlebar (which can appear in any other WM I may otherwise be using). In fact, one could use scripts like awesome_test in Using Xephyr - awesome, but they start a whole new X session, so there are interaction problems like grabbing keyboard inputs, and not being able to find the "regular" desktop environment styling. Which is why I'm looking for a similar functionality, but which works within a single application window. (Also possibly related: sticking stickies to windows - Unix & Linux Stack Exchange)

(Backround: I like writing Latex in Scite; and while Scite does have a terminal window, on my version it is non-interactive - so if latex ends up with an error, I cannot issue a Ctrl-C or X or anything to have the process terminate; so I have to use a proper terminal anyways. Now, there is geany which actually does have a proper terminal, but I don't want to change text editors for this application (Latex writing). I'm sure there could the other situations where this "GUI window multiplexing" would be useful, though. )

  • 1
    Although a non-portable answer by definition, I believe this is the purpose of tiling window managers <- perhaps some of those can be used with GNOME. – goldilocks Feb 19 '14 at 14:08
  • Thanks for the comment @goldilocks - problem with tiling window managers like awesome is that they change the entire desktop environment paradigm (vs. what I'm used to); I'd basically like a tiling window manager only inside a scalable (floating) window with a titlebar, which I can move around - while it keeps the positions of the inner applications in sync; added clarification to OP. Thanks again - cheers! – sdaau Feb 19 '14 at 14:15
  • 2
    If you're willing to switch window managers, there are a few that can do it, for example Sawfish. – Gilles Feb 19 '14 at 23:37
  • Thanks @Gilles - never heard of Sawfish before, will make sure to check it out; but I am unwilling to make a switch at the moment (though surely at a later stage), which is why I thought an application would work great in the meantime.. Cheers! – sdaau Feb 20 '14 at 4:12
1

Well, here is something, but hardly ideal:

I just found https://github.com/ponty/PyVirtualDisplay; and as I had both Xephyr and awesome-wm installed, I could put up a Python script which starts up the following relatively easily:

pyvirtualdisplay-xephyr.png

Obviously, my usual desktop environment style (as in the OP pic) is missing - and you cannot scale the window (change window size: width and height, by dragging). Then, there is no interactive "pane resize" handlebar for changing the relative heights of the applications, either. And most importantly - copy/paste of text between applications inside and outside Xephyr does not work!

Also, the script starts up awesome-wm in hope that it would tile my applications automatically - but for some reason it doesn't do that, so I have to size the applications manually using wmctrl. But, the inner windows lack title bars, which I think is awesome-wm's doing; so probably it will be possible to set up with tiling, eventually.

Here is the script - let's call it tilewm-app-tester.py:

from easyprocess import EasyProcess
from pyvirtualdisplay import Display
#~ from pyvirtualdisplay.smartdisplay import SmartDisplay # needs pyscreenshot
import logging
logging.basicConfig(level=logging.DEBUG)
import time

_W = 600
_H = 500
# height percents
hp1 = 0.6
hp2 = 1-hp1 # the rest


Display(visible=1, size=(_W , _H)).start()

# EasyProcess.start() # spawns process in background
# EasyProcess.check() # loops process in foreground


try:
  EasyProcess('awesome -c rc.lua').start() 
except Exception, detail:
  print  detail

time.sleep(2)

try:
  EasyProcess('bash -c "cd $HOME && scite"').start() 
except Exception, detail:
  print  detail

time.sleep(2)

try:
  # 0,x,y,w,h
  EasyProcess(['wmctrl', '-r', 'SciTE', '-e', '0,0,0,'+str(_W)+','+str(int(_H*hp1))]).start() 
except Exception, detail:
  print  detail

# gnome-terminal -e 'bash -c "bash --rcfile <(echo source $HOME/.bashrc ; echo PS1=\\\"\$ \\\") -i"'
# first `bash` needed, otherwise cannot do process substitution as file

try:
  EasyProcess(['gnome-terminal', '-e', 'bash -c "bash --rcfile <(echo source $HOME/.bashrc ; echo PS1=\\\"\$\ \\\") -i"']).start() # --maximize is Gnome, nowork
except Exception, detail:
  print  detail

time.sleep(0.5)

try:
  # 0,x,y,w,h
  EasyProcess(['wmctrl', '-r', 'Terminal', '-e', '0,0,'+str(int(_H*hp1))+','+str(_W)+','+str(int(_H*hp2))]).start() 
except Exception, detail:
  print  detail
1

Actually this is the very purpose of so-called "Tiling Window Managers" i.e. Awesome, as apposed the classic "Floating Window Managers" i.e. Gnome2.

So yeah, I think to do what you want to do you're going to need to upgrade from gnome to something a bit more hardcore. But believe me, you won't want to go back after you've experienced what these other Window Managers can offer. Be sure to get familiar with the hotkeys...

This photo is an example of tiling Window Manager

Popular Tiling Window Managers are listed here:

https://wiki.archlinux.org/index.php/Comparison_of_tiling_window_managers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.