Discussion:
i3-persist - prevent accidental window closing
(too old to reply)
Igor Sowinski
2018-02-25 18:40:50 UTC
Permalink
Dear i3-discuss,

I have recently installed i3 and enjoy the tiling window manager
immensely - especially the quick action enabled with the generous number
of keybindings.

I am used to keeping Thunderbird/Slack open in a separate workspace, so
that I can be notified of any incoming messages. My issue was that I
would eventually switch to that workspace, check all the messages and
and close the windows without thinking - thanks to the learned keybinding.

I have produced a tool which gives you a replacement command for i3-msg
kill, as well as several additional commands to lock and unlock
containers. A locked container cannot be closed via the usual means -
this also applies for when trying to close its parent container.

The repository can be found here: https://github.com/Igrom/i3-persist.
The code is released under the 3-clause BSD license.

I hope that the i3 community can benefit from the tool. As I am new to
this, I would be grateful if I could be showed where I can advertise the
tool to those who might find use of it.

Best regards,

Igrom
Ingo Bürk
2018-02-25 18:46:38 UTC
Permalink
Hi,

Thanks for the script! On a side note I think instead of using temporary files you might find it's easier to use marks for this instead to store the information (marks starting with an underscore won't be shown to the user). Just as an idea.

As for advertising, you could post it on the i3wm subreddit.


Ingo

⁣Sent from TypeApp ​
Post by Igor Sowinski
Dear i3-discuss,
I have recently installed i3 and enjoy the tiling window manager
immensely - especially the quick action enabled with the generous number
of keybindings.
I am used to keeping Thunderbird/Slack open in a separate workspace, so
that I can be notified of any incoming messages. My issue was that I
would eventually switch to that workspace, check all the messages and
and close the windows without thinking - thanks to the learned
keybinding.
I have produced a tool which gives you a replacement command for i3-msg
kill, as well as several additional commands to lock and unlock
containers. A locked container cannot be closed via the usual means -
this also applies for when trying to close its parent container.
The repository can be found here: https://github.com/Igrom/i3-persist.
The code is released under the 3-clause BSD license.
I hope that the i3 community can benefit from the tool. As I am new to
this, I would be grateful if I could be showed where I can advertise the
tool to those who might find use of it.
Best regards,
Igrom
Igor Sowinski
2018-02-25 20:01:25 UTC
Permalink
Ingo,

I appreciate the information about i3 marks
<https://i3wm.org/docs/userguide.html#vim_like_marks>. It's a nice fit.
I will incorporate them when I revision the script.

Best regards,

Igrom
Post by Ingo Bürk
Hi,
Thanks for the script! On a side note I think instead of using
temporary files you might find it's easier to use marks for this
instead to store the information (marks starting with an underscore
won't be shown to the user). Just as an idea.
As for advertising, you could post it on the i3wm subreddit.
Ingo
Sent from TypeApp
<http://www.typeapp.com/r?b=12185>
Dear i3-discuss,
I have recently installed i3 and enjoy the tiling window manager
immensely - especially the quick action enabled with the generous number
of keybindings.
I am used to keeping Thunderbird/Slack open in a separate workspace, so
that I can be notified of any incoming messages. My issue was that I
would eventually switch to that workspace, check all the messages and
and close the windows without thinking - thanks to the learned keybinding.
I have produced a tool which gives you a replacement command for i3-msg
kill, as well as several additional commands to lock and unlock
containers. A locked container cannot be closed via the usual means -
this also applies for when trying to close its parent container.
The repository can be found here:https://github.com/Igrom/i3-persist
<https://github.com/Igrom/i3-persist>.
The code is released under the 3-clause BSD license.
I hope that the i3 community can benefit from the tool. As I am new to
this, I would be grateful if I could be showed where I can advertise the
tool to those who might find use of it.
Best regards,
Igrom
Serge van Ginderachter
2018-02-26 06:21:22 UTC
Permalink
Hi Igor,


Nice work, thanks for sharing. Allow me to share how I solved this for
myself up until now.

I had the same issue with certain applications (my main browser and
terminals) and wanted to avoid closing them (through the i3 kill command
mapped on `$mod+x`). I solved this by filtering what windows may be closed
with command criteria:

https://github.com/srvg/dotfiles/blob/d368897d8bf887ad12722f865b660fb7223c6a6c/.i3/config#L561

This forces me to close a window through it's own application
functionality, or xkill it, if I really want it closed.


HTH,


Serge van Ginderachter
Post by Igor Sowinski
Dear i3-discuss,
I have recently installed i3 and enjoy the tiling window manager immensely
- especially the quick action enabled with the generous number of
keybindings.
I am used to keeping Thunderbird/Slack open in a separate workspace, so
that I can be notified of any incoming messages. My issue was that I would
eventually switch to that workspace, check all the messages and and close
the windows without thinking - thanks to the learned keybinding.
I have produced a tool which gives you a replacement command for i3-msg
kill, as well as several additional commands to lock and unlock containers.
A locked container cannot be closed via the usual means - this also applies
for when trying to close its parent container.
The repository can be found here: https://github.com/Igrom/i3-persist.
The code is released under the 3-clause BSD license.
I hope that the i3 community can benefit from the tool. As I am new to
this, I would be grateful if I could be showed where I can advertise the
tool to those who might find use of it.
Best regards,
Igrom
Loading...