conformal / spectrwm

A small dynamic tiling window manager for X11.
ISC License
1.33k stars 96 forks source link

nix package manager fails with LD_PRELOAD #500

Closed rene-tobner closed 9 months ago

rene-tobner commented 2 years ago

installed multi user version from: https://nixos.org/download.html

in virtual term I get:

(~)$ > nix repl '<nixpkgs>'
nix: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

In non-virtual terminal, the console, I have the REPL working.

Not necessary a solution, but isn't it possible to put libswmhack into spectrwm binary? OK, static compiling! But, the reason for having libswmhack a shared object is to pull applications on specific workspaces, i.e. autorun = ws[2] prog? Isn't this possible with data structures alone in the spectrwm binary?

rene-tobner commented 2 years ago

workaround found:

unset LD_PRELOAD in bashrc or LD_PRELOAD= nix (note the space after =)

But anyhow: For programs running in a terminal only, not spawning a new window: setting this env var with swmhack, does not make sense, or?

LordReg commented 2 years ago

swmhack is currently needed for spawn-in-workspace behavior when spawning programs.

When a window is created, is not possible for the window manager to know which program/command led to the creation of the window. swmhack exists for this reason.

Since swmhack works by intercepting calls made by X11 clients, LD_PRELOAD is needed.

If you run into problems with LD_PRELOAD/swmhack for some spawn program, you can workaround the issue by starting the program via a script that adjusts the env or do something like this:

program[action] = sh -c 'unset LD_PRELOAD; command'