Code Monkey home page Code Monkey logo

linux-window-session-manager's People

Contributors

alanivey avatar andrewmackrodt avatar curiousercreative avatar dependabot[bot] avatar gabx avatar johannesjo avatar kpost avatar mattgrayisok avatar nkovshov avatar rodrigoatorres avatar sitnarf avatar tecfu avatar ybnd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux-window-session-manager's Issues

Not positioning new official microsoft teams app

I've added to config.json line for using microsoft teams official app.
This is the class:
WM_CLASS(STRING) = "microsoft teams - preview", "Microsoft Teams - Preview"

I've added to lwsm config:
"microsoft teams - preview.Microsoft Teams - Preview":"/usr/bin/teams"

EXPECTED:
Opening and positioning Microsoft teams desktop.
BEHAVIOUR:
It only opens,doesn't position it. But, if it is previously opened to the lwsm restoring, it is positioned.

lwsm unable to restore eclipse window across two monitors

I am trying to find a solution to automatically restore my eclipse window layout in a two monitor setup.

LWSM seems to be close to what i want. It places the eclipse (4.7) window on the correct left screen, but it fails to restore the widht of the window to cross both screens. It seems to be blocked by the screen size of the left screen while resizing the window. The width of the window is not restored to 3831as stated in the session file.

I am using gnome under Ubuntu 18.04.

Any hints of fixing this?

Kind regards

My session file:

{
  "name": "TwoMon",
  "displaysCombinations": [
    {
      "id": "1920x1080;1920x1080",
      "windowList": [
        {
          "windowId": "0x280000b",
          "windowIdDec": 41943051,
          "states": [],
          "wmCurrentDesktopNr": 1,
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 17492,
          "wmClassName": "Enpass.Enpass-Desktop",
          "x": 0,
          "y": 87,
          "width": 960,
          "height": 536,
          "simpleName": "Enpass-Desktop",
          "executableFile": "Enpass.desktop",
          "desktopFilePath": "/home/hcw/.local/share/applications/Enpass.desktop"
        },
        {
          "windowId": "0x5200003",
          "windowIdDec": 85983235,
          "states": [],
          "wmCurrentDesktopNr": 0,
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 23464,
          "wmClassName": "xfce4-terminal.Xfce4-terminal",
          "x": 62,
          "y": 162,
          "width": 1814,
          "height": 788,
          "simpleName": "Xfce4-terminal",
          "executableFile": "xfce4-terminal.desktop",
          "desktopFilePath": "/usr/share/applications/xfce4-terminal.desktop"
        },
        {
          "windowId": "0x4e00010",
          "windowIdDec": 81788944,
          "wmCurrentDesktopNr": 1,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 27452,
          "wmClassName": "Navigator.Firefox",
          "x": 1920,
          "y": 55,
          "width": 1920,
          "height": 992,
          "simpleName": "Firefox",
          "executableFile": "firefox.desktop",
          "desktopFilePath": "/usr/share/applications/firefox.desktop"
        },
        {
          "windowId": "0x58001d3\n",
          "windowIdDec": 92275155,
          "wmCurrentDesktopNr": 0,
          "states": [
            "_NET_WM_STATE_FOCUSED"
          ],
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 8367,
          "wmClassName": "Eclipse.Eclipse",
          "x": 3,
          "y": 59,
          "width": 3831,
          "height": 988,
          "simpleName": "Eclipse",
          "executableFile": "eclipse-47.desktop",
          "desktopFilePath": "/home/hcw/.local/share/applications/eclipse-47.desktop"
        }
      ]
    }
  ]
}

Please add support for org.gnome.*desktop to default search matching

Please can you add support for native gnome apps by prepending org.gnome to the .desktop file that is searched for.
Example : gedit.desktop is actually stored as org.gnome.gedit.desktop

Your Environment

  • Version used:
  • Operating System and version: Ubuntu 18.10
  • Desktop Environment: Gnome 3.30
  • Node version: 11.2.0

Expected Behavior

I'd like the search pattern to also match by pre-pending org.gnome to the generated desktop filename

Current Behavior

Does not find the .desktop file because the file is actually prepended with org.gnome.
To get a complete list run find / -name 'org.gnome*.desktop' 2>/dev/null

Steps to Reproduce (for bugs)

  1. Open some native gnome apps like gedit / calculator / logs
  2. Run lwsm save test
  3. Errors are logged that the .desktop file cannot be found.

saveSession(): An error occurred Error: could not load data

lwsm save test
saveSession(): An error occurred Error: could not load data
at /usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:209:15
at ReadFileContext.callback (/usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:94:16)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
(node:11836) UnhandledPromiseRejectionWarning: Error: could not load data
at /usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:209:15
at ReadFileContext.callback (/usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:94:16)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
(node:11836) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11836) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
SAVED SESSION: test

it used to work just fine shortly ago just saving the session without any errors, when i kept saving the same configuration (i was testing something related to other issue) it started throwing this error.

all latest versions

Error while restoring: Unhandled 'error' event

I only opened Chrome and saved the state.

lwsm save
 0x2e00002 has no wmClassName. Win:  { windowId: ' 0x2e00002',
  windowIdDec: 48234498,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
0x2e00005 has no wmClassName. Win:  { windowId: '0x2e00005',
  windowIdDec: 48234501,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
0x2e00008 has no wmClassName. Win:  { windowId: '0x2e00008',
  windowIdDec: 48234504,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
0x2e0000b has no wmClassName. Win:  { windowId: '0x2e0000b',
  windowIdDec: 48234507,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
0x2e0000c has no wmClassName. Win:  { windowId: '0x2e0000c',
  windowIdDec: 48234508,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
SAVED SESSION: DEFAULT

Then I rebooted and tried to restore it:

lwsm restore
 0x2e00002 has no wmClassName. Win:  { windowId: ' 0x2e00002',
  windowIdDec: 48234498,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
0x2e00005 has no wmClassName. Win:  { windowId: '0x2e00005',
  windowIdDec: 48234501,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
0x2e00008 has no wmClassName. Win:  { windowId: '0x2e00008',
  windowIdDec: 48234504,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
0x2e0000b has no wmClassName. Win:  { windowId: '0x2e0000b',
  windowIdDec: 48234507,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
0x2e0000c has no wmClassName. Win:  { windowId: '0x2e0000c',
  windowIdDec: 48234508,
  wmCurrentDesktopNr: 0,
  wmPid: 1704,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
Status: "gnome-terminal-server.Gnome-terminal" is running: true 1 0
Status: "google-chrome.Google-chrome" is running: false 1 0
Starting: "/usr/share/applications/google-chrome.desktop"
Wait for all applications to start
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn "/usr/share/applications/google-chrome.desktop" ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Michael

lwsm save doesn't work

My Environment

  • Version used: 3.0.1
  • Operating Systtem and version: 18.04.3 LTS(ubuntu), gnome-shell(3.28.4)
  • Desktop Environment:
  • Node version: v12.10.0
    I followed guide provided by this article article.

After installation, I wanted to save my session using 'lwsm save' command in gnome shell, I got below error instead.

(node:13700) UnhandledPromiseRejectionWarning: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds at boundsError (internal/buffer.js:70:11) at Buffer.readUInt32LE (internal/buffer.js:206:5) at Buffer.unpack (/home/user/.npm-packages/lib/node_modules/linux-window-session-manager/node_modules/x11/lib/unpackbuffer.js:44:32) at /home/user/.npm-packages/lib/node_modules/linux-window-session-manager/dist/index.js:589:45 at step (/home/user/.npm-packages/lib/node_modules/linux-window-session-manager/dist/index.js:63:23) at Object.next (/home/user/.npm-packages/lib/node_modules/linux-window-session-manager/dist/index.js:44:53) at /home/user/.npm-packages/lib/node_modules/linux-window-session-manager/dist/index.js:37:71 at new Promise (<anonymous>) at __awaiter (/home/user/.npm-packages/lib/node_modules/linux-window-session-manager/dist/index.js:33:12) at _decodeProperty (/home/user/.npm-packages/lib/node_modules/linux-window-session-manager/dist/index.js:542:12) (node:13700) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:13700) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I can't understand meaning of RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds at boundsError. Is this for not enough ram?

node.js error

After installing lwsm I ran save and got the following error:
$ lwsm save
/usr/bin/env: ‘node’: No such file or directory

I tried doing install nodejs-legacy but then got
$ lwsm save
/usr/local/lib/node_modules/linux-window-session-manager/lib/x11-wrapper.js:38
return Promise.resolve(...arguments);
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:8:17)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)

Save and Restore both crash when I have a Google Hangouts window open

My Environment

  • Version used: Linux Window Session Manager 3.0.7
  • Operating System and version: Ubuntu 18.04 bionic (x86_64 Linux 5.0.0-37-generic)
  • Desktop Environment: GNOME 3.28.2
  • Node version: 13.0.1
  • List of Applications that are open (lwsm save) or should be opened (lwsm restore):
    • Slack
    • Tilix
    • SmartGit
    • VSCode
    • GEdit
    • Google Chrome
    • Google Hangouts (Chrome extension; creates its own window)

Expected Behavior

Typing lwsm save should work.

Current Behavior

As long as the Hangouts extension window is open, lwsm save will actually never terminate - it will hang indefinitely and I will have to Ctrl - C to kill it. But not before first printing out the following error messages:

findDesktopFile cant find file; searched patterns []
Generic Error in Meta Wrapper findDesktopFile cant find file; searched patterns undefined
Generic Error in Meta Wrapper findDesktopFile cant find file; searched patterns undefined
Generic Error in Meta Wrapper findDesktopFile cant find file; searched patterns undefined
Generic Error in Meta Wrapper findDesktopFile cant find file; searched patterns undefined
(node:11486) UnhandledPromiseRejectionWarning: findDesktopFile cant find file; searched patterns
(node:11486) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:11486) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Steps to Reproduce (for bugs)

  1. Install LWSM
  2. Install Google Chrome
  3. Install the Google Hangouts extension for Chrome
  4. Click the Hangouts button in Chrome to pop open a new window
  5. Type lvsm save

Windows are not restored to their initial desktop in Gnome 3

Great job, everything is almost working perfectly !

Your Environment

  • Version used: 3.0.8
  • Operating System and version: Ubuntu 18.04
  • Desktop Environment: Gnome 3
  • Node version: 12.10
  • List of Applications that are open (lwsm save) or should be opened (lwsm restore): VSCode

Expected Behavior

Ideally, each window would open at its exact desktop

Current Behavior

All VSCode windows are open on the same desktop instead of going back to their respective desktops.

Steps to Reproduce (for bugs)

  1. My desktop number is fixed, I have 6 desktop. Eventually switch from flexible number of desktops to a fixed number.
  2. Open 3 VSCode windows on 3 different desktop, save, close then restore.

Error while restoring: Cannot read property windowId of undefined

Hey,
I've tried running lwsm save just before rebooting, and then lwsm restore.
The save worked, and the restore opened the old windows, but then didn't put them into their place. The command line showed the following error:

Status: "google-chrome.Google-chrome" is running: false 8 0
Starting: google-chrome.desktop
Status: "google-chrome.Google-chrome" is running: false 8 0
Starting: google-chrome.desktop
Status: "google-chrome.Google-chrome" is running: false 8 0
Starting: google-chrome.desktop
Status: "google-chrome.Google-chrome" is running: false 8 0
Starting: google-chrome.desktop
Status: "google-chrome.Google-chrome" is running: false 8 0
Starting: google-chrome.desktop
Status: "gnome-terminal.Gnome-terminal" is running: false 4 0
Starting: gnome-terminal.desktop
Status: "nautilus.Nautilus" is running: false 1 0
Starting: nautilus
Status: "google-chrome.Google-chrome" is running: false 8 0
Starting: google-chrome.desktop
Status: "google-chrome.Google-chrome" is running: false 8 0
Starting: google-chrome.desktop
Status: "google-chrome.Google-chrome" is running: false 8 0
Starting: google-chrome.desktop
Status: "gnome-terminal.Gnome-terminal" is running: false 4 0
Starting: gnome-terminal.desktop
Status: "gnome-terminal.Gnome-terminal" is running: false 4 0
Starting: gnome-terminal.desktop
Status: "gedit.Gedit" is running: false 1 0
Starting: gedit.desktop
Status: "gnome-terminal.Gnome-terminal" is running: false 4 0
Starting: gnome-terminal.desktop
Wait for all applications to start
All applications started
An error occurred TypeError: Cannot read property 'windowId' of undefined
    at savedWindowList.forEach (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:444:55)
    at Array.forEach (<anonymous>)
    at updateWindowIds (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:439:19)
    at closeAllWindowsIfSet.then.then.then.then.then.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:205:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Generic Error in Main Handler TypeError: Cannot read property 'windowId' of undefined
    at savedWindowList.forEach (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:444:55)
    at Array.forEach (<anonymous>)
    at updateWindowIds (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:439:19)
    at closeAllWindowsIfSet.then.then.then.then.then.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:205:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) TypeError: Cannot read property 'windowId' of undefined
    at savedWindowList.forEach (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:444:55)
    at Array.forEach (<anonymous>)
    at updateWindowIds (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:439:19)
    at closeAllWindowsIfSet.then.then.then.then.then.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:205:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:7925) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'windowId' of undefined
(node:7925) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I am using node v8.9.1 on Ubuntu 14 with Unity.

The session file looks like this:

{
  "name": "DEFAULT",
  "displaysCombinations": [
    {
      "id": "1920x1200;1920x1200",
      "windowList": [
        {
          "windowId": " 0x2e00017",
          "windowIdDec": 48234519,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmCurrentDesktopNr": 0,
          "wmTitle": "\"STTCacheDashboard:copy_stt_config.borgcron.borg - Cider - Google Chrome\"",
          "wmClassName": "google-chrome.Google-chrome",
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 139287,
          "x": 0,
          "y": 0,
          "width": 1920,
          "height": 1174,
          "simpleName": "Google-chrome",
          "executableFile": "google-chrome.desktop",
          "desktopFilePath": "/usr/share/applications/google-chrome.desktop"
        },
        {
          "windowId": "0x2e00018",
          "windowIdDec": 48234520,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmCurrentDesktopNr": 0,
          "wmTitle": "\"https://cnsviewer2.corp.google.com/cns/ql-d/home/blue-ginger-prod/stt_cache/active_cache.json - Google Chrome\"",
          "wmClassName": "google-chrome.Google-chrome",
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 139287,
          "x": 1920,
          "y": 0,
          "width": 1920,
          "height": 1200,
          "simpleName": "Google-chrome",
          "executableFile": "google-chrome.desktop",
          "desktopFilePath": "/usr/share/applications/google-chrome.desktop"
        },
        {
          "windowId": "0x2e00019",
          "windowIdDec": 48234521,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmCurrentDesktopNr": 2,
          "wmTitle": "\"(9) Jayceeoh - Elevate ft. Nevve (Mashd N Kutcher Remix) - YouTube - Google Chrome\"",
          "wmClassName": "google-chrome.Google-chrome",
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 139287,
          "x": 1920,
          "y": 0,
          "width": 1920,
          "height": 1200,
          "simpleName": "Google-chrome",
          "executableFile": "google-chrome.desktop",
          "desktopFilePath": "/usr/share/applications/google-chrome.desktop"
        },
        {
          "windowId": "0x2e0001a",
          "windowIdDec": 48234522,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmCurrentDesktopNr": 1,
          "wmTitle": "\"Untitled Script - #plx - Google Chrome\"",
          "wmClassName": "google-chrome.Google-chrome",
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 139287,
          "x": 1920,
          "y": 0,
          "width": 1920,
          "height": 1200,
          "simpleName": "Google-chrome",
          "executableFile": "google-chrome.desktop",
          "desktopFilePath": "/usr/share/applications/google-chrome.desktop"
        },
        {
          "windowId": "0x2e00422",
          "windowIdDec": 48235554,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmCurrentDesktopNr": 3,
          "wmTitle": "\"BG Player - Google Chrome\"",
          "wmClassName": "google-chrome.Google-chrome",
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 139287,
          "x": 0,
          "y": 0,
          "width": 1920,
          "height": 1174,
          "simpleName": "Google-chrome",
          "executableFile": "google-chrome.desktop",
          "desktopFilePath": "/usr/share/applications/google-chrome.desktop"
        },
        {
          "windowId": "0x3a0000c",
          "windowIdDec": 60817420,
          "states": [],
          "wmCurrentDesktopNr": 3,
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 58386,
          "wmClassName": "gnome-terminal.Gnome-terminal",
          "x": 2295,
          "y": 200,
          "width": 1186,
          "height": 653,
          "simpleName": "Gnome-terminal",
          "executableFile": "gnome-terminal.desktop",
          "desktopFilePath": "/usr/share/applications/gnome-terminal.desktop"
        },
        {
          "windowId": "0x3c0003c",
          "windowIdDec": 62914620,
          "states": [],
          "wmCurrentDesktopNr": 3,
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 58941,
          "wmClassName": "nautilus.Nautilus",
          "x": 525,
          "y": 358,
          "width": 855,
          "height": 550,
          "simpleName": "Nautilus",
          "executableFile": "nautilus"
        },
        {
          "windowId": "0x2e004dd",
          "windowIdDec": 48235741,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmCurrentDesktopNr": 1,
          "wmTitle": "\"Add PLX scripts to monitor the active STT Cache - CL 178758366 - Google Chrome\"",
          "wmClassName": "google-chrome.Google-chrome",
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 139287,
          "x": 0,
          "y": 0,
          "width": 1920,
          "height": 1174,
          "simpleName": "Google-chrome",
          "executableFile": "google-chrome.desktop",
          "desktopFilePath": "/usr/share/applications/google-chrome.desktop"
        },
        {
          "windowId": "0x2e008a8",
          "windowIdDec": 48236712,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmCurrentDesktopNr": 4,
          "wmTitle": "\"servomatic_tests.ipynb - Colaboratory - Google Chrome\"",
          "wmClassName": "google-chrome.Google-chrome",
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 139287,
          "x": 0,
          "y": 0,
          "width": 1920,
          "height": 1174,
          "simpleName": "Google-chrome",
          "executableFile": "google-chrome.desktop",
          "desktopFilePath": "/usr/share/applications/google-chrome.desktop"
        },
        {
          "windowId": "0x2e008b8",
          "windowIdDec": 48236728,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT"
          ],
          "wmCurrentDesktopNr": 4,
          "wmTitle": "\"TFX:extract_intent.py - Cider - Google Chrome\"",
          "wmClassName": "google-chrome.Google-chrome",
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 139287,
          "x": 1920,
          "y": 0,
          "width": 1920,
          "height": 1200,
          "simpleName": "Google-chrome",
          "executableFile": "google-chrome.desktop",
          "desktopFilePath": "/usr/share/applications/google-chrome.desktop"
        },
        {
          "windowId": "0x3a1c97c",
          "windowIdDec": 60934524,
          "states": [
            "_NET_WM_STATE_MAXIMIZED_HORZ",
            "_NET_WM_STATE_MAXIMIZED_VERT",
            "_NET_WM_STATE_HIDDEN"
          ],
          "wmCurrentDesktopNr": 4,
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 58386,
          "wmClassName": "gnome-terminal.Gnome-terminal",
          "x": 1920,
          "y": 28,
          "width": 1920,
          "height": 1172,
          "simpleName": "Gnome-terminal",
          "executableFile": "gnome-terminal.desktop",
          "desktopFilePath": "/usr/share/applications/gnome-terminal.desktop"
        },
        {
          "windowId": "0x3a24f00",
          "windowIdDec": 60968704,
          "states": [],
          "wmCurrentDesktopNr": 4,
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 58386,
          "wmClassName": "gnome-terminal.Gnome-terminal",
          "x": 2435,
          "y": 282,
          "width": 1186,
          "height": 653,
          "simpleName": "Gnome-terminal",
          "executableFile": "gnome-terminal.desktop",
          "desktopFilePath": "/usr/share/applications/gnome-terminal.desktop"
        },
        {
          "windowId": "0x3000029",
          "windowIdDec": 50331689,
          "states": [],
          "wmCurrentDesktopNr": 4,
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 51633,
          "wmClassName": "gedit.Gedit",
          "x": 626,
          "y": 355,
          "width": 650,
          "height": 500,
          "simpleName": "Gedit",
          "executableFile": "gedit.desktop",
          "desktopFilePath": "/usr/share/applications/gedit.desktop"
        },
        {
          "windowId": "0x3aca32a\n",
          "windowIdDec": 61645610,
          "states": [
            "_NET_WM_STATE_FOCUSED"
          ],
          "wmCurrentDesktopNr": 0,
          "wmType": "_NET_WM_WINDOW_TYPE_NORMAL",
          "wmPid": 58386,
          "wmClassName": "gnome-terminal.Gnome-terminal",
          "x": 500,
          "y": 378,
          "width": 1186,
          "height": 653,
          "simpleName": "Gnome-terminal",
          "executableFile": "gnome-terminal.desktop",
          "desktopFilePath": "/usr/share/applications/gnome-terminal.desktop"
        }
      ]
    }
  ]
}

The top bar offset doesn't know when there is 2nd monitor with no top bar.

So it's smart that it takes into account the top bar and offsets the windows according to it BUT when you have 2nd monitor that has no top bar, it still does it.
So if you've placed your windows so they take the full 2nd monitor, save it, then restore it it positions them lower as if there is top bar when there is not.

So you have to manually readjust after each restore.

"wmCurrentDesktopNr" ignored by some applications

Your Environment

  • Version used: 2.1.20
  • Operating System and version: ArchLinux 4.15.7
  • Desktop Environment: GNOME shell 3.26.2
  • Node version: 9.8.0

Expected Behavior

Application is opened on (virtual) Desktop with number "wmCurrentDesktopNr" as specified in the session`s config file.

Current Behavior

For most applications, this works. Some applications always work on the current desktop. Observed with e.g. Gitkraken.

Steps to Reproduce (for bugs)

Save a session with applications being on different virtual desktops.
Restore the session.

How do I debug this? Would be glad to help find the problem.

lwsm ignoring gnome-terminal

Your Environment

  • Version used: 2.1.21
  • Operating System and version: Ubuntu 18.04.1 LTS
  • Desktop Environment: 3.28.3
  • Node version: 3.5.2

Expected Behavior

lwsm save, lwsm restore
save layout of gnome-terminal windows, then restore

layout of gnome-terminal is restored

Current Behavior

lwsm save, lwsm restore
It looks like that gnome-terminal is not even saved to json config

Steps to Reproduce (for bugs)

  1. open several gnome-terminals
  2. lwsm save
  3. close gnome-terminals
  4. lwsm restore

lwsm saves applications to session even when it can't find their path

Your Environment

  • Version used: 2.1.31
  • Operating System and version: Ubuntu 18.04
  • Desktop Environment: GNOME 3
  • Node version: v8.10.0

When running lwsm save, it fails to save some apps that aren't mapped yet. I'm was OK with that because I was testing, so I didn't fix them. I figured it would ignore them.

Expected Behavior

lwsm save should not include apps that it won't be able to re-open in the session.

Current Behavior

lwsm save includes all detected apps, even those for which it encountered an error during save, in the session file, then tries (and fails) to restore them.

Workaround is to open apps manually and run lwsm restore until it works.

Steps to Reproduce (for bugs)

  1. Install an unsupported app like Toggl Desktop https://github.com/toggl/toggldesktop/releases
  2. lwsm save
  3. Restart (or just close some apps)
  4. lwsm restore

You wind up with something like:

⋊> ~ lwsm restore                                                                                                                                                                                          10:09:59
Status: "crx_pofoocnjclhmhkhkgibipddgekdlnfmj.Brave-browser" is running: true 1 0
Status: "crx_ddiddklncfgbfaaahngklemobghhjkim.Brave-browser" is running: true 1 0
Status: "brave-browser.Brave-browser" is running: true 1 0
Status: "Telegram.TelegramDesktop" is running: true 1 0
Status: "caprine.Caprine" is running: true 1 0
Status: "discord.discord" is running: true 1 0
Status: "TogglDesktop.Toggl Desktop" is running: false 1 0
Starting: TogglDesktop.desktop
Status: "terminator.Terminator" is running: true 1 0
Status: "slack.Slack" is running: true 1 0
Status: "Mail.Thunderbird" is running: true 2 0
Status: "Mail.Thunderbird" is running: true 2 0
Status: "sun-awt-X11-XFramePeer.jetbrains-phpstorm" is running: true 1 0
Status: "todoist.Todoist" is running: true 1 0
Wait for all applications to start
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn TogglDesktop.desktop ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

btw, this actually works better than I expected. I didn't realize it'd set window positions (or I just forgot), and the running app detection is great! I was worried about my startup apps getting in the way. Useful tool!

Input Handler Error: No input for desktop file path

Hi Johannes,
I've experienced some error with lwsm:

$ lwsm save
otherCmd: Generic Error 0
Input Handler Error:  No input for desktop file path
SAVED SESSION: DEFAULT

It appears when I try save session with opened google-chrome or atom editor.
I use Ubuntu 16.04.02 LTS and his GNOME 3.18.5.
I'd like to help you, so tell me what I can do to provide you more info about this error.

autocomplete

What about command-line completion?
I think about action and session name completion.
Omelette may be a good lib to implement this.

Doesn't work with workspaces - all windows are restored to first ws

Your Environment

  • Version used: not sure how to find this (lwsm -v / --version don't do anything)
  • Operating System and version: Ubuntu 19.04
  • Desktop Environment: Gnome 3.32.1
  • Node version: 8.11.3
  • List of Applications that are open (lwsm save) or should be opened (lwsm restore):

Expected Behavior

Restoring a saved session should restore apps/windows to the 'workspace' they were in when saved.

The README says it works with virtual desktops, so I was hoping this means with Gnome workspaces, but it seems they may be different?

Current Behavior

All apps/windows are restored to the first workspace, rather than the ones from where they were saved.

Doesn't work with Brave Browser-created "Chrome" apps

Your Environment

  • Version used: 2.1.28
  • Operating System and version: Ubuntu Linux 18.04
  • Desktop Environment: Default (GNOME 3?)
  • Node version: v8.10.0

Expected Behavior

"Apps" created by using More tools -> Create shortcut in Brave should be saved properly.

Current Behavior

This happens:

$ lwsm save
findDesktopFile cant find file; searched patterns [ '/home/kevin/.local/share/applications/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/home/kevin/.local/share/applications/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/home/kevin/.gnome/apps//*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/home/kevin/.gnome/apps//**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/usr/share/applications/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/usr/share/applications/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/usr/local/share/applications/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/usr/local/share/applications/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/usr/share/app-install/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/usr/share/app-install/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/home/kevin/.config/autostart//*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/home/kevin/.config/autostart//**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/var/lib/snapd/desktop/applications/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/var/lib/snapd/desktop/applications/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/var/lib/flatpak/app/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/var/lib/flatpak/app/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/snap/bin/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop',
  '/snap/bin/**/*chrome-pofoocnjclhmhkhkgibipddgekdlnfmj*.desktop' ]
util: Generic Error findDesktopFile cant find file; searched patterns undefined
util: { '0': 'findDesktopFile cant find file; searched patterns' }
Generic Error in Meta Wrapper TypeError: Cannot read property 'split' of undefined
    at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) TypeError: Cannot read property 'split' of undefined
    at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Generic Error in Meta Wrapper TypeError: Cannot read property 'split' of undefined
    at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) TypeError: Cannot read property 'split' of undefined
    at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Generic Error in Meta Wrapper TypeError: Cannot read property 'split' of undefined
    at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) TypeError: Cannot read property 'split' of undefined
    at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:31016) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
    at findDesktopFile.then (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:194:35)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:31016) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:31016) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Steps to Reproduce (for bugs)

  1. Install Brave Browser from https://brave.com/download/
  2. Go to any site. http://example.com will do
  3. Click the menu under the minimize/maximize/close buttons at the top-right of the window
  4. Under "More tools", click "Create shortcut" and choose "Open as window" in the dialog that pops up.
  5. Once done, ensure the app is open and try lwsm save.

Notes

The issue is that Brave saves the files with a brave- prefix instead of a chrome- one. So you need to check WM_CLASS(STRING) for something like:

WM_CLASS(STRING) = "crx_hppgbgfhlaeddfkdifgnpndnccffohpn", "Brave-browser"

Here we see "Brave-browser" in the second position. It wasn't immediately clear to me how to modify the program to do this, since by that point in the pipeline we're already dealing with a filename, and I wasn't sure if the WM_CLASS value was still in scope anywhere.

Example Brave filename: /home/kevin/.local/share/applications/brave-ddiddklncfgbfaaahngklemobghhjkim-Default.desktop

I can work around this by just changing the prefix manually. It doesn't seem to break the apps (haven't tried uninstalling one yet; unsure if it would fail to clean up the desktop file).

Please add '/snap/bin' to default search path

Using the latest lwsm package, I've rewritten the config to search /snap/bin and changes atom.Atom and mailspring.Mailspring classes' executables to 'atom' and 'mailspring' atop the entries for "WM_CLASS_AND_EXECUTABLE_FILE_MAP".

I'm using Ubuntu 18.10 minimal install. please let me know ifyou need more detail. thank you. it's a nice and more than welcome package for gnome.

Pass args to the application to open

Hello.

Really great work on this tool. Its exactly what I was looking for, ;)

I would like to be able to start for example a specific website in Google Chrome or run some command when launching the terminal application that were saved in the session. Its possible to specify arguments, for example in the "executableFile" field of the session json file?

I dont except the application to be able to save stuff like Open tabs, when saving the session, but its a thing I can easily do manually if needed.

Thank you.

otherCmd: Generic Error 0

Running in Ubuntu 16.04 gives errors:

~ lwsm save
otherCmd: Generic Error 0
Input Handler Error: No input for desktop file path
otherCmd: Generic Error 0
Input Handler Error: No input for desktop file path
SAVED SESSION: DEFAULT

And no session created.

Error when restoring; related to launching of Atom editor

Your Environment

  • Version used:
  • Operating System and version:
  • Desktop Environment:
  • Node version:

Expected Behavior

Atom editor (installed via snap/Ubuntu store) opens successfully on lwsm restore

Current Behavior

Throws an error:

Generic Error in Main Handler Error: could not load data
    at /usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:209:15
    at ReadFileContext.callback (/usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:94:16)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13) Error: could not load data
    at /usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:209:15
    at ReadFileContext.callback (/usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:94:16)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
(node:4107) UnhandledPromiseRejectionWarning: Error: could not load data
    at /usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:209:15
    at ReadFileContext.callback (/usr/local/lib/node_modules/linux-window-session-manager/node_modules/jfs/lib/Store.js:94:16)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
(node:4107) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4107) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Interesting note: When I first open the atom editor, and then type the lwsm restore command, no errors are thrown and Atom is put in the place/desktop where I want it to go.

Thus I suspect that it has to do with lwsm not being able to find Atom in the EXECUTABLE_PATH in the config file.

I have already tried changed the config file to include paths to atom.desktop, but nothing worked. (also, /snap/bin is already there)

Current workaround:

Open Atom first then run lwsm restore without trouble.

Steps to Reproduce (for bugs)

  1. lwsm save with Atom editor (and Terminal)
  2. Close Atom editor
  3. lwsm restore => throws error
  4. Open Atom editor
  5. lwsm restore => no error, places Atom in the correct workspace and position as expected

Install problem on ubuntu 19.10 node 10.15.2 npm 5.8.0

npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN checkPermissions Missing write access to /usr/local/lib
npm ERR! path /usr/local/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/benoit/.npm/_logs/2019-10-22T13_52_33_379Z-debug.log
  benoit@benoit  ~ 

on linux mint mate every running application is being detected as appname.desktop

maybe thats a mate thing but this makes the script fail because those files do not actually exist

locate mate-terminal.desktop { [Error: Command failed: /bin/sh -c locate mate-terminal.desktop
/bin/sh: 1: locate mate-terminal.desktop: not found
]
  killed: false,
  code: 127,
  signal: null,
  cmd: '/bin/sh -c locate mate-terminal.desktop' }
otherCmd: Generic Error { [Error: Command failed: /bin/sh -c locate mate-terminal.desktop
/bin/sh: 1: locate mate-terminal.desktop: not found
]
  killed: false,
  code: 127,
  signal: null,
  cmd: '/bin/sh -c locate mate-terminal.desktop' } Error: Command failed: /bin/sh -c locate mate-terminal.desktop
/bin/sh: 1: locate mate-terminal.desktop: not found

    at ChildProcess.exithandler (child_process.js:213:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:821:16)
    at Socket.<anonymous(internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)
otherCmd: { '0': 
   { [Error: Command failed: /bin/sh -c locate mate-terminal.desktop
   /bin/sh: 1: locate mate-terminal.desktop: not found
   ]
     killed: false,
     code: 127,
     signal: null,
     cmd: '/bin/sh -c locate mate-terminal.desktop' } }
Input Handler Error:  No input for desktop file path for window mate-terminal.Mate-terminal. Please fix this manually in config file for this session in ~/.lwsm/session-name.json undefined
locate mate-terminal.desktop { [Error: Command failed: /bin/sh -c locate mate-terminal.desktop
/bin/sh: 1: locate mate-terminal.desktop: not found
]
  killed: false,
  code: 127,
  signal: null,
  cmd: '/bin/sh -c locate mate-terminal.desktop' }
otherCmd: Generic Error { [Error: Command failed: /bin/sh -c locate mate-terminal.desktop
/bin/sh: 1: locate mate-terminal.desktop: not found
]
  killed: false,
  code: 127,
  signal: null,
  cmd: '/bin/sh -c locate mate-terminal.desktop' } Error: Command failed: /bin/sh -c locate mate-terminal.desktop
/bin/sh: 1: locate mate-terminal.desktop: not found

    at ChildProcess.exithandler (child_process.js:213:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:821:16)
    at Socket.<anonymous(internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)
otherCmd: { '0': 
   { [Error: Command failed: /bin/sh -c locate mate-terminal.desktop
   /bin/sh: 1: locate mate-terminal.desktop: not found
   ]
     killed: false,
     code: 127,
     signal: null,
     cmd: '/bin/sh -c locate mate-terminal.desktop' } }
Input Handler Error:  No input for desktop file path for window mate-terminal.Mate-terminal. Please fix this manually in config file for this session in ~/.lwsm/session-name.json undefinedlocate xed.desktop { [Error: Command failed: /bin/sh -c locate xed.desktop
/bin/sh: 1: locate xed.desktop: not found
]
  killed: false,
  code: 127,
  signal: null,
  cmd: '/bin/sh -c locate xed.desktop' }
otherCmd: Generic Error { [Error: Command failed: /bin/sh -c locate xed.desktop
/bin/sh: 1: locate xed.desktop: not found
]
  killed: false,
  code: 127,
  signal: null,
  cmd: '/bin/sh -c locate xed.desktop' } Error: Command failed: /bin/sh -c locate xed.desktop
/bin/sh: 1: locate xed.desktop: not found

    at ChildProcess.exithandler (child_process.js:213:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:821:16)
    at Socket.<anonymous(internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)
otherCmd: { '0': 
   { [Error: Command failed: /bin/sh -c locate xed.desktop
   /bin/sh: 1: locate xed.desktop: not found
   ]
     killed: false,
     code: 127,
     signal: null,
     cmd: '/bin/sh -c locate xed.desktop' } }
Input Handler Error:  No input for desktop file path for window xed.Xed. Please fix this manually in config file for this session in ~/.lwsm/session-name.json undefined
SAVED SESSION: DEFAULT
niemand@akara ~ $ 

Error when trying to restore a session

I try to use your tool, but cannot restore a session.
I got this error: 

gnome-terminal-server.Gnome-terminal is running:  true 1 0
Navigator.Firefox is running:  false 1 0
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn "/usr/share/applications/firefox.desktop" ENOENT
    at exports._errnoException (util.js:1020:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32)
    at onErrorNT (internal/child_process.js:376:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Any idea how to fix it?
I'm using node v6.11.3

No logging in case of failure

I've tried running the script (BTW, I recommend adding sudo apt-get install nodejs to the installation instructions :) ), but when I run 'lwsm save', move around a few windows, and 'lwsm restore', nothing happens and nothing is printed.
There weren't logs anywhere I could find, so I guess the request is more verbose failure so that I can know something went wrong (during save? during restore?), and have some tool to figure out the problem.
I'd be glad to post another issue with log information for my particular problem afterwards

fs is not defined

$ lwsm save
/usr/local/lib/node_modules/linux-window-session-manager/lib/utility.js:57
      throw err;
      ^

ReferenceError: fs is not defined
    at Object.mkdirSync (/usr/local/lib/node_modules/linux-window-session-manager/lib/utility.js:54:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/linux-window-session-manager/lib/index.js:33:8)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

Steps before:

$ apt-get install npm
[...]
$ sudo npm install -g linux-window-session-manager
npm WARN deprecated [email protected]: Use uuid module instead
/usr/local/bin/lwsm -> /usr/local/lib/node_modules/linux-window-session-manager/cmd.js
/usr/local/lib
└─┬ [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ ├── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ └─┬ [email protected] 
  │ │ │ │ │   └── [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ └─┬ [email protected] 
  │ │ │ │ │   ├── [email protected] 
  │ │ │ │ │   └── [email protected] 
  │ │ │ │ └─┬ [email protected] 
  │ │ │ │   └── [email protected] 
  │ │ │ └── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └─┬ [email protected] 
  │ │ │   ├── [email protected] 
  │ │ │   └── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ └─┬ [email protected] 
  │ │ │   └── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ └─┬ [email protected] 
  │ │ │ │   ├── [email protected] 
  │ │ │ │   └── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ └── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └── [email protected] 
  │ │ ├── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └── [email protected] 
  │ │ ├── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └─┬ [email protected] 
  │ │ │   └── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ │ ├── [email protected] 
  │ │ │ │ │ │ └── [email protected] 
  │ │ │ │ │ ├── [email protected] 
  │ │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ │ └─┬ [email protected] 
  │ │ │ │ │ │   └── [email protected] 
  │ │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ │ └── [email protected] 
  │ │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ │ └── [email protected] 
  │ │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ │ └─┬ [email protected] 
  │ │ │ │ │ │   └── [email protected] 
  │ │ │ │ │ └─┬ [email protected] 
  │ │ │ │ │   └─┬ [email protected] 
  │ │ │ │ │     ├── [email protected] 
  │ │ │ │ │     └─┬ [email protected] 
  │ │ │ │ │       └── [email protected] 
  │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ ├── [email protected] 
  │ │ │ │ │ ├── [email protected] 
  │ │ │ │ │ └─┬ [email protected] 
  │ │ │ │ │   ├── [email protected] 
  │ │ │ │ │   └─┬ [email protected] 
  │ │ │ │ │     ├── [email protected] 
  │ │ │ │ │     ├── [email protected] 
  │ │ │ │ │     └── [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ └─┬ [email protected] 
  │ │ │ │ │   ├── [email protected] 
  │ │ │ │ │   └── [email protected] 
  │ │ │ │ ├─┬ [email protected] 
  │ │ │ │ │ ├── [email protected] 
  │ │ │ │ │ └── [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ └─┬ [email protected] 
  │ │ │ │   ├─┬ [email protected] 
  │ │ │ │   │ └── [email protected] 
  │ │ │ │   ├─┬ [email protected] 
  │ │ │ │   │ └── [email protected] 
  │ │ │ │   └── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ └── [email protected] 
  │ │ └── [email protected] 
  │ └─┬ [email protected] 
  │   ├─┬ [email protected] 
  │   │ └─┬ [email protected] 
  │   │   └── [email protected] 
  │   └─┬ [email protected] 
  │     └─┬ [email protected] 
  │       ├── [email protected] 
  │       └─┬ [email protected] 
  │         └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  └─┬ [email protected] 
    └── [email protected] 
  • Ubuntu Mate 18.04
  • npm --version: 3.5.2

More specific save/restore of application states

Hello,

I'm just starting to use this, so I don't know the exact expected behavior. Right now, when I save a session, I am able to restore the windows and applications, but the applications all open to their initial states. For example, terminals open to the default home area, and PDFs open to the general PDF application, but not specific files. Is it possible, for example, to save a session with a terminal open on a file with a text editor, or the PDF application open on a specific file?

Error while saving session

$> lwsm save default
[...]
util: { '0': 'findDesktopFile cant find file; searched patterns' }
Input Handler Error:  No input for desktop file path for window "sun-awt-X11-XFramePeer.jetbrains-phpstorm". Please fix this manually in config file for this session in ~/.lwsm/session-name.json undefined
findDesktopFile cant find file; searched patterns [ '/home/gabriel/.local/share/applications/sun-awt-X11-XFramePeer.desktop',
  '/home/gabriel/.local/share/applications/**/sun-awt-X11-XFramePeer.desktop',
  '/home/gabriel/.gnome/apps//sun-awt-X11-XFramePeer.desktop',
  '/home/gabriel/.gnome/apps//**/sun-awt-X11-XFramePeer.desktop',
  '/usr/share/applications/sun-awt-X11-XFramePeer.desktop',
  '/usr/share/applications/**/sun-awt-X11-XFramePeer.desktop',
  '/usr/local/share/applications/sun-awt-X11-XFramePeer.desktop',
  '/usr/local/share/applications/**/sun-awt-X11-XFramePeer.desktop',
  '/usr/share/app-install/sun-awt-X11-XFramePeer.desktop',
  '/usr/share/app-install/**/sun-awt-X11-XFramePeer.desktop' ]
util: Generic Error findDesktopFile cant find file; searched patterns undefined
util: { '0': 'findDesktopFile cant find file; searched patterns' }
Input Handler Error:  No input for desktop file path for window "sun-awt-X11-XFramePeer.jetbrains-phpstorm". Please fix this manually in config file for this session in ~/.lwsm/session-name.json undefined
SAVED SESSION: default

Your Environment

  • Version used: latest using npm
  • Operating System and version: Ubuntu 16.04 (xenial)
  • Desktop Environment: Ubuntu Unity Desktop
  • Node version: v8.4.0

Expected Behavior

The output looks like an error. How to fix this? Can this somehow be configured using ~/.lwsm/session-name.json (file doesn't exist yet)?

Current Behavior

see above

Steps to Reproduce (for bugs)

see above

Can not install from current user

Your Environment

  • Version used:
  • Operating System and version: Archlinux
  • Desktop Environment: Spectrwm or i3 or deepin
  • Node version: 10.17.0
  • List of Applications that are open (lwsm save) or should be opened (lwsm restore): any (Java or Qt5 or what ever, i hope a Windows Session Manager to be able to manage windows session

Expected Behavior

Install it

Current Behavior

npm install from current user failed with error access to file /usr/bin/node_modules

utility.js SyntaxError

When running:
$ lwsm save

I get an error:

/usr/local/lib/node_modules/linux-window-session-manager/lib/utility.js:12
let CFG;
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:12:20)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

Nodejs version: 4.2.6

Is that still supported? Doesn't work on 18.10 for me.

I updated it according to the instructions but doesn't work neither from the gnome extension or from the terminal.

Here is what trying to save a session outputs:

lwsm save test1 sudo: unable to resolve host user: Invalid argument 0x2000097 has no wmClassName. Win: { windowId: '0x2000097', windowIdDec: 33554583, states: [], wmType: '_NET_WM_WINDOW_TYPE_NORMAL' } Generic Error in Meta Wrapper TypeError: Path must be a string. Received null at assertPath (path.js:28:11) at Object.basename (path.js:1380:5) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:193:18) at new Promise (<anonymous>) at parseChromeAppDesktopFileName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:190:10) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:166:9) at new Promise (<anonymous>) at parseExecutableFileFromWmClassName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:158:10) at promises.push (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:136:18) at <anonymous> TypeError: Path must be a string. Received null at assertPath (path.js:28:11) at Object.basename (path.js:1380:5) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:193:18) at new Promise (<anonymous>) at parseChromeAppDesktopFileName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:190:10) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:166:9) at new Promise (<anonymous>) at parseExecutableFileFromWmClassName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:158:10) at promises.push (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:136:18) at <anonymous> Generic Error in Meta Wrapper TypeError: Path must be a string. Received null at assertPath (path.js:28:11) at Object.basename (path.js:1380:5) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:193:18) at new Promise (<anonymous>) at parseChromeAppDesktopFileName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:190:10) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:166:9) at new Promise (<anonymous>) at parseExecutableFileFromWmClassName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:158:10) at promises.push (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:136:18) at <anonymous> TypeError: Path must be a string. Received null at assertPath (path.js:28:11) at Object.basename (path.js:1380:5) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:193:18) at new Promise (<anonymous>) at parseChromeAppDesktopFileName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:190:10) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:166:9) at new Promise (<anonymous>) at parseExecutableFileFromWmClassName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:158:10) at promises.push (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:136:18) at <anonymous> Generic Error in Meta Wrapper TypeError: Path must be a string. Received null at assertPath (path.js:28:11) at Object.basename (path.js:1380:5) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:193:18) at new Promise (<anonymous>) at parseChromeAppDesktopFileName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:190:10) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:166:9) at new Promise (<anonymous>) at parseExecutableFileFromWmClassName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:158:10) at promises.push (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:136:18) at <anonymous> TypeError: Path must be a string. Received null at assertPath (path.js:28:11) at Object.basename (path.js:1380:5) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:193:18) at new Promise (<anonymous>) at parseChromeAppDesktopFileName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:190:10) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:166:9) at new Promise (<anonymous>) at parseExecutableFileFromWmClassName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:158:10) at promises.push (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:136:18) at <anonymous> (node:11729) UnhandledPromiseRejectionWarning: TypeError: Path must be a string. Received null at assertPath (path.js:28:11) at Object.basename (path.js:1380:5) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:193:18) at new Promise (<anonymous>) at parseChromeAppDesktopFileName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:190:10) at Promise (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:166:9) at new Promise (<anonymous>) at parseExecutableFileFromWmClassName (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:158:10) at promises.push (/usr/local/lib/node_modules/linux-window-session-manager/lib/metaWrapper.js:136:18) at <anonymous> (node:11729) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:11729) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

only works if gnome-terminal is already open @ Ubuntu 19.10

Your Environment

  • Version used: can't tell
  • Operating System and version: Ubuntu 19.10
  • Desktop Environment: Gnome 3.34.1
  • Node version: 12.13.0
  • List of Applications that are open (lwsm save) or should be opened (lwsm restore):
    gnome-terminal-server.Gnome-terminal
    atom.Atom
    Navigator.Firefox

Expected Behavior

applications should be opened and placed regardless of whether a gnome terminal is already open or not. /var/syslog shows this:

gnome-shell[1601]: Status: "gnome-terminal-server.Gnome-terminal" is running: true 1 0
gnome-shell[1601]: Status: "atom.Atom" is running: false 1 0
gnome-shell[1601]: Status: "Navigator.Firefox" is running: false 1 0
gnome-shell[1601]: Waiting for all applications to start...
gnome-shell[1601]: All applications started
gnome-shell[1601]: Restoring window position for "gnome-terminal-server.Gnome-terminal"
gnome-shell[1601]: Restoring window position for "atom.Atom"
gnome-shell[1601]: Restoring window position for "Navigator.Firefox"
gnome-shell[1601]: RESTORED SESSION: TestSession

Current Behavior

applications are opened and placed ONLY if a gnome terminal is already open. otherwise, /var/syslog has the following error:

gnome-shell[1601]: { Error: Bad window
gnome-shell[1601]: at ReadFixedRequest.callback (/home/electricimp123/.nvm/versions/node/v12.13.0/lib/node_modules/linux-window-session-manager/node_modules/x11/lib/xcore.js:465:29)
gnome-shell[1601]: at ReadFixedRequest.execute (/home/electricimp123/.nvm/versions/node/v12.13.0/lib/node_modules/linux-window-session-manager/node_modules/x11/lib/unpackstream.js:41:10)
gnome-shell[1601]: at UnpackStream.resume (/home/electricimp123/.nvm/versions/node/v12.13.0/lib/node_modules/linux-window-session-manager/node_modules/x11/lib/unpackstream.js:165:30)
gnome-shell[1601]: at UnpackStream.write (/home/electricimp123/.nvm/versions/node/v12.13.0/lib/node_modules/linux-window-session-manager/node_modules/x11/lib/unpackstream.js:102:10)
gnome-shell[1601]: at Socket. (/home/electricimp123/.nvm/versions/node/v12.13.0/lib/node_modules/linux-window-session-manager/node_modules/x11/lib/xcore.js:88:21)
gnome-shell[1601]: at Socket.emit (events.js:189:13)
gnome-shell[1601]: at addChunk (_stream_readable.js:284:12)
gnome-shell[1601]: at readableAddChunk (_stream_readable.js:265:11)
gnome-shell[1601]: at Socket.Readable.push (_stream_readable.js:220:10)
gnome-shell[1601]: at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
gnome-shell[1601]: error: 3,
gnome-shell[1601]: seq: 31,
gnome-shell[1601]: message: 'Bad window',
gnome-shell[1601]: badParam: 0,
gnome-shell[1601]: minorOpcode: 0,
gnome-shell[1601]: majorOpcode: 21 }

Steps to Reproduce (for bugs)

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?

Nautilus is being ignored

Hello,
first of all, thank you for the awesome piece of software, I use it daily!
I would like to know how I could include Nautilus though, currently it is being excluded int he config.json in desktop_window.Nautilus but I don't know why.

Thanks!

locate failing

Command returns the error below when trying to save:


rayr@rayr-desktop:~/.lwsm$ lwsm save
locate chrome-ojhjdjnggeknoafeebfnhpaldnmnlgdm.desktop { [Error: Command failed: /bin/sh -c locate chrome-ojhjdjnggeknoafeebfnhpaldnmnlgdm.desktop
]
killed: false,
code: 1,
signal: null,
cmd: '/bin/sh -c locate chrome-ojhjdjnggeknoafeebfnhpaldnmnlgdm.desktop' }
otherCmd: Generic Error { [Error: Command failed: /bin/sh -c locate chrome-ojhjdjnggeknoafeebfnhpaldnmnlgdm.desktop
]

I'm not sure I understand why locate is responding the way it is. When running manually, it doesn't like anything after the dash. But it doesn't mind the dash itself. This would seem to be a problem with locate itself, but perhaps there's a workaround.

lwsm works from command line but not the Gnome desktop extension

Your Environment

  • Version used: 2.1.28
  • Operating System and version: Ubuntu 18.10
  • Desktop Environment: Gnome 3.30.1
  • Node version: 8.11.3

Expected Behavior

I have the Gnome lwsm desktop extension installed and want to be able to save and load using that.

Current Behavior

I can save and restore using the command line, and saved sessions are listed in the desktop extension, but when I attempt to save or restore using the desktop extension I see a status notification "lwsm: save test" for a couple of seconds, and then it changes to "lwsm: save test UNKNOWN ERROR".

I get the same result if I try to restore one of the sessions saved using the command line. But if I restore from the command line, it works fine.

I tried changing the path in the extension config but can confirm that is correct (because if I invalidate it I get an error about it not finding the executable).

The extension is accessible in gnome 'tweak UI', and I can use that to change the path to lwsm, and to enable and disable the extension.

Steps to Reproduce (for bugs)

Click on the extension icon, type a description and click the save icon.

NOTE: I have nvm installed and had problems locating the executable because I'm using node 8.12 by default, but somehow have lwsm installed only for 8.11.3. So to use lwsm in the terminal I have to nvm use 8.11.3 first. This doesn't appear to be related, but I mention it in case. I'm also wondering how to fix this! For now I'll just use an alias for lwsm.

Supplementary Question:

Is there a simple way to have the terminal windows restored to their current directory?

lwsm doesn't work if it used with shortcut

Your Environment

  • Operating System and version: Ubuntu 19.04
  • Desktop Environment: Xorg. wm - gnome

Expected Behavior

restore all windows and workspaces from default session

Current Behavior

lwsm doesn't work, when I press ctrl + shift + r command "lwsm restore" doesn't executed, nothing happens

image

Strange gnome WM_CLASS names

Your Environment

  • Version used: 2.1.30
  • Operating System and version: Arch Linux
  • Desktop Environment: Gnome
  • Node version: v11.15.0

Expected Behavior

Better pattern matching for gnome apps and /usr/bin

Current Behavior

I got a lot of errors while either saving or restoring my current session.
I was able to iron them out with WM_CLASS_AND_EXECUTABLE_FILE_MAP, but I think there could be some improvements for detecting the executables.

Here are a few lines which I had to add WM_CLASS_AND_EXECUTABLE_FILE_MAP

    "org.gnome.gedit.Org.gnome.gedit": "org.gnome.gedit",
    "zoom.zoom": "zoom",
    "evolution.Evolution": "evolution",
    "org.gnome.Nautilus.Org.gnome.Nautilus": "nautilus"

Strangely my Gnome apps have like a duplicated string when lwsm tries to save them.
Also evolution and zoom had to be mapped manually despite the fact they should be somehow autodetectable.

Also the default nautilius setting was problematic for me.

Any advice how to make the above mapping more generic?

"Remove" option is not shown when invoking from the console

Only save, restore and list are shown.

Your Environment

  • Version used: 3.0.8

Expected Behavior

As a User, when invoking lwsm or lwsm --help, I should get the documentation for all commands: list, save, restore and remove.

Current Behavior

Only the three first ones (list, save and restore) are shown. remove is not.

Steps to Reproduce (for bugs)

On a working installation, just run lwsm or lwsm --help

Exception running lwsm save

0x4800062 has no wmClassName. Win:  { windowId: '0x4800062',
  windowIdDec: 75497570,
  wmCurrentDesktopNr: 0,
  wmPid: 27542,
  wmType: '_NET_WM_WINDOW_TYPE_DOCK',
  states: 
   [ '_NET_WM_STATE_STICKY',
     '_NET_WM_STATE_SKIP_TASKBAR',
     '_NET_WM_STATE_SKIP_PAGER' ] }
findDesktopFile cant find file; searched patterns [ '/home/xxx/.local/share/applications/conky.desktop',
  '/home/xxx/.local/share/applications/**/conky.desktop',
  '/home/xxx/.gnome/apps//conky.desktop',
  '/home/xxx/.gnome/apps//**/conky.desktop',
  '/usr/share/applications/conky.desktop',
  '/usr/share/applications/**/conky.desktop',
  '/usr/local/share/applications/conky.desktop',
  '/usr/local/share/applications/**/conky.desktop',
  '/usr/share/app-install/conky.desktop',
  '/usr/share/app-install/**/conky.desktop' ]
util: Generic Error findDesktopFile cant find file; searched patterns undefined
util: { '0': 'findDesktopFile cant find file; searched patterns' }
Input Handler Error:  No input for desktop file path for window "conky.conky". Please fix this manually in config file for this session in ~/.lwsm/session-name.json undefined
findDesktopFile cant find file; searched patterns [ '/home/xxx/.local/share/applications/libreoffice.desktop',
  '/home/xxx/.local/share/applications/**/libreoffice.desktop',
  '/home/xxx/.gnome/apps//libreoffice.desktop',
  '/home/xxx/.gnome/apps//**/libreoffice.desktop',
  '/usr/share/applications/libreoffice.desktop',
  '/usr/share/applications/**/libreoffice.desktop',
  '/usr/local/share/applications/libreoffice.desktop',
  '/usr/local/share/applications/**/libreoffice.desktop',
  '/usr/share/app-install/libreoffice.desktop',
  '/usr/share/app-install/**/libreoffice.desktop' ]
util: Generic Error findDesktopFile cant find file; searched patterns undefined
util: { '0': 'findDesktopFile cant find file; searched patterns' }
Input Handler Error:  No input for desktop file path for window "libreoffice.libreoffice-calc". Please fix this manually in config file for this session in ~/.lwsm/session-name.json undefined
SAVED SESSION: DEFAULT

I get "undefined findDesktopFile cant find file; searched patterns" for like half the apps, why so much?

Your Environment

  • Version used: latest
  • Operating System and version: ubuntu 18.04
  • Desktop Environment: ubuntu gnome
  • Node version:

Expected Behavior

It should save all windows but it doesn't

Current Behavior

It saved the session with bunch of errors and can't properly restore it later

I see this is discussed and is common bug, but it does that for half the applications I have. So instead of editing the paths for each one individually, maybe there is something more generally wrong that I can just fix instead of individually fixing each one of them?

I have quite popular setup, so I imagine that affects a lot of people. So, any ideas why it can't find the paths for soo much apps?

Steps to Reproduce (for bugs)

lwsm save test1
findDesktopFile cant find file; searched patterns [ '/home/user/.local/share/applications/Telegram.desktop',
  '/home/user/.local/share/applications/**/Telegram.desktop',
  '/home/user/.gnome/apps//Telegram.desktop',
  '/home/user/.gnome/apps//**/Telegram.desktop',
  '/usr/share/applications/Telegram.desktop',
  '/usr/share/applications/**/Telegram.desktop',
  '/usr/local/share/applications/Telegram.desktop',
  '/usr/local/share/applications/**/Telegram.desktop',
  '/usr/share/app-install/Telegram.desktop',
  '/usr/share/app-install/**/Telegram.desktop',
  '/home/user/.config/autostart//Telegram.desktop',
  '/home/user/.config/autostart//**/Telegram.desktop' ]
util: Generic Error findDesktopFile cant find file; searched patterns undefined
util: { '0': 'findDesktopFile cant find file; searched patterns' }
Input Handler Error:  No input for desktop file path for window "Telegram.TelegramDesktop". Please fix this manually in config file for this session in ~/.lwsm/{currentSessionName}.json

LWSM was unable to guess the location of your executable/desktop file.
 
There are two things, that you can do now: 

Persist "Always On Top" & "Always on Visible Workspace"

Your Environment

  • Version used: 2.1.19
  • Operating System and version: OpenSUSE Tumbleweed
  • Desktop Environment: GNOME Shell 3.26.2
  • Node version: v9.3.0

Expected Behavior

Opening the context menu on a window and setting "Always On Top" or "Always on Visible Workspace" to true should result in these settings being saved and restored along with window positioning.

Current Behavior

"Always On Top" and "Always on Visible Workspace" are not persisted.

Steps to Reproduce (for bugs)

  1. Open context menu for a window, set "Always On Top" or "Always on Visible Workspace"
  2. Save session
  3. Restore session
  4. Notice the "Always On Top" or "Always on Visible Workspace" setting you just picked is now cleared

3.0.8: Firefox should be only run once at restore time

Your Environment

  • Version used: 3.0.8
  • Operating System and version: Debian bullseye/sid
  • Desktop Environment: GNOME 3.34
  • Node version: 12.6.0
  • List of Applications that are open (lwsm save) or should be opened (lwsm restore):
    Firefox (multiple windows)

Expected Behavior

Even though they correspond to multiple windows, the application should be run only once (the window list is managed by Firefox itself).

Current Behavior

Firefox is executed once per window. It displays a message error explaining that an instance of Firefox is already running per each time the program is run after the first one.

Steps to Reproduce (for bugs)

  1. Start Firefox
  2. Open a X new windows in Firefox
  3. Save the session
  4. When restoring the session, there will be X error messages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.