Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save workspaces #726

Open
distefam opened this issue Nov 30, 2023 · 3 comments
Open

Save workspaces #726

distefam opened this issue Nov 30, 2023 · 3 comments
Labels
enhancement Adds a new feature or extends scope

Comments

@distefam
Copy link

Is your feature request related to a problem? Please describe.
I switch between multiple projects, each of which has its own set of windows that needs to be opened, usually in a particular arrangement. Text Editors and IDEs have the concept of "workspaces" (cf. Sublime Text's *.sublime-workspace files) that allow one to "save state" and return to a pre-configured arrangement of open-files. I'd like the same sort of behavior in PaperWM.

For example, when doing development work, I typically arrange windows in this order (from left to right):

  • todo list (terminal window)
  • terminal window open to project dir (used to build, run, etc.)
  • code editor
  • browser window opened to localhost
  • pods (for running local Postgres)

Every time I begin to work on this project I basically reproduce the above arrangement.

Describe the solution you'd like
PaperWM already has the concept of workspace-specific settings (background, etc.). I imagine this working similarly. Perhaps allowing one to save the current workspace arrangement as a "bookmarked workspace" or something similiar, which one would then be able to "instantiate" into a new workspace.

Describe alternatives you've considered
Writing a bash script to try to open apps in the correct order and rely on PaperWM's window management to open them from left to right. Of course, sizing would be lost here (winprops doesn't work with gnome-terminal -- cmd_name because cmd_name is run after PaperWM gets the window info).

Additional context
This is probably out of scope for PaperWM, however, given how integrated it is with window positions I'm not sure another extension would be able to effectively accomplish it without support in PaperWM.

@distefam distefam added the enhancement Adds a new feature or extends scope label Nov 30, 2023
@Lythenas
Copy link
Collaborator

Lythenas commented Jan 2, 2024

This could maybe also be implemented with the new DBus interface we are planning #738 I would imagine something like this in a bash script:

  1. Launch app (e.g. gnome-terminal -- cmd_name)
  2. Listen for signal of new window via the DBus interface (and probably match the title/class)
  3. (Optionally wait a second or so until gnome-terminal executes the command so you can properly check the title)
  4. Issue DBus method call to move window to correct workspace/location

Alternatively in other window managers there are "one shot rules", which are basically our winprops but they are deleted once they match. This would require the DBus interface and additionally implementing these "one shot rules".

The second approach might be more convenient but requires a bit more implementation. I will try to make the first approach possible during the initial implementation of #738

@Lythenas
Copy link
Collaborator

Lythenas commented Jan 2, 2024

Nvm some of my comments. We already have the concept of one shot winprops, just no way to insert them at the moment. Because Gnome 45 does not support our user.js anymore.

So would not be hard to implement this with DBus I think.

@PHHENS
Copy link

PHHENS commented May 31, 2024

Hi distefam,
+1
Take a look at "smart auto move window" extensions
(but does not work with paperwm).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adds a new feature or extends scope
3 participants