deadc0de6 / i3altlayout

i3wm efficient screen real estate
GNU General Public License v3.0
46 stars 5 forks source link

Installation problem #4

Closed GiangiGiangi closed 1 year ago

GiangiGiangi commented 1 year ago

hi, I tried to install this forck on my gentoo, but I get this error: error: externally-managed-environment

× This environment is externally managed I then proceeded to install the pythin3 virtualenv package and repeated the installation: (routersploit_env) jean@kuka ~/Desktop/routersploit_env $ pip3 install i3altlayout Requirement already satisfied: i3altlayout in ./lib/python3.11/site-packages (1.1.2) Requirement already satisfied: docopt in ./lib/python3.11/site-packages (from i3altlayout) (0.6.2) Requirement already satisfied: i3ipc in ./lib/python3.11/site-packages (from i3altlayout) (2.2.1) Requirement already satisfied: python-xlib in ./lib/python3.11/site-packages (from i3ipc->i3altlayout) (0.33) Requirement already satisfied: six>=1.10.0 in ./lib/python3.11/site-packages (from python-xlib->i3ipc->i3altlayout) (1.16.0) sudo mkdir -p /tmp/i3altlayout && pip3 download -d /tmp/i3altlayout i3altlayout Collecting i3altlayout Using cached i3altlayout-1.1.2-py3-none-any.whl (16 kB) Collecting docopt (from i3altlayout) Using cached docopt-0.6.2.tar.gz (25 kB) Preparing metadata (setup.py) ... done Collecting i3ipc (from i3altlayout) Using cached i3ipc-2.2.1-py3-none-any.whl (26 kB) Collecting python-xlib (from i3ipc->i3altlayout) Using cached python_xlib-0.33-py2.py3-none-any.whl (182 kB) Collecting six>=1.10.0 (from python-xlib->i3ipc->i3altlayout) Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Saved /tmp/i3altlayout/i3altlayout-1.1.2-py3-none-any.whl Saved /tmp/i3altlayout/docopt-0.6.2.tar.gz Saved /tmp/i3altlayout/i3ipc-2.2.1-py3-none-any.whl Saved /tmp/i3altlayout/python_xlib-0.33-py2.py3-none-any.whl Saved /tmp/i3altlayout/six-1.16.0-py2.py3-none-any.whl Successfully downloaded i3altlayout docopt i3ipc python-xlib six

pip3 install --no-index --find-links=/tmp/i3altlayout i3altlayout Looking in links: /tmp/i3altlayout Requirement already satisfied: i3altlayout in ./lib/python3.11/site-packages (1.1.2) Requirement already satisfied: docopt in ./lib/python3.11/site-packages (from i3altlayout) (0.6.2) Requirement already satisfied: i3ipc in ./lib/python3.11/site-packages (from i3altlayout) (2.2.1) Requirement already satisfied: python-xlib in ./lib/python3.11/site-packages (from i3ipc->i3altlayout) (0.33) Requirement already satisfied: six>=1.10.0 in ./lib/python3.11/site-packages (from python-xlib->i3ipc->i3altlayout) (1.16.0)

and added the line: exec --no-startup-id "/home/jean/Desktop/routersploit_env/bin/i3altlayout" in my config file... But it won't boot, it always stays with i3 classic view

deadc0de6 commented 1 year ago

If you setup i3altlayout through a virtualenv, then you'll have to load that virtualenv before calling i3altlayout. Something like this:

source /home/jean/Desktop/routersploit_env/bin/activate && /home/jean/Desktop/routersploit_env/bin/i3altlayout

Make sure the above works, then in i3 config that'd be

exec --no-startup-id "source /home/jean/Desktop/routersploit_env/bin/activate && /home/jean/Desktop/routersploit_env/bin/i3altlayout"
GiangiGiangi commented 1 year ago

entering the suggested command: kuka /home/jean/Desktop/routersploit_env # source bin/activate (routersploit_env) kuka /home/jean/Desktop/routersploit_env # source /home/jean/Desktop/routersploit_env/bin/activate && /home/jean/Desktop/routersploit_env/bin/i3altlayout Traceback (most recent call last): File "/home/jean/Desktop/routersploit_env/bin/i3altlayout", line 8, in sys.exit(main()) ^^^^^^ TypeError: main() missing 2 required positional arguments: 'spath' and 'ppath'

deadc0de6 commented 1 year ago

This is quite weird since there's no such line in i3altlayout source code: https://github.com/deadc0de6/i3altlayout/blob/master/i3altlayout/i3altlayout.py#L8.

Can you check the version you have with something like that: grep VERSION /home/jean/Desktop/routersploit_env/bin/i3altlayout. It might be also interesting to compare the file content with the content on github here.

From my point of view, what you are trying to run is NOT the i3altlayout distributed either from github or from pypi.

GiangiGiangi commented 1 year ago

I repeated the installation following the guide point by point:

(routersploit_env) kuka /home/jean/Desktop/routersploit_env # pip3 install i3altlayout Requirement already satisfied: i3altlayout in ./lib/python3.11/site-packages (1.1.2) Requirement already satisfied: docopt in ./lib/python3.11/site-packages (from i3altlayout) (0.6.2) Requirement already satisfied: i3ipc in ./lib/python3.11/site-packages (from i3altlayout) (2.2.1) Requirement already satisfied: python-xlib in ./lib/python3.11/site-packages (from i3ipc->i3altlayout) (0.33) Requirement already satisfied: six>=1.10.0 in ./lib/python3.11/site-packages (from python-xlib->i3ipc->i3altlayout) (1.16.0) (routersploit_env) kuka /home/jean/Desktop/routersploit_env # mkdir -p /tmp/i3altlayout && pip3 download -d /tmp/i3altlayout i3altlayout Collecting i3altlayout File was already downloaded /tmp/i3altlayout/i3altlayout-1.1.2-py3-none-any.whl Collecting docopt (from i3altlayout) File was already downloaded /tmp/i3altlayout/docopt-0.6.2.tar.gz Preparing metadata (setup.py) ... done Collecting i3ipc (from i3altlayout) File was already downloaded /tmp/i3altlayout/i3ipc-2.2.1-py3-none-any.whl Collecting python-xlib (from i3ipc->i3altlayout) File was already downloaded /tmp/i3altlayout/python_xlib-0.33-py2.py3-none-any.whl Collecting six>=1.10.0 (from python-xlib->i3ipc->i3altlayout) File was already downloaded /tmp/i3altlayout/six-1.16.0-py2.py3-none-any.whl Successfully downloaded i3altlayout docopt i3ipc python-xlib six (routersploit_env) kuka /home/nemo/Desktop/routersploit_env # source /home/jean/Desktop/routersploit_env/bin/activate && /home/jean/Desktop/routersploit_env/bin/i3altlayout Traceback (most recent call last): File "/home/jean/Desktop/routersploit_env/bin/i3altlayout", line 8, in sys.exit(main()) ^^^^^^ TypeError: main() missing 2 required positional arguments: 'spath' and 'ppath

deadc0de6 commented 1 year ago

So let's step back a little. There are two installation methods on the readme, one if you're online (what seems to be your case) and one if the host on which you want install i3altlayout is offline. You have to use one of them, not both.

Step (1) - I'm taking you're online so the installation method is:

sudo pip3 install i3altlayout

This will install i3altlayout globally on your system and thus you must use sudo.

Step (2) - Once the above is done, make sure that you can call the binary directly

i3altlayout

You can see where the binary is with something like which i3altlayout. Let it run in a terminal and try to open a few windows in your i3 to see the alt layout in action.

Step (3) - Once you can validate the above works, you can then add the following entry in your i3 config file:

exec --no-startup-id "i3altlayout"

It will only be effective on next reboot / restart of i3.

GiangiGiangi commented 1 year ago

nemo@kuka ~ $ cd Desktop nemo@kuka ~/Desktop $ ls routersploit_env virtualenv nemo@kuka ~/Desktop $ cd routersploit_env nemo@kuka ~/Desktop/routersploit_env $ source bin/activate (routersploit_env) nemo@kuka ~/Desktop/routersploit_env $ sudo pip3 install i3altlayout Password: error: externally-managed-environment

× This environment is externally managed ╰─> The system-wide Python installation in Gentoo should be maintained using the system package manager (e.g. emerge).

If the package in question is not packaged for Gentoo, please
consider installing it inside a virtual environment, e.g.:

python -m venv /path/to/venv
. /path/to/venv/bin/activate
pip install mypackage

To exit the virtual environment, run:

deactivate

The virtual environment is not deleted, and can be re-entered by
re-sourcing the activate file.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. (routersploit_env) nemo@kuka ~/Desktop/routersploit_env $ sudo pip install i3altlayout error: externally-managed-environment

× This environment is externally managed ╰─> The system-wide Python installation in Gentoo should be maintained using the system package manager (e.g. emerge).

If the package in question is not packaged for Gentoo, please
consider installing it inside a virtual environment, e.g.:

python -m venv /path/to/venv
. /path/to/venv/bin/activate
pip install mypackage

To exit the virtual environment, run:

deactivate

The virtual environment is not deleted, and can be re-entered by
re-sourcing the activate file.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification.

the problem is that using sudo gives me this error (even as root)

deadc0de6 commented 1 year ago

Don't use a virtualenv. Follow the steps above.