Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I really like xterm and could really like XFCE, but the two don't seem to play well together. In KDE if I log out and back in, my xterms will be restarted in the same position as when I left. It will restart xterms but they all open in the center of the screen, not in their normal positions.

This is particularly important to me because on my laptop I usually run with 19 xterms, 4 on each of 4 different workspaces, each workspace with a different foreground color to help me with context, and another 3 on another workspace. Having all 19 open in the middle of one workspace is quite aggravating.

I've tried using xfce4-terminal, which does save it's position, but it has no way to disable the secondary screen (when doing "less" or "vim", and exiting, it gets rid of the "less" output and switches the terminal back to how it was, the ti/te termcap capabilities). The secondary screen really annoys me, but all of the "new" terminals like xfce or gnome seem to have no way to disable this like xterm does. And just setting a "LESS" environment variable to disable this isn't enough because as often as not I'm working on one of a couple hundred remote servers. I've tried setting my terminal type to "vt100", which prevents this but also disables colors, which I really rely on in vim for syntax highlighting.

It feels like I'm being really picky, but I sure would love to be able to use XFCE and have a terminal that both remembers where it was and doesn't do the screen switching. :-)

share|improve this question

3 Answers 3

up vote 3 down vote accepted

I'm not entirely sure what has happened, but this has started working. I'm writing up some notes on it in case anyone else runs across it and this helps. I've also gotten confirmation from another that xterm positions are restored under Ubuntu 10.10.

Some details: I'm running XFCE 4.6 as provided by Ubuntu 10.10. XFCE version 4.6 includes a much improved session manager, which may explain why saving/restoring position works under XFCE 4.6 where it didn't under previous versions I had tried. However, it definitely wasn't working for both Chromium and xterm over several reboots with 4.6.

Earlier today I rebooted the system and my XFCE panel disappeared, even after logging out and back in. I manually ran "xfce4-panel" and my panel came back. It looked slightly different, but definitely was my panel -- my clock settings and applications were there, it's in the right position and size (lower right, not full width). Also, the "logout" button changed from a circle with a stick (the international power button symbol) to a green guy running through a white door.

At this point, if I log out and back in, my xterm and chromium positions are restored on login.

One thing I do note is that if I "ps awwlx | grep xfce4-panel", that it includes an "--sm-client-id" argument with a long identifier after that. I wonder if the panel somehow wasn't involved in session management before.

One possibility may be that I copied some files from my laptop over to my home directory in this system and maybe this preserved some settings for XFCE from an old version I tried long ago? I've tried to be fairly selective about what I've copied over, but I'm just mentioning it as it's one of the only things I can think of that might be different from a stock Ubuntu 10.10 install.

I spent quite a bit of time today reading through the xterm code, X11R6 session management information and XSMP documentation, and from everything I saw it sounded like xterm should be doing the session management.

Finally, it might also have been from the Applications -> Settings -> Xfce 4 Settings -> Session and Startup -> Advanced, the "Launch KDE services on startup" I had disabled, and then re-enabled later. If you run into this problem and GNOME or KDE are disabled in this box, try enabling it.

share|improve this answer

All the information about the geometry of the Xterm windows is, unsurprisingly, accessible through the X11 command-line utilities: you can run xprop on either the window ids of the processes or on their names. The output is not of a form you can use to launch the xterms when you restart X11, but I've used programs based on parsing this information to provide a commands that can be launched from the .xinitrc file. The trouble with running a window manager is that it has its own ideas about what should happen when you start your X11 desktop and you have to work around its assumptions.

Some pointers:

  1. xprop manpage;
  2. Using the .Xdefaults file. Purdue CS laboratory info that gives information about xprop's output;
  3. SO qn, Getting pid and details for topmost window, which gives information on getting hold of X11 window ids.
share|improve this answer
2  
I used to use .xinitrc, back in the <gasp> '80s :-), bt for some reason that I don't fully understand I've been trying to use the session manager instead. Mostly it's because I remember the pain of tweaking the geometry strings to get everything just right. Nice idea though, I've never used xprop before, but could see it being nice for setting up the xinitrc. I see it gives the size, but don't see the position, so I'll have to dig into that more. Thanks. –  Sean Reifschneider Dec 5 '10 at 20:36
    
While this wasn't ultimately the solution I used, this was the best answer excluding mine, so I awarded the bounty here. Thanks for the answers! –  Sean Reifschneider Dec 9 '10 at 17:54

A fairly old post I found on the Arch Linux forums suggests:

Adjust the "Minimum size of windows to trigger smart placement" slider under Settings -> Window Manager Tweaks -> Placement

I just tried it on Xubuntu 10.10, and although it does not save the xterm window locations, it does prevent them from overlapping by default.

share|improve this answer
    
Thanks for the suggestion, but in my case I have 19 xterms spread out across 5 workspaces, so smart placement won't help with that. ;-/ –  Sean Reifschneider Dec 5 '10 at 2:04
    
As far as I'm aware, Xfwm does not save positions for anything, so I think your best option would be to go with a different window manager. Just tried metacity, same results. –  oKtosiTe Dec 5 '10 at 2:16
2  
I think you're mistaking Xfwm and XFCE. XFCE will definitely save positions of applications via the X11R6 session management protocols and xfce4-sessions –  Sean Reifschneider Dec 5 '10 at 10:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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