You are not logged in.
Pages: 1
Just migrated over to base arch from Garuda in the last week. Decided to take off the training wheels after 2 years.
I'm running i3 as my WM, Alacritty as the terminal, and Ranger as the file explorer.
Currently I'm trying to configure my dpi in .xinitrc because the scaling of some apps is off. I've created/put it in ~/.config/X11/xorg.conf.d/. Now, I can open it in neovim by navigating there via "cd" or "nvim /...", but when trying to open it in Ranger, it tries to open it in a browser via xdg:
/usr/bin/xdg-open: line 1045: x-www-browser: command not found
/usr/bin/xdg-open: line 1045: firefox: command not found
/usr/bin/xdg-open: line 1045: iceweasel: command not found
/usr/bin/xdg-open: line 1045: seamonkey: command not found
/usr/bin/xdg-open: line 1045: mozilla: command not found
/usr/bin/xdg-open: line 1045: epiphany: command not found
/usr/bin/xdg-open: line 1045: konqueror: command not found
/usr/bin/xdg-open: line 1045: chromium: command not found
/usr/bin/xdg-open: line 1045: chromium-browser: command not found
/usr/bin/xdg-open: line 1045: google-chrome: command not found
/usr/bin/xdg-open: line 1045: www-browser: command not found
/usr/bin/xdg-open: line 1045: links2: command not found
/usr/bin/xdg-open: line 1045: elinks: command not found
/usr/bin/xdg-open: line 1045: links: command not found
/usr/bin/xdg-open: line 1045: lynx: command not found
/usr/bin/xdg-open: line 1045: w3m: command not found
xdg-open: no method available for opening '/home/magi/.config/X11/xorg.conf.d/.xinitrc'Which, interestingly enough, it fails to do because I'm using Vivaldi as my web browser.
Some poking around has pointed me in the direction of MIME configurations, and that I should be setting up a mime config in ~/.config/mimeapps.list, which doesn't exist so I'll have to make one. It wasn't in any of the usual spots listed in the wiki and the only mime config I could find was in /usr/share/applications/mimeinfo.cache, but I'm lead to understand editing that is a fools errand as it gets replaced on updates.
But trying to get any more specific information about setting mime types for dotfile/config files has been useless. It just leads me to a lot of posts talking about/posting configs and dotfiles for mime/nvim/ranger/etc. but not a solution to this problem.
Is there any way to add neovim as a fallback for any general/empty filetype that Ranger doesn't know how to open? Or, assuming that's a solution born of ignorance, a better way to solve this problem?
Last edited by Wandering-Magi (2024-09-16 13:30:02)
Offline
As far as I kinow there is no mimetype for dot-files .
What are the outputs of
$ xdg-mime query filetype /path/to/file
$ xdg-mime query default <insert output of previous command>for that xinitrc file ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
◉ xdg-mime query filetype ~/.xinitrc
text/x-shellscriptPost the xinitrc…
Online
As far as I kinow there is no mimetype for dot-files
No, but a lot of related tools default to using a web browser for the default / catch-all handler for unrecongized types. This is a ridiculous design choice. Switching this to using an editor as a default is a very sensible goal, and that's how I understood the OP's question.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
$ xdg-mime query filetype ~/.config/X11/xorg.conf.d/.xinitrc
inode/x-empty$ xdg-mime query default inode/x-emptyReturns nothing, which is probably why it's going to a browser as the fallback.
The .xinitrc itself is empty, as I haven't put anything in it yet.
Switching this to using an editor as a default is a very sensible goal, and that's how I understood the OP's question.
Exactly; If I can set the default fallback for generic/empty/unknown filetypes to neovim instead of a browser it would probably be for the best. Even if I had a recognized browser, it would be (mostly) useless to just output the text in a browser. In the mean time I've been using:
:open-with nvimAs a stop gap.
Offline
xdg-mime default nvim.desktop inode/x-emptyxdg-open parses $BROWSER, but that's probably not a good idea to tamper with b/c you'll open urls with that.
Online
Pages: 1