linux-window-session-manager: Most of applications don't recover

  • Ubuntu 19.04
  • Node v10.16.3

Opera:

zerdox@zerdox-A320M-H:~$ lwsm restore
Status: "Opera developer.Opera developer" is running: false 1 0
Starting: Opera developer.desktop
Status: "google-chrome-unstable.Google-chrome-unstable" is running: false 1 0
Starting: google-chrome-unstable.desktop
Status: "gnome-terminal-server.Gnome-terminal" is running: true 1 0
Wait for all applications to start
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn Opera ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Visual Studio:

zerdox@zerdox-A320M-H:~$ lwsm restore
Status: "gnome-terminal-server.Gnome-terminal" is running: true 1 0
Status: "Opera developer.Opera developer" is running: true 1 0
Status: "code - insiders.Code - Insiders" is running: false 1 0
Starting: code - insiders.desktop
Wait for all applications to start
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn code ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

I guess 19.04 is not supported? Any alternatives?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (8 by maintainers)

Most upvoted comments

And using xprop in this case is bad practise:

zerdox@zerdox-A320M-H:~$ xprop | grep "WM_CLASS(STRING)"
WM_CLASS(STRING) = "Opera developer", "Opera developer"

But I would need “Opera developer.Opera developer”

I tried just to copy result of xprop and just put dot between to names, but this is not working with other apps, it’s more reliable to copy name from lwsm log after saving session

How to recognise problem:

  • Your applications can’t restore (e.g. Error: spawn Opera ENOENT)
  • When you save session there are a lot of lines of text (screenshot below)

image

DO NOT TRUST LAST LINE SAVED SESSION: test — that’s not true.

How to fix problem:

  1. Find name of your application in this log (e.g. “Opera developer.Opera developer”) image

  2. Find .desktop file of your application

    • You can do it like this from cli: locate *<keyword of application's name>*.desktop
      zerdox@zerdox-A320M-H:~$ locate *opera*.desktop
      /usr/share/applications/opera-developer.desktop
      
    • Or you can locate into your applications directory and find it there: image
  3. Write name of your application from first paragraph and your .desktop file’s name into ~/.lwsm/config.json like this Find “WM_CLASS_AND_EXECUTABLE_FILE_MAP” object and put in it a new value

"WM_CLASS_AND_EXECUTABLE_FILE_MAP": {
    ...
    ...
    "Opera developer.Opera developer": "opera-developer.desktop",
},
  1. Save session again (make sure you have closed every window except problematic application)
zerdox@zerdox-A320M-H:~$ lwsm save test
SAVED SESSION: test

Now, when you got only one line SAVED SESSION: test you can restore session. Now you have added this application to config.

If you will try to save and restore session with two or more problematic apps, your config.json may resets to it’s default, you need to add applications one by one.

And finally, when you have added all apps to config, you can use lwsm correctly.