You are not logged in.

#1 2024-04-27 20:36:22

blutlauge
Member
Registered: 2024-04-27
Posts: 4

[SOLVED] Weird xdg-mime behavior

Only recently I observed that it was no longer possible to open a file via nnn or lf file managers. Instead of opening the file the system produces another file called "test.--version" in the current directory and starts eating up the whole RAM until it eventually freezes.

I further investigated the issue and found out that there is not a single "mimeapps.list" file present on the system and that the command

xdg-mime query filetype FILE

seems to cause the problem.

Furthermore it is worth noting that this issue only occurs when using a window manager (dwm, herbstluftwm) and not when using a desktop environment  (XFCE, Gnome).

Any ideas what I can do about this issue? Thanks in advance!

Last edited by blutlauge (2024-04-28 06:18:57)

Offline

#2 2024-04-27 20:56:34

seth
Member
Registered: 2012-09-03
Posts: 52,226

Re: [SOLVED] Weird xdg-mime behavior

xdg-mime is a shell script, you can add "set -x" below the shebang to trace its execution.

only occurs when using a window manager (dwm, herbstluftwm) and not when using a desktop environment

Do you start the sessions the same way (eg. lightdm ot startx)?

Offline

#3 2024-04-28 06:18:39

blutlauge
Member
Registered: 2024-04-27
Posts: 4

Re: [SOLVED] Weird xdg-mime behavior

Thanks for the quick reply!

In fact I knew that xdg-mime is a shell script. I had a look at it and even did a

bash -x xdg-mime query filetype FILE

before. But I could not figure out where the problem lies.

After reading your response I had another look and eventually found the cause of the weird behavior. I wrote a shell script called "mimetype" - I renamed it only recently - for automating the creation of a  personal mimeapps.list file. And xdg-mime checks whether an executable called "mimetype" is present on the system via

if mimetype --version > /dev/null 2&>1; then
...

and therefore calls my shell script with the argument "--version". Consequently the file "test.--version" is created by my shell script. This check is only performed when not using a desktop environment. I renamed my script and now xdg-mime works as it should again.

Last edited by blutlauge (2024-04-28 07:10:41)

Offline

Board footer

Powered by FluxBB