{"id":13495639,"url":"https://github.com/johannesjo/linux-window-session-manager","last_synced_at":"2025-05-16T16:04:53.486Z","repository":{"id":19975214,"uuid":"88417021","full_name":"johannesjo/linux-window-session-manager","owner":"johannesjo","description":"A tool to store and reload open windows and window positions for x11 desktops like unity and gnome.","archived":false,"fork":false,"pushed_at":"2024-08-19T14:02:34.000Z","size":1116,"stargazers_count":409,"open_issues_count":24,"forks_count":25,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-12T15:57:03.937Z","etag":null,"topics":["hacktoberfest","linux","productivity","window-manager","window-switcher"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johannesjo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["johannesjo"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-04-16T14:02:45.000Z","updated_at":"2025-04-09T12:00:26.000Z","dependencies_parsed_at":"2024-01-14T10:17:16.943Z","dependency_job_id":"4704abd3-4f44-4632-bdc9-dd184d462486","html_url":"https://github.com/johannesjo/linux-window-session-manager","commit_stats":{"total_commits":316,"total_committers":14,"mean_commits":"22.571428571428573","dds":0.1392405063291139,"last_synced_commit":"86e11452554e4634ad0a812e2bdce9bbd45ef2e5"},"previous_names":[],"tags_count":75,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjo%2Flinux-window-session-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjo%2Flinux-window-session-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjo%2Flinux-window-session-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannesjo%2Flinux-window-session-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johannesjo","download_url":"https://codeload.github.com/johannesjo/linux-window-session-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254564113,"owners_count":22092120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","linux","productivity","window-manager","window-switcher"],"created_at":"2024-07-31T19:01:36.651Z","updated_at":"2025-05-16T16:04:53.437Z","avatar_url":"https://github.com/johannesjo.png","language":"TypeScript","funding_links":["https://github.com/sponsors/johannesjo"],"categories":["TypeScript","HarmonyOS","hacktoberfest"],"sub_categories":["Windows Manager"],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"logo.png\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://badge.fury.io/js/linux-window-session-manager\"\u003e\u003cimg src=\"https://badge.fury.io/js/linux-window-session-manager.svg\"\u003e\u003c/a\u003e\n \u003ca href=\"https://lbesson.mit-license.org\"\u003e\u003cimg alt=\"MIT license\" src=\"https://img.shields.io/badge/License-MIT-blue.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis is a library / command line tool that let's you save and reload your opened programs and the positions of their windows. \nSupports Unity and Gnome Desktops and possibly all other compositing window managers using X (including XWayland).\n \nThere's also a [companion tool in form of an indicator applet](https://github.com/johannesjo/linux-window-session-manger-indicator), a [gnome-shell-extension](https://github.com/johannesjo/gnome-shell-extension-window-session-manager) and a [Ulauncher extension](https://github.com/kpost/ulauncher-lwsm) if you like such things but this package can also be used standalone.\n \n## Installation\nNodeJs needs to be installed *properly* before you can use lwsm. [Have a look at google](https://www.google.com/search?q=install+node+as+user+ubuntu\u0026oq=install+node+as+user+ubuntu\u0026aqs=chrome..69i57.9161j0j7\u0026sourceid=chrome\u0026ie=UTF-8) if you need help with that. \n\n```\nnpm install -g linux-window-session-manager\n```\n\nFor older distros, you also might need to install the `locate` command via `sudo apt-get install mlocate`. \n \n## Updating\n```\nnpm uninstall -g linux-window-session-manager \u0026\u0026 npm i -g linux-window-session-manager\n# (optional) delete config to update it to the newest version\nrm ~/.config/lwsm/config.json\n```\n \n## CMD Usage\n\n### Saving a session:\n```\n# save the current session to ~/.config/lwsm/sessionData/DEFAULT.json\nlwsm save\n\n# save the current session to ~/.config/lwsm/sessionData/my-session.json\nlwsm save my-session   \n```\nNote that the session are stored for the specific display combination, you're currently running. If you want to store a different layout for when you have an external monitor plugged in this is possible. Just run the save command again for the same session. \n\n\n### Restoring a session:\n```\n# restore the session from ~/.config/lwsm/sessionData/DEFAULT.json\nlwsm restore\n\n# restore the session from ~/.config/lwsm/sessionData/my-session.json\nlwsm restore my-session   \n\n# gracefully close all running apps before starting the session\nlwsm restore --closeAllOpenWindows\n```\n\n### List saved sessions:\n```\nlwsm list\n```\n\n### Rename a saved session:\n```\nlwsm rename oldName newName\n```\n\n### Adjusting the configuration:\nYou can manually edit the config file present at `~/.config/lwsm/config.json` and the session files in `~/.config/lwsm/sessionData/[sessionName].json`.\n\n### Command-line completion:\n```\n# Automatically install command-line completion\nlwsm --setupCompletion\n# Generate command-line completion code for bash and zsh shells for manual installation\nlwsm --completion\n# Generate command-line completion code for fish shell for manual installation\nlwsm --completion-fish\n```\nCommand-line completion implemented by [omelette](https://github.com/f/omelette), so you may refer it's README to check file where completion code will be added on automatic install.\nRestart your shell after automatic install to apply changes.\n\n\n## Known Quirks\nIn order to resize and move the windows the X window manager is used. Unfortunately it has some bugs:  \n* Windows moved to the very left of the screen will always be off by some pixels in Unity\n* Sometimes a window can't be restored properly any more. In those cases it helps to close the window and restart the application.\n* When you're using Wayland as display manager all gnome applications won't be saved or restored. Only XWayland applications will work.\n  *  You easily [switch back to Xorg](https://itsfoss.com/switch-xorg-wayland/)\n\n## Troubleshooting \u0026 Issues\n**!!! please read this before opening up an issue !!!**\n\n**If you're using Wayland, have a look at above at the known qurks section**\n\n### Application are not started/lwsm doesn't work \n\nRelated error message: `undefined findDesktopFile cant find file`\n\nlwsm needs to guess the right executable path for your applications. In some cases lwsm might be unable to do so. There are a couple of things, that you can do:\n\n1. You can locate the executable or desktop file manually for the application  which isn't started (e.g. via the locate command), and add it to `~/.config/lwsm/{currentSessionName}.json` (depending on the version used the file might be located here instead: `~/.config/lwsm/{currentSessionName}.json`). \nIf you want to persist that mapping you might also want to open `~/.config/lwsm/config.json` (depending on the version used the file might be located here instead: `~/.config/lwsm/config.json`)  and edit the `WM_CLASS_AND_EXECUTABLE_FILE_MAP` property. You can find out which property name to use by executing `xprop` and clicking on an open window of the application. Look for `WM_CLASS(STRING)` (Or just execute `xprop | grep \"WM_CLASS(STRING)\"`). For finding the desktop file the `locate` command is usful (e.g.: `locate google-chrome.desktop`).\n```\n# example  entry in ~/.config/lwsm/config.json:\n# WM_CLASS(STRING)             Desktop file name\n\"google-chrome.Google-chrome\": \"google-chrome.desktop\",\n```\n\n2. If the desktop files are consistently stored in a folder not mapped by lwsm you might want to add it's location to the `DESKTOP_FILE_LOCATIONS` property in `~/.config/lwsm/config.json`(depending on the version used the file might be located here instead: `~/.config/lwsm/config.json`) to make sure this folder is also searched the next lwsm tries to guess an desktop file path. If you think the path should be there per default [please open up an issue](https://github.com/johannesjo/linux-window-session-manager/issues).\n\nYou can also see [this comment for more detailed instructions](https://github.com/johannesjo/linux-window-session-manager/issues/45#issuecomment-536179295).\n\n### Ignoring applications\nIf you want lwsm to ignore the application, you can add it to the ignore list in `~/.config/lwsm/config.json` (depending on the version used the file might be located here instead: `~/.config/lwsm/config.json`) which is located under the `WM_CLASS_EXCLUSIONS` property.\n\nIf everything fails [please open up an issue](https://github.com/johannesjo/linux-window-session-manager/issues).\n\n### Gnome Terminal or other Gnome applications not restored\nChances are you're running Wayland as a display manager. I'd recommend [switching back to Xorg](https://askubuntu.com/questions/961304/how-do-you-switch-from-wayland-back-to-xorg-in-ubuntu-17-10).\n\n## ❤ contribute ❤\nI'm happy for any reported [issue or feature request](https://github.com/johannesjo/linux-window-session-manager/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohannesjo%2Flinux-window-session-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohannesjo%2Flinux-window-session-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohannesjo%2Flinux-window-session-manager/lists"}