You are not logged in.

#1 2021-01-03 12:40:33

akinhet
Member
Registered: 2020-12-30
Posts: 11

[SOLVED] dmenu doesn't detect soft links in /usr/bin

I have a git repo with a few scripts that I want to be able to run using dmenu. They're very basic utilities, like color picker or screenshot maker. I soft linked them to /bin and then tried to run them using dmenu, but as expected it didn't see them. What's weird is that even after I cleared dmenu cache, it still didn't see my scripts.
Then, after some experimentation I discovered that if I copy the scripts to /bin directly, dmenu not only sees them, but also my links! Though as soon as I deleted the scripts links disappeared from dmenu again. I also tried hard links, but I realized that I can't do that, as my /home is on a separate partition.

Is there a way to force dmenu to read my scripts?

I don't even understand why it happens, as many other programs in /usr/bin are linked and yet they work normally.

Last edited by akinhet (2021-01-03 14:49:46)

Offline

#2 2021-01-03 14:00:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,632

Re: [SOLVED] dmenu doesn't detect soft links in /usr/bin

stat /bin/yourscriptlink
realpath /bin/yourscriptlink
stat $(realpath /bin/yourscriptlink)

Offline

#3 2021-01-03 14:15:40

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,599

Re: [SOLVED] dmenu doesn't detect soft links in /usr/bin

akinhet wrote:

Is there a way to force dmenu to read my scripts?

You need to make them visable..

find /usr/bin -type l -printf '%f\n' | sort | dmenu

I may have misunderstood, but this make soft links visable.

Offline

#4 2021-01-03 14:35:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,632

Re: [SOLVED] dmenu doesn't detect soft links in /usr/bin

I'd assume he's talking abotu dmenu_run which should™ use "stest -slx" on the file.

Offline

#5 2021-01-03 14:48:41

akinhet
Member
Registered: 2020-12-30
Posts: 11

Re: [SOLVED] dmenu doesn't detect soft links in /usr/bin

As it turns out, when making links I didn't specify full path to the target so it defaulted to the same folder, which made a link from /bin/link to /bin/script, even though the /bin/script didn't exist. Thank you guys for help.

Offline

#6 2021-01-03 15:12:21

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,599

Re: [SOLVED] dmenu doesn't detect soft links in /usr/bin

seth wrote:

I'd assume he's talking abotu dmenu_run which should™ use "stest -slx" on the file.

I never use dmenu_run and OP never said what he/she does use, so you may be right..;)

Offline

#7 2021-01-03 15:22:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: [SOLVED] dmenu doesn't detect soft links in /usr/bin

A better approach would be just to add the location of your scripts to your PATH.  There'd be no need for root access or for cluttering your /bin


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2021-01-06 11:35:52

GSMiller
Member
Registered: 2020-11-23
Posts: 75

Re: [SOLVED] dmenu doesn't detect soft links in /usr/bin

akinhet, I have many symlinks in $HOME/bin, and dmenu_run sees them!


A dog is a man's best friend.

Offline

Board footer

Powered by FluxBB