View previous topic :: View next topic |
Author |
Message |
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Sat Apr 06, 2024 12:01 pm Post subject: Switching to Linux desktop, nothing works as expected |
|
|
Hi.
This may sound like a rant. I'm trying not to write a rant, but it will probably still sound like a rant to some readers. I'm sorry for this.
I used linux for a long time, but only in console with an occasional firefox started without a desktop environment or even without a window manager. I used Windows for all desktop needs. Now, Windows got so bad, I can't use it anymore. I've been trying to switch to linux deskop and I find it very very frustrating. I tried a big desktop first and it looked and felt like the Windows I was trying to get rid of. Then I found jwm and icewm. These are ok, but I still have some very big usability problems.
I hope some of you found solutions to the same problems I have now. Please share them.
1) Keyboard keys gets stuck when there is I/O activity.
Whenever there is high I/O activity, mostly during disk writes, keyboard keys gets "stuck" pressed. Basically I can't write text while there is a background program doing disk writes. Writtttennnn teeext looksss likkkke thiiis. I had to completely disable key repeat (xset r off) to be able to write, but deleting text and moving the cursor became very difficult without key repeat. Is there something wrong with my Linux? Or is this the way it works and everybody accepts it?
Note that this doesn't happen at all in linux console, not ever, not in any system that I ever used and it never happend in Windows, not in any version that I used, not even Win3.10 on a 486 which didn't even have DMA for it's IDE controller.
2) Firefox insists on opening absolutely all filetypes. How do I remove it's file associations? In fact, how do I remove ALL default file associations from all programs? I did read man xdg-open, and xdg-mime, but I couldn't find the answer. It seems that associations can only be added over the default ones, not removed. If not possible, is there an alternative for xdg in Gentoo?
3) Related to 2). Is there any possibility to make the system ask which program I want to open with? Like shift-right-click - open-with... in Windows* ?
* It's gone in newer windows versions. I'm taking about the usable windows versions: 95 to 7.
4) Also related to 2). Is there a way to list all file associations for all file types? That's another thing I couldn't find in xdg utils.
5) Which program creates open/save dialog windows and directory browse/selection windows? It doesn't appear in top/htop. I find it too limited. There is no context menu on right-click.
Thanks. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54572 Location: 56N 3W
|
Posted: Sat Apr 06, 2024 1:06 pm Post subject: |
|
|
M95D,
That's a set of usability issues. The keyboard auto repeat during high disc IO is new to me.
Lets start with a survey of your hardware.
Please post the output of that will tell about the hardware you have on the PCIe bus and the kernel drivers in use.
Post the output of which shows how your Gentoo is configured.
Lastly, tell us about your kernel. How was it configured and installed?
If you made your own kernel, use wgetpaste to put the .config file onto a pastebin site.
Post the URL, so we can find it. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2718 Location: Here and Away Again
|
Posted: Sat Apr 06, 2024 1:46 pm Post subject: Re: Switching to Linux desktop, nothing works as expected |
|
|
M95D wrote: | 1) Keyboard keys gets stuck when there is I/O activity.
Whenever there is high I/O activity, mostly during disk writes, keyboard keys gets "stuck" pressed. Basically I can't write text while there is a background program doing disk writes. Writtttennnn teeext looksss likkkke thiiis. |
I've seen something like that with wireless keyboards (in particular with a bluetooth one, though that was some ages ago, and probably not Linux-specific either nor related to I/O activity).
Are there other signs of the I/O activity causing issues, such as the mouse cursor being laggy?
Quote: | 2) Firefox insists on opening absolutely all filetypes. How do I remove it's file associations? In fact, how do I remove ALL default file associations from all programs? I did read man xdg-open, and xdg-mime, but I couldn't find the answer. It seems that associations can only be added over the default ones, not removed. If not possible, is there an alternative for xdg in Gentoo? |
Desktop environment do this, and have configuration applications for it, so it should be possible to do in a manual sort of fashion if using just a simple window manager.
I think I did it before using the 'xdg' tools, but I'd need to look into it again to really say anything for sure about it.
Quote: | 3) Related to 2). Is there any possibility to make the system ask which program I want to open with? Like shift-right-click - open-with... in Windows* ? |
This mainly depends on the window manager or/and the desktop environment (LXQt for example does have that).
Some window managers allow for adding custom commands to the menu even.
Quote: | 4) Also related to 2). Is there a way to list all file associations for all file types? That's another thing I couldn't find in xdg utils. |
Yes, though I'm not entirely sure at this time, without looking into it, how to do it in a manual fashion (again using LXQt as an example, there is a configuration utility that lists them all).
Quote: | 5) Which program creates open/save dialog windows and directory browse/selection windows? It doesn't appear in top/htop. I find it too limited. There is no context menu on right-click. |
There is no one program that handles it, and what the dialog does depends on the application a lot.
For example Firefox might be using a GTK+ dialog, but it can be coerced into using a Qt dialog that, for example, LXQt provides, if the appropriate 'xdg-desktop-portal' packages are installed.
The possibilities in general are pretty much endless when I think of using Linux as the operating system, Gentoo Linux in particular, since it basically is a set of tools for one to build their own Linux system. :] _________________ Kindest of regardses. |
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Sat Apr 06, 2024 1:59 pm Post subject: |
|
|
@NeddySeagoon: Please don't send me on a wild goose chase. It's not related to kernel. I built my own hundreds of times, on different PCs, laptops, SBCs and routers. You either had this problem and you already know the solution or you don't. You already said you don't, so let someone else answer it. I'm not being disrespectful, I'm just not confident that there will be a solution after many hours of debugging. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3916
|
Posted: Sat Apr 06, 2024 2:36 pm Post subject: |
|
|
Quote: |
@NeddySeagoon: Please don't send me on a wild goose chase. It's not related to kernel. I built my own hundreds of times, on different PCs, laptops, SBCs and routers. You either had this problem and you already know the solution or you don't. You already said you don't, so let someone else answer it.
|
This kind of attitude will get you nowhere.
It will deter people from even considering to help you _________________
|
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Sat Apr 06, 2024 2:42 pm Post subject: Re: Switching to Linux desktop, nothing works as expected |
|
|
Chiitoo wrote: | Are there other signs of the I/O activity causing issues, such as the mouse cursor being laggy? |
Yes there are. All inputs freeze and all programs that do I/O. I can't say if nfs mounts freeze at the same time - there's another issue with those (timeouts) and I try to avoid them.
It happens a lot when I boot from the USB stick, especially if I open firefox. It happens infrequently when running from spinning rust. I don't remember it happening when it was running from SSD. I use the USB stick a lot and it's been a long time since I disabled key repeat, so I'm not sure anymore.
Chiitoo wrote: | Desktop environment do this, and have configuration applications for it, so it should be possible to do in a manual sort of fashion if using just a simple window manager. |
There is no desktop environment (or maybe my definition is wrong). I just run icewm-session with xinit. I'm sure that xdg-open is the program that lauches firefox for everything, including jpegs. I'm currently trying other window managers, but so far icewm seems the most functional.
Chiitoo wrote: | This mainly depends on the window manager or/and the desktop environment (LXQt for example does have that). |
I was expecting it to be a separate program, but OK, I will try others.
Chiitoo wrote: | Some window managers allow for adding custom commands to the menu even. |
OMG! There are window managers which don't?!? Even Win11 still allows it (in a very complicated way).
Chiitoo wrote: | There is no one program that handles it, and what the dialog does depends on the application a lot. |
Each program draws it's own open/save dialog? If I think about it, it does explain why no two dialogs are the same. I'm a bit suprised because devs usually go to extreme in reusing code. I was expecting it to be a program or at least a library.
Chiitoo wrote: | For example Firefox might be using a GTK+ dialog, but it can be coerced into using a Qt dialog that, for example, LXQt provides, if the appropriate 'xdg-desktop-portal' packages are installed. |
But AFAIK, GTK is a graphics library, not a window manager. It doesn't have dialogs, just buttons, checkboxes, scroll bars, text input areas, etc. Or am I wrong?
Chiitoo wrote: | The possibilities in general are pretty much endless when I think of using Linux as the operating system, Gentoo Linux in particular, since it basically is a set of tools for one to build their own Linux system. :] |
YES! That what I like about it. Except when it comes to desktop, I can't find any decent alternatives. I can't even find a decent file manager like Total Commander. I tried Gnome Commander and it crashes when I open the settings. I tried Worker, and it doesn't even support copy-paste in file rename dialog. It's either a full bloatware destkop like KDE - I would rather run Win11 instead because there's not much difference, or some very basic WMs which have less functionality than Win1.0. There is nothing in the middle. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54572 Location: 56N 3W
|
Posted: Sat Apr 06, 2024 2:53 pm Post subject: |
|
|
M95D,
I've had a laggy system in response to heavy IO. It was eventually traced to a kernel bug. Others experienced it too and it was fixed in the kernel.
If your symptoms were common, we would already know the cause and solution. Indeed, you would be able to read all about in on the forums already.
That is not the case, so it points to something unique to your setup.
You provided no information beyond "it doesn't work", which is not a good bug report.
Its difficult to determine the root cause by guesswork, so I asked for some information to be able to understand your install.
To be a little bit blunt, you need to help us help you. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Sat Apr 06, 2024 2:55 pm Post subject: |
|
|
alamahant wrote: | This kind of attitude will get you nowhere.
It will deter people from even considering to help you |
The other attitude will most likely get me nowhere too, but slower. Google is full of topics with no solution. |
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Sat Apr 06, 2024 3:14 pm Post subject: |
|
|
NeddySeagoon wrote: | M95D,
I've had a laggy system in response to heavy IO. It was eventually traced to a kernel bug. Others experienced it too and it was fixed in the kernel.
If your symptoms were common, we would already know the cause and solution. Indeed, you would be able to read all about in on the forums already.
That is not the case, so it points to something unique to your setup.
You provided no information beyond "it doesn't work", which is not a good bug report.
Its difficult to determine the root cause by guesswork, so I asked for some information to be able to understand your install.
To be a little bit blunt, you need to help us help you. |
Yes, I need your help, but not in the way you think I need.
Over the years I did lots of bug reports. Proper bug reports. Very very few were resolved. It is now my experience that bug don't get resolved unless a dev is affected by it and he/she can solve it on his own. And sometimes, not even then. I fixed bugs and I did pull requests to projects. Only a few of them were accepted, and not because they were bad. They were just ignored with no rejection or even a comment. Sometimes the devs ask for lots of modifications, one at a time, I do each of them, and eventually the PR is ignored anyway. And I'm not the only one. I saw the same thing happen to others. I saw bugs in high-profile projects that were ignored for decades and still are.
So you see, I have no hopes that if I find a bug, it will be resolved. I don't want to find the bugs anymore. I just want a quick solution if it's already known by someone here. Anything else would be just time wasted. Mine and yours. You will say that I am probably too old and grumpy. You will get to this stage too, eventually. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54572 Location: 56N 3W
|
Posted: Sat Apr 06, 2024 3:24 pm Post subject: |
|
|
M95D,
It's unlikely that you have a bug. Bugs don't affect single users.
I'm old and cynical already. It comes from over 60 years playing with computers: ) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Tout n00b
Joined: 18 Jul 2020 Posts: 49
|
Posted: Sat Apr 06, 2024 3:25 pm Post subject: Re: Switching to Linux desktop, nothing works as expected |
|
|
M95D wrote: | Hi.
...
3) Related to 2). Is there any possibility to make the system ask which program I want to open with? Like shift-right-click - open-with... in Windows* ?
* It's gone in newer windows versions. I'm taking about the usable windows versions: 95 to 7.
...
Thanks. |
In Gnome this is default behaviour. Gnome Files, I guess it is Nautilus might be responsible for this I guess.
Edit: Right click and Open With opens a dialog and you can choose to always open with that program you choose or not. |
|
Back to top |
|
|
sublogic Apprentice
Joined: 21 Mar 2022 Posts: 269 Location: Pennsylvania, USA
|
Posted: Sat Apr 06, 2024 11:09 pm Post subject: |
|
|
M95D wrote: | 1) Keyboard keys gets stuck when there is I/O activity.
Whenever there is high I/O activity, mostly during disk writes, keyboard keys gets "stuck" pressed. Basically I can't write text while there is a background program doing disk writes. Writtttennnn teeext looksss likkkke thiiis. |
Quote: | Chitoo wrote: | Are there other signs of the I/O activity causing issues, such as the mouse cursor being laggy? | Yes there are. All inputs freeze and all programs that do I/O. |
Is this a constrained memory system ? I have a laptop with 1 GB and a tendency to go catatonic if I open too many tabs in Firefox. (Never saw the auutoreeepeat effect though.) A workaround is to run Firefox with ionice -c idle. The laptop then gets merely sluggish and I can eventually get focus to a shell window and kill the fox with extreme prejudice.
Quote: | It happens a lot when I boot from the USB stick, especially if I open firefox. It happens infrequently when running from spinning rust. | Disk I/O off a USB stick ? Can you elaborate ?
Anyway if you have lots of memory this is a false lead, sorry for the noise. |
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 3005 Location: Edge of marsh USA
|
Posted: Sun Apr 07, 2024 3:42 am Post subject: |
|
|
Actualy, M95D, you are copping a rant and you are being rude to those who have commented on this thread. Are you running Gentoo? If so, welcome to Gentoo. From what I can understand from what you've written, you have attempted to install a minimal desktop system and tried a couple window managers that you don't know how to configure and find it frustrating.
I suggest that you do two things. Install the full xfce4 desktop and it will install easily and be pre-configured to do most of the things you indicate that you want, and it will be easy to configure most desktop management things in the GUI. Also, install the gentoo binary kernel. Doing so will give you a safely and generically but properly installed kernel that may likely eliminate the I/O issues.
Code: | emerge -a xfce-base/xfce4-meta
emerge -a sys-kernel/gentoo-kernel-bin |
You can always remove these things if you don't find them helpful or they don't suit your tastes.
If you want help without installing a desktop and binary kernel, then you really need to share the system info requested by NeddySeagoon. BTW, @username does not serve a function in these Gentoo forums. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Sun Apr 07, 2024 5:18 am Post subject: |
|
|
sublogic wrote: | Is this a constrained memory system ? I have a laptop with 1 GB and a tendency to go catatonic if I open too many tabs in Firefox. |
No. 20GB. I never open more than ~10 tabs. Even if it was memory constrained, like you said, shouldn't cause keyboard repeat issues or at least it would happen in console too.
sublogic wrote: | Disk I/O off a USB stick ? Can you elaborate ? |
To me, all storage is "disk", even mounted MTDs. |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2366
|
Posted: Sun Apr 07, 2024 5:33 am Post subject: |
|
|
M95D,
You definitely have a kernel and perhaps a hardware problem, but also an attitude problem. Go fix your attitude first and then come back for you kernel problem.
Best Regards,
Georgi |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54572 Location: 56N 3W
|
Posted: Sun Apr 07, 2024 10:12 am Post subject: |
|
|
M95D,
I may be able to help when I have some information to work with.
While it's a guessing game. I'll just watch.
Your RAM is shown in
sublogic would not have asked about memory, if you had posted the information I asked for. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2718 Location: Here and Away Again
|
Posted: Sun Apr 07, 2024 1:16 pm Post subject: Re: Switching to Linux desktop, nothing works as expected |
|
|
M95D wrote: | Chiitoo wrote: | Are there other signs of the I/O activity causing issues, such as the mouse cursor being laggy? |
Yes there are. All inputs freeze and all programs that do I/O. I can't say if nfs mounts freeze at the same time - there's another issue with those (timeouts) and I try to avoid them.
It happens a lot when I boot from the USB stick, especially if I open firefox. It happens infrequently when running from spinning rust. I don't remember it happening when it was running from SSD. I use the USB stick a lot and it's been a long time since I disabled key repeat, so I'm not sure anymore. |
Hm, that is interesting that it happens when booting from an USB stick. What does that boot into?
I wonder if that could be a good hint towards the cause... are there any relevent-like messages in 'dmesg' for example?
It might be a good idea to create a new topic to hunt for that specific problem, if you are willing to hunt for it, but to go back to the original post a bit, no, that certainly does not seem like a normal thing to be happening.
M95D wrote: | Chiitoo wrote: | Desktop environment do this, and have configuration applications for it, so it should be possible to do in a manual sort of fashion if using just a simple window manager. |
There is no desktop environment (or maybe my definition is wrong). I just run icewm-session with xinit. I'm sure that xdg-open is the program that lauches firefox for everything, including jpegs. I'm currently trying other window managers, but so far icewm seems the most functional. |
Yeah, I was referring to DEs as a general example, but whatever they do, should be possible to do without as well, but I would need to look into it more myself to be able to say for sure what exactly that is.
M95D wrote: | Chiitoo wrote: | This mainly depends on the window manager or/and the desktop environment (LXQt for example does have that). |
I was expecting it to be a separate program, but OK, I will try others.
|
There might be stand-alone applications for that, it would not surprise me, but I don't know of any at this time.
Again using LXQt as an example (not an advertisement, I promise, it is just what I am the most familiar with), I believe it it has these built in to the 'libfm-qt' [1] library (which makes use of the Qt framework), which the file-manager, 'pcmanfm-qt', then makes use of.
1. https://github.com/lxqt/libfm-qt/tree/master/src
M95D wrote: | Chiitoo wrote: | Some window managers allow for adding custom commands to the menu even. |
OMG! There are window managers which don't?!? Even Win11 still allows it (in a very complicated way). |
I don't have any examples to share, but I think it certainly is a possibility. :]
M95D wrote: | Chiitoo wrote: | There is no one program that handles it, and what the dialog does depends on the application a lot. |
Each program draws it's own open/save dialog? If I think about it, it does explain why no two dialogs are the same. I'm a bit suprised because devs usually go to extreme in reusing code. I was expecting it to be a program or at least a library. |
I meant that there are several ways to do it, and while some probably /do/ draw their own, most will likely use a framework such as Qt or GTK+, or some specific library.
M95D wrote: | Chiitoo wrote: | For example Firefox might be using a GTK+ dialog, but it can be coerced into using a Qt dialog that, for example, LXQt provides, if the appropriate 'xdg-desktop-portal' packages are installed. |
But AFAIK, GTK is a graphics library, not a window manager. It doesn't have dialogs, just buttons, checkboxes, scroll bars, text input areas, etc. Or am I wrong? |
No, not a window manager, but a library indeed. Or more like a toolkit/framework, which I do believe is providing the dialogs [2] and such for applications like Firefox.
It being described as the 'GIMP ToolKit' still in some places may be a bit misleading with regards to what it actually includes, and what it is being used for (originally having been designed and used for the GNU Image Manipulation Program).
2. https://gitlab.gnome.org/GNOME/gtk/-/tree/main/gtk/ui
M95D wrote: | Chiitoo wrote: | The possibilities in general are pretty much endless when I think of using Linux as the operating system, Gentoo Linux in particular, since it basically is a set of tools for one to build their own Linux system. :] |
YES! That what I like about it. Except when it comes to desktop, I can't find any decent alternatives. I can't even find a decent file manager like Total Commander. I tried Gnome Commander and it crashes when I open the settings. I tried Worker, and it doesn't even support copy-paste in file rename dialog. It's either a full bloatware destkop like KDE - I would rather run Win11 instead because there's not much difference, or some very basic WMs which have less functionality than Win1.0. There is nothing in the middle. |
I am fairly optimistic in that you should be able to find something that is just right for you, but it might take a while to find.
I think I started my Gentoo journey with KDE 3, some Xfce and Enlightenment too (e15/e16), but moved to LXQt after KDE 4. I have been using parts of KDE Frameworks 5 though, well, actually 6 now, because I haven't found a window manager that I like as much as I like KWin (LXQt doesn't have one of its own).
I think LXQt does do a good job at being somewhere in the middle, being very modular and quite simplistic, and is not tied to one window manager (again, not an advertisement!). Somehow I ended up maintaining it for Gentoo... which definitely is not something I thought I would ever be doing when I started using Gentoo (which is how I started using Linux in the first place). _________________ Kindest of regardses. |
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Fri Apr 12, 2024 2:54 pm Post subject: |
|
|
Like I said before, I'm not going to try to debug the keyboard glitches.
Let me ask something simple instead.
When I open a jpeg file with xdg-open, how do I make it NOT open with firefox? How do I remove firefox from the list (or table or whatever it is) of programs that can open jpeg files? And where is that list? |
|
Back to top |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2718 Location: Here and Away Again
|
Posted: Fri Apr 12, 2024 5:50 pm Post subject: |
|
|
I'm not entirely sure about this, but I'm guessing you would need to remove the '/usr/share/applications/firefox-bin.desktop' file for Firefox to not be considered for that list, assuming that your file-manager actually follows the 'xdg-mime' specification [1].
I'll need to look into that more at some point.
To change the default, using 'xdg-utils' [2], also assuming the specification is being followed:
Code: | xdg-mime default lximage-qt.desktop image/jpeg |
1. https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/
2. https://www.freedesktop.org/wiki/Software/xdg-utils/ _________________ Kindest of regardses. |
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Fri Apr 12, 2024 6:09 pm Post subject: |
|
|
I looked inside firefox.desktop file. There is nothing related to jpeg in it.
Here it is. I only removed the translations.
Code: |
[Desktop Entry]
Version=1.0
Name=Mozilla Firefox
GenericName=Web Browser
Comment=Browse the Web
Exec=firefox %u
Icon=firefox
Terminal=false
Type=Application
MimeType=application/pdf;application/vnd.mozilla.xul+xml;application/xhtml+xml;text/html;text/mml;text/xml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window]
Name=Open a New Window
Exec=firefox --private-window %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Exec=firefox --ProfileManager
|
I suspect that removing this file will remove firefox as the default web browser too. That is not what I want, but if there is no other way, I can live with that.
I tried the second option:
Code: |
$ xdg-mime query filetype FJR-Model-History.pdf
application/pdf
$ xdg-mime default /usr/share/applications/xpdf.desktop application/pdf
$ xdg-mime query default application/pdf
/usr/share/applications/xpdf.desktop
$ xdg-open FJR-Model-History.pdf
Opening "FJR-Model-History.pdf" with winebrowser (application/pdf)
wine: invalid directory "/home/<user>/.wine" in WINEPREFIX: not an absolute path
/usr/bin/xdg-open: line 874: x-www-browser: command not found
... and firefox opens.
|
PS: I removed /usr/share/applications/firefox-esr.desktop . No change. Everything still opens with firefox. |
|
Back to top |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2718 Location: Here and Away Again
|
Posted: Fri Apr 12, 2024 7:22 pm Post subject: |
|
|
M95D wrote: | I looked inside firefox.desktop file. There is nothing related to jpeg in it.
Here it is. I only removed the translations.
Code: |
[Desktop Entry]
Version=1.0
Name=Mozilla Firefox
GenericName=Web Browser
Comment=Browse the Web
Exec=firefox %u
Icon=firefox
Terminal=false
Type=Application
MimeType=application/pdf;application/vnd.mozilla.xul+xml;application/xhtml+xml;text/html;text/mml;text/xml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window]
Name=Open a New Window
Exec=firefox --private-window %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Exec=firefox --ProfileManager
|
I suspect that removing this file will remove firefox as the default web browser too. That is not what I want, but if there is no other way, I can live with that. |
Yeah, I wanted to add "or modify" there, but went AFK before thinking of it.
Quote: | I tried the second option:
Code: |
$ xdg-mime query filetype FJR-Model-History.pdf
application/pdf
$ xdg-mime default /usr/share/applications/xpdf.desktop application/pdf
$ xdg-mime query default application/pdf
/usr/share/applications/xpdf.desktop
$ xdg-open FJR-Model-History.pdf
Opening "FJR-Model-History.pdf" with winebrowser (application/pdf)
wine: invalid directory "/home/<user>/.wine" in WINEPREFIX: not an absolute path
/usr/bin/xdg-open: line 874: x-www-browser: command not found
... and firefox opens.
|
PS: I removed /usr/share/applications/firefox-esr.desktop . No change. Everything still opens with firefox. |
Hm, that does look odd.
I tested it here just now, and it seems to work for me:
Code: | $ xdg-mime default /usr/share/applications/xpdf.desktop application/pdf
qtxdg.mimeapps.glib: Set '/usr/share/applications/xpdf.desktop' as the default for 'application/pdf' |
Then 'xdg-open' opens a PDF with 'xpdf'.
For some reason you don't seem to have the "Set" message, though the default seems to be set to what you set it to regardless...
Not sure what is going on there. Only idea really that comes to mind, is running 'xdg-open' via 'strace' to see what exactly is going on, but it gets quite verbose, and not sure if helpful in the end.
Sidey-note, that message about 'WINEPREFIX' looks a bit odd too! _________________ Kindest of regardses. |
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Sat Apr 13, 2024 6:53 pm Post subject: |
|
|
I removed all wine*.desktop files, but the situation is unchanged. There is probably some form of cache or generated list of programs-mime associations that are not automatically updated when desktop files are removed. Or... maybe it doesn't use .desktop files at all, since firefox-esr.desktop had nothing with jpeg inside it. |
|
Back to top |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2718 Location: Here and Away Again
|
Posted: Wed Apr 17, 2024 7:57 am Post subject: |
|
|
I tried 'icewm' here too, and it seems to behave the same as my usual X11 sessions do.
M95D wrote: | I removed all wine*.desktop files, but the situation is unchanged. There is probably some form of cache or generated list of programs-mime associations that are not automatically updated when desktop files are removed. Or... maybe it doesn't use .desktop files at all, since firefox-esr.desktop had nothing with jpeg inside it. |
I did forget about
Code: | $HOME/.local/share/applications/mimeapps.list |
and
Code: | $HOME/.local/share/applications/mimeinfo.cache |
as well as
Code: | $HOME/config/mimeapps.list |
that may have been generated for you.
If nothing exist under the user's home directory, at least the '/usr/share/applications' path is considered for system-wide installations.
I looked into 'xdg-utils' a bit more too, and 'xdg-open' in particular says the following:
Code: | 80 query default
81
82 Returns the default application that the desktop environment uses
83 for opening files of type mimetype. The default application is
84 identified by its *.desktop file.
85
86 The value returned by this command may or may not match the
87 application launched by xdg-open as xdg-open hands over to desktop
88 specific openers most of the time which may implement their own
89 logic.
90
91 The query default option is for use inside a desktop session only.
92 It is not recommended to use xdg-mime query default as root. |
I guess that might explain why it says something is the default, but then it's not being used in the end.
For my usual session, running via 'strace', it seems to hand things over to '/usr/bin/qtxdg-mat' which belons to 'app-misc/qtxdg-tools', which makes sense for an LXQt session.
In the 'icewm' session, it seems to be using 'grep' for me.
Seems like 'xdg-mime' decides on this via set of functions that detect the common desktop environments, and for the rest, a generic one is used [1], which writes things in '$HOME/config/mimeapps.list'.
In the end, there's also [2]
Code: | update_mime_database "$xdg_base_dir" |
which might translate to
Code: | /usr/bin/update-mime-database $HOME/.local/share/mime/ |
for me at least, although I don't actually see it being executed during this quick test.
As for why 'firefox' is listed for images at all when it has nothing for them in the desktop-file, I'm still not entirely sure, but on my system I can see find it lurking in '$HOME/config/mimeapps.list':
Code: | [Added Associations]
[...]
image/jpeg=lximage-qt.desktop;zzz-gimp.desktop;feh.desktop;gwenview.desktop;firefox-bin.desktop;
|
I hope some of this quick look is able to at least give some hints towards what is going on there.
1. https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-mime.in?h=v1.2.1#n292
2. https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-mime.in?h=v1.2.1#n1077 _________________ Kindest of regardses. |
|
Back to top |
|
|
M95D Tux's lil' helper
Joined: 03 Jan 2020 Posts: 94
|
Posted: Wed Apr 17, 2024 11:03 am Post subject: |
|
|
There is no ~/.local/share/applications/mimeapps.list
I probably should create that... ?
mimeinfo.cache exists and it explains wine-related messages, but there is no firefox inside.
This is becoming extremely complicated. I'll just set xdg-open non-executable and open files the old fashion way. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|