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

Vision screen-save: Users do not have to worry about rebooting, saving or restoring sessions – the screen sessions are just there. #20

Open
simonwalz opened this issue Aug 28, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@simonwalz
Copy link
Owner

simonwalz commented Aug 28, 2024

Hallo @camlafit,

With the PRs for systemd, I have realised the vision you have in mind and I really like it.
I always thought of screen-save as an additional tool to be used with the screen. Only for advanced individual users who save and restore their sessions manually.

The vision I see now is that screen-save forms a fusion with screen. With systemd services enabled, all screen sessions would be restored, even for basic users. The user would not have to worry about rebooting, saving or restoring sessions. This is a new USP for end users!

I am motivated to help you - how do you do that?

  • My suggestion is that you go first (as it was your initiative) and just ask when you need help.

  • Another option is that we identify the remaining tasks together and try to share the work.

What do you think?

@simonwalz
Copy link
Owner Author

simonwalz commented Aug 28, 2024

A note for later discussion:

For this vision we don't need much - but some aspects still need to be investigated, for example:

@simonwalz simonwalz changed the title Vision of screen-save Vision screen-save: The user would not have to worry about rebooting, saving or restoring sessions – the screen sessions are just there. Aug 28, 2024
@simonwalz simonwalz changed the title Vision screen-save: The user would not have to worry about rebooting, saving or restoring sessions – the screen sessions are just there. Vision screen-save: Users do not have to worry about rebooting, saving or restoring sessions – the screen sessions are just there. Aug 28, 2024
@camlafit
Copy link
Contributor

camlafit commented Aug 29, 2024

Hello

Thanks a lot :)
I've only continue your logic and try to be more transparent about each manual action and integrate them wrapped in packaging logic.

I think #10 is more or less complete. Many tests must be done, but I think all logic is now here. At least it's working on my laptop. Is no so bad :)

As suggest, looks better to finish my work with #10 . To split this work looks me a bit complicate as I do it step by step and with many try/error experiment. Could be seen with these push --force on the branch.

To complete this discussion :

  • we need to reflect about manual kill session. When an user do it, saved session should be deleted to prevent any restart.

Thanks

@simonwalz
Copy link
Owner Author

simonwalz commented Aug 31, 2024

The procedure is fine with me. I will suggest changes or perhaps make small adjustments before merging the PRs so that it corresponds to my understanding of quality (secure, easy to understand, modular).

Discussion about "manual kill session":
Yes, I would suggest to save all screen sessions of a user into a separate, fixed directory (SAVE_DIR=~/.screen-save/) and wiping that directory before saving all the sessions.
To make that scripts easier to understand, I would split the screen-save-all-sessions script into two scripts: One that runs as root and just call the second script for every user, that has a SAVE_DIR (just for every user, that has active sessions is not enogh, as the user could have killed all this active sessions – and thus the saved sessions would not be removed). The second script then just wipes with SAVE_DIR and saves all active sessions for that user. In that way it is modular and secure ;-) – This is just a suggestion, you can just try your ideas and I will help you with them.

@simonwalz simonwalz self-assigned this Aug 31, 2024
@simonwalz simonwalz added the enhancement New feature or request label Aug 31, 2024
@camlafit
Copy link
Contributor

camlafit commented Sep 2, 2024

Hi

Another note :

  • Maybe provide a dedicated file with each variable, we have different script and each has their own variable redefinition

@camlafit
Copy link
Contributor

camlafit commented Sep 2, 2024

The procedure is fine with me. I will suggest changes or perhaps make small adjustments before merging the PRs so that it corresponds to my understanding of quality (secure, easy to understand, modular).

Of course, my approach was try , validate and secure later. It's clearly not perfect. Modular and secure part looks as a requirement to provide a stable script/package

Discussion about "manual kill session": Yes, I would suggest to save all screen sessions of a user into a separate, fixed directory (SAVE_DIR=~/.screen-save/) and wiping that directory before saving all the sessions

Looks a nice idea, and easy to implement. But we need in this case manage manual save to automatic. We could get some trouble with autostart.
Maybe an option to add.

. To make that scripts easier to understand, I would split the screen-save-all-sessions script into two scripts: One that runs as root and just call the second script for every user, that has a SAVE_DIR (just for every user, that has active sessions is not enough, as the user could have killed all this active sessions – and thus the saved sessions would not be removed). The second script then just wipes with SAVE_DIR and saves all active sessions for that user. In that way it is modular and secure ;-) – This is just a suggestion, you can just try your ideas and I will help you with them.

Oh I understand better. Sorry I've needed to re*read it. (We have took my poor english limit ^^). I thinks we need to split these different element with different function.
All of these is only related to saving feature, but indeed we could split logic with different function to be more readable.
Then we could have at least 3 functions,
save_all_session()
save_current_user_session()
wipe_current_user()

we can add different arguments to save all , partial or specific session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants