0

I have read and tried a solution posted in the answer to what is essentially the same question as Is there a way to store the current desktop layout? with the result:

ykarant@equality-HP-ZBook-15-G2:/opt/ykarant$ ./recall-windows -read
Traceback (most recent call last):
  File "./recall-windows", line 87, in <module>
    read_windows()
  File "./recall-windows", line 32, in read_windows
    res = get_res()
  File "./recall-windows", line 26, in get_res
    curr_vpdata = [int(n) for n in vp_data[5].split(",")]
  File "./recall-windows", line 26, in <listcomp>
    curr_vpdata = [int(n) for n in vp_data[5].split(",")]
ValueError: invalid literal for int() with base 10: 'N/A'

Ubuntu 20.04 LTS current, MATE current.

After a "glitch", when the desktop started, all of the icons that represent applications on my desktop were moved about on the desktop, some stacked upon one another. I am looking for a mechanism to "save" the current desktop configuration (not necessarily which applications were open, nor on which Workspace Switcher virtual desktop such applications were open -- merely the actual layout of the desktop icons).

Is there an application or "script" that does this "save and restore" for MATE or for other equivalent GUI interfaces? If the suggestion is to post this item to a MATE list, I will try that as well -- but this more general list might find an "outside MATE" solution of which the MATE list participants might be unaware.

muru
  • 197,895
  • 55
  • 485
  • 740
  • 2
    Are you talking about this answer? https://askubuntu.com/a/645614/158442 if so, why haven't you commented there notifying the poster that you get this error for new versions? – muru Feb 22 '21 at 03:15
  • You are assuming that (1) posting persons still are active and (2) the person who devises a work-around to what should be designed into a system has thereby signed-up to be a permanent maintainer. You also are assuming that the posting person is using the same Ubuntu environment as I do, and thus may not even face this issue. A one-time donation (as in posting a workaround) typically is not regarded as a permanent contribution. I note that you put the actual URL, not the titled link that the question editing application inserts -- is it preferred in these lists to provide the actual URL? – Yasha Karant Feb 22 '21 at 16:53
  • I am not assuming anything - it is simply basic etiquette to try to notify a poster that their answer has problems. Stack Exchange isn't some post-once-and-abandon site - we actively encourage maintenance of existing posts. However, since you mention it, that user is indeed fairly active and responsive: https://askubuntu.com/users/72216/jacob-vlijm?tab=activity As for the URL, links to questions on the same site automatically get converted to use the question title (and update to match edits), so that's the preferred form for question URLs to the same site. – muru Feb 22 '21 at 17:40
  • @Jacob Vlijm Please look at the diagnostic (failure) output when I attempted to use your script (posted in the URL title in my question). 20.04 LTS current, MATE production current. My apologies for violating "etiquette" on this list. I do know that whenever I post a "workaround" I personally cannot "support" the workaround as I do not have technical support staff nor personal free time to be a maintainer. My apologies. – Yasha Karant Feb 22 '21 at 17:51
  • The only user you're notifying here is me. To notify JacobVlijm you have to comment on their post. It would be best if you leave off the useless excuses. – muru Feb 23 '21 at 03:22

1 Answers1

2

Currently we have about four alternative solutions:

  1. Built-in MATE session restore functionality

    To use go to MATE Control Center, select Startup Applications (or directly by mate-session-properties), switch to Options tab and check Automatically remember running applications when logging out and then logout or reboot.
    Limitations: works best mainly with GTK-based applications.

  2. Setup special application named RaySession to your needs.

    Install it by sudo apt-get install raysession

    See its manual for details.
    It is wmctrl-based, so should do the job.
    Limitations: does not restore window geometry.

  3. xsm or xsession-manager project from GitHub

    Relies on wmlctrl too.
    Limitations: none.

  4. Mature Perl script named session. The documentation is located in the Arnon Weinberg's blog.

    Installation is possible by:

    sudo apt-get install wmctrl
    

    wget https://github.com/arnon-weinberg/session/raw/master/session chmod +x session sudo mv session /usr/local/bin

    Then use the following syntax:

    • session save: Save session in default location (see below)
    • session restore existing: Restore geometries of existing windows
    • session restore matching: Restore geometries of matching windows [default]
    • session restore missing: Restore geometries of missing windows

    Limitations: none.

N0rbert
  • 99,918