Skip to content

Auto shutdown/startup script  #92

@Zefty

Description

@Zefty

Not really an issue with LWSM as I am able to run the commands fine. I'm having some trouble getting an auto shutdown/startup script going. Would appreciate it if anyone has any solutions, cheers!

Your Environment

  • Version used: lwsm 4.0.5
  • Operating System and version: Fedora 35
  • Desktop Environment: Gnome
  • Node version: v16.13.0
  • List of Applications that are open (lwsm save) or should be opened (lwsm restore): Chrome, Files

Expected Behavior

No errors

Current Behavior

Dec 26 11:30:40 wuxhua systemd[1]: Starting Linux Window Session Manager Pre-Shutdown Processes...
░░ Subject: A start job for unit save_session.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit save_session.service has begun execution.
░░
░░ The job identifier is 6022.
Dec 26 11:30:40 wuxhua bash[7100]: lwsm: no config file present or it contains invalid json. Creating new one...
Dec 26 11:30:40 wuxhua bash[7100]: /usr/local/lib/node_modules/linux-window-session-manager/dist/index.js:84
Dec 26 11:30:40 wuxhua bash[7100]: throw err;
Dec 26 11:30:40 wuxhua bash[7100]: ^
Dec 26 11:30:40 wuxhua bash[7100]: Error: ENOENT: no such file or directory, mkdir 'undefined/.config/lwsm'
Dec 26 11:30:40 wuxhua bash[7100]: at Object.mkdirSync (node:fs:1334:3)
Dec 26 11:30:40 wuxhua bash[7100]: at mkdirSync (/usr/local/lib/node_modules/linux-window-session-manager/dist/index.js:80:12)
Dec 26 11:30:40 wuxhua bash[7100]: at Object. (/usr/local/lib/node_modules/linux-window-session-manager/dist/index.js:229:5)
Dec 26 11:30:40 wuxhua bash[7100]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
Dec 26 11:30:40 wuxhua bash[7100]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
Dec 26 11:30:40 wuxhua bash[7100]: at Module.load (node:internal/modules/cjs/loader:981:32)
Dec 26 11:30:40 wuxhua bash[7100]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
Dec 26 11:30:40 wuxhua bash[7100]: at Module.require (node:internal/modules/cjs/loader:1005:19)
Dec 26 11:30:40 wuxhua bash[7100]: at require (node:internal/modules/cjs/helpers:102:18)
Dec 26 11:30:40 wuxhua bash[7100]: at Object. (/usr/local/lib/node_modules/linux-window-session-manager/cmd.js:3:14) {
Dec 26 11:30:40 wuxhua bash[7100]: errno: -2,
Dec 26 11:30:40 wuxhua bash[7100]: syscall: 'mkdir',
Dec 26 11:30:40 wuxhua bash[7100]: code: 'ENOENT',
Dec 26 11:30:40 wuxhua bash[7100]: path: 'undefined/.config/lwsm'
Dec 26 11:30:40 wuxhua bash[7100]: }
Dec 26 11:30:40 wuxhua systemd[1]: save_session.service: Main process exited, code=exited, status=1/FAILURE

Steps to Reproduce (for bugs)

Script stored in home/wuxhua/Scripts/save_session.sh

/usr/local/bin/lwsm list

Servicemd Service

`[Unit]
Description=Linux Window Session Manager Pre-Shutdown Processes
DefaultDependencies=no
After=final.target

[Service]
Type=oneshot
ExecStart=bash /home/wuxhua/Scripts/save_session.sh

[Install]
WantedBy=final.target`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions