Igrom / i3-persist

Extends i3 window management with persistent containers
BSD 3-Clause "New" or "Revised" License
28 stars 2 forks source link

Cant get i3-persist to work. #2

Closed DoTheEvo closed 6 years ago

DoTheEvo commented 6 years ago

Hi, I absolutely fucking need persistent workspaces!

I believe this is it right? Even though you call it container.

Anyway, I cant get it to work. instructions are:

1. Download the repository and save in a catalog.

I dont know what catalog is in the i3 context, nor google showed some answer, so I just downloaded, extracted, and placed the folder i3-persist-master in to ~/.config/i3/

2. (Optional) Run tests with ./run_tests.sh

did run it, I get two errors of missing files and then all tests passed

3. Create a symlink to bin/i3-persist in your PATH.

this seems to be saying: create a simlink somewhere thats on your path" so that it gets executed from wherever, I did not dick around and added whole bin/i3-persist to PATH

I setup some keybinds in i3 config, feels unwise to one in your example to be one of the default keybinds for quitting

Anyway, I then used the keypress on an empty workspace, then switcheed to another workspace and it closed still. It seems the keybind did something as I get busy cursor animation so obviously something is happening and keybind does not have --no-startup-id

when I run command i3-persist.sh lock in terminal I get this error about missing command.

Also just so you know, guy running i3 and i3-gaps is happy to include pull request for persistent workspaces in to i3-gaps, something like testing ground for features before going in to i3

If this is about persistent workspaces, I was more thinking about putting in to config lne where you define which workspaces are locked... not much managment later with keypresses.

Igrom commented 6 years ago

Hi DoTheEvo, thanks for your message. I will get back to your questions and concerns regarding the tool ASAP. It might not be until tomorrow evening until I reply - I'm fairly preoccupied with writing my thesis.

Cheers, Igrom

On Sun, Mar 25, 2018, 18:43 DoTheEvo notifications@github.com wrote:

Hi, I absolutely fucking need persistent workspaces!

I believe this is it right? Even though you call it container.

Anyway, I cant get it to work. instructions are:

1. Download the repository and save in a catalog.

I dont know what catalog is in that sentence, nor google showed some answer, so I just downloaded, extracted, and placed the folder i3-persist-master in to ~/.config/i3/

2. (Optional) Run tests with ./run_tests.sh

did run it, I get two errors https://i.imgur.com/7YbFYwR.png of missing files and then all tests passed

3. Create a symlink to bin/i3-persist in your PATH.

this seems to be saying: create a simlink somewhere thats on your path" so that it gets executed from wherever, I did not dick around and added whole bin/i3-persist to PATH

I setup some keybinds in i3 config, feels unwise to one in your example to be one of the default keybinds for quitting

Anyway, I then used the keypress on an empty workspace, then switcheed to another workspace and it closed still. It seems the keybind did something as I get busy cursor animation so obviously something is happening and keybind does not have --no-startup-id

when I run command i3-persist.sh lock in terminal I get this error about missing command. https://i.imgur.com/cvRBZ34.png

Also just so you know, guy running i3 and i3-gaps is happy to include pull request https://github.com/i3/i3/issues/1902 for persistent workspaces in to i3-gaps, something like testing ground for features before going in to i3

If this is about persistent workspaces, I was more thinking about putting in to config lne where you define which workspaces are locked... not much managment later with keypresses.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Igrom/i3-persist/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AJxPBIkHWAV96AS8LswMhFhgKnOsMC2Gks5th8k-gaJpZM4S6NXB .

Igrom commented 6 years ago

Okay.

Addressing your numbered concerns first:

  1. "Catalog" was changed to "folder". I did not notice that the two are likely not synonyms in English, whereas there are such in my mother tongue.

  2. In order to run tests, you need to install shunit2, the shell script testing framework. For example, if you run Debian/Ubuntu, you can do sudo apt install shunit2 to install it. That information was included in README.md, as well as made explicit with a check in run_tests.sh.

  3. That step was done correctly. However, the missing command jq, the command-line JSON processor, is a prerequisite and so has to be installed for the tool to work. Again, if you run Debian/Ubuntu, you can do sudo apt install jq to get it.

I have otherwise reworded the README.md file to be more concise and clear. Additionally, please read the newly added man page for a better understanding of the tool and its capabilities.


I have not read much into the i3/i3-gaps discussion on persistent workspaces and thus am not sure if the tool solves your issue. Instead, I will explain what it does do.

In i3, you can close the currently selected window or container [1] with i3-msg kill ($mod+shift+q) by default. Sometimes, though, you might have a window that you do not want to close by accident (e.g., your mail client or a long-running terminal process).

With this tool, you can state that intent by marking windows as "locked". While that will not yet influence the behaviour of the standard i3 kill command, the tool ships the replacement command i3-persist kill, which does not close windows that are marked as locked. Therefore, my keybindings necessarily replace i3-msg kill with i3-persist kill.


[1] When working in a workspace in i3, the current layout is stored in a tree of window and containers. Simply put, the leaves are windows and every other node except for the root is a container. You can have a look at the diagrams at https://i3wm.org/docs/userguide.html#OrientationSplit to visualize it. In order to select the parent container, use the i3-msg focus parent command (by default bound to $mod+a).

Related commit: e501b7c51a188630ccd2d77461bc83e0a8afba15

DoTheEvo commented 6 years ago

Thanks for the quick and detailed reply.

All the errors I encountered running the test or the persist itself are gone after getting the dependencies - jq and shunit2

I got it to work after reading your explanation on how it suppose to work, but had to give it some tweaks first.

It did not work and I was not sure if anything was getting executed on keybind press. So I added notify-send to the script to know whats happening. This showed that I needed to bindsym the script this way, with .sh included, and without quotation marks. After that I did get the desktop notification(I use dunst for those) that an action took place.

also I googled, surprisingly it seems its not a good practice to name your script .sh

After I re-read your comment and it clicked in my brain that I need to replace my usual kill command with your version of msg kill command so that it can get interrupted I realized it works just fine.

I remember I wanted something like this long time ago, when my muscle memory just closed shit that did not need closing, since everything has its own workspace.

Anyway, feature request time.

Needing to do keypress to activate the immortality... would rather prefer I just put wm_class of the application in to i3 config file. And the custom kill command would check against that setting if it should kill or not. Otherwise it seems that i need to do key press on every boot.

Igrom commented 6 years ago

Thanks for the Google Shell Style Guide from StackOverflow. I'll rename the file in a future release.

I will be grateful if you fleshed out your feature request and created a separate issue for it, so that I or another contributor can address it.