Test if no library

Last time, I asked how to test if there is no application. How to test if there is no library?

AddToFunc MyFunction
+ I Test (libfm-gtk3-4t64) DoStuff
+ I TestRc (NoMatch) DoOtherStuff

My suggestion is learn to read the manual page if you want details on a command. Look up the Test command in the manual page and it states the following.

Performs command if all test-conditions are satisfied. The
test-conditions are keywords with possible arguments from the
list below and are separated by commas or whitespace. They
include: Version operator x.y.z, EnvIsSet varname, EnvMatch
varname pattern, EdgeHasPointer direction, EdgeIsActive
direction, Start, Init, Restart, Exit, Quit, ToRestart, True,
False, F, R, W, X and I. A test-condition prefixed with "!" is
negated.

It lists all the valid keywords you can use, and further down describes what each does.

The F file, R file, W file, X file and I file test-conditions
test for existence of the given [F]ile (possibly with
[R]ead/[W]rite permissions), e[X]ecutable (in $PATH), or the
[I]mage (in ImagePath).

The problem you are going to run in in testing for a library is libraries are not in a shell’s $PATH, so you can really only test if the full path to the library file exists. Since this can vary across oses, it might not be the most robust, but you can use F filename to test if a file exists. You may find just using PipeRead and using the shell more useful, but unsure how to best test for a library exists in the shell either.

I checked the options on fvwm3all manual page, but they have limitations. PipeRead with find / -name "filename" does the broad search I am aiming for, example: find /usr/lib/ -name libfm-gtk*

Perhaps it would be easier if you actually told us what it is you’re trying to do?

It’s utterly bizzare and weird to ask fvwm to search for a .so file – so this leads me to think you’re (ab)using fvwm in a way it’s not designed for – or worse yet – assuming it can be used to solve a specific problem you have, where it’s not required.

Be more specific.

Sorry, I forgot to mention @somiaj suggestion to use PipeRead was the answer to my question. The find shell command search if Pcmanfm in Fvwm Kise is to use the new library libfm-gtk3-4t64 (Debian trixie) or libfm-gtk.so.4.1.3 (Debian bookworm). In other distros, it may not be in the folder /usr/lib/x86_64-linux-gnu/ for F filename to test if the file exists. I am still working on the function.

Window Managers are not meant to keep tabs on versions of 3rd party libraries.

Checking for pcmanfm library versions is something KISE should do on it’s own, meaning you should implement a script that do this for you when KISE is installed. This is one of the reasons as to why projects like NsCDE have an installer that checks if all requirements are met.

You can’t expect FVWM to do everything for you. IS not the right tool for the job.

In Fvwm Kise, you don’t install Pcmanfm. It is a stand-alone file included with the small configs in .fvwm folder. It works the same as a script. Takes less than 1 Mb, and is modified to a drag-and-drop desktop manager. This topic was discussed: Desktop files.

Still feels like an XY problem. You shouldn’t need to modify how things behave based on the location of a library, the linker should be doing this for you. I didn’t look into the details (or care to), but I too thinks this is a hacky approach to doing things a proper way and let the build and or linker do the work.