Default applications: Difference between revisions
Initial page |
m add locations for flatpak-.desktop-files |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 15: | Line 15: | ||
}; | }; | ||
}; | }; | ||
</syntaxhighlight>In case a program is missing a .desktop-file, the following example adds a <code>librewolf.desktop</code> file to the MIME database with the specific binary path.<syntaxhighlight lang="nix"> | </syntaxhighlight> | ||
To list all .desktop-files, run | |||
<syntaxhighlight lang="nix"> | |||
ls /run/current-system/sw/share/applications # for global packages | |||
ls /etc/profiles/per-user/$(id -n -u)/share/applications # for user packages | |||
ls ~/.nix-profile/share/applications # for home-manager packages | |||
ls /var/lib/flatpak/exports/share/applications # for global flatpaks | |||
ls ~/.local/share/flatpak/exports/share/applications/ # for user flatpaks | |||
</syntaxhighlight> | |||
In case a program is missing a .desktop-file, the following example adds a <code>librewolf.desktop</code> file to the MIME database with the specific binary path.<syntaxhighlight lang="nix"> | |||
home-manager.users.myuser = { | home-manager.users.myuser = { | ||
xdg.desktopEntries.librewolf = { | xdg.desktopEntries.librewolf = { | ||
| Line 22: | Line 34: | ||
}; | }; | ||
}; | }; | ||
</syntaxhighlight> | |||
If you don't know the exact mime type of a file, you can use the <code>file</code> command. | |||
<syntaxhighlight lang="shell"> | |||
file --mime-type -b $file_name | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 28: | Line 46: | ||
xdg-open "https://nixos.org" | xdg-open "https://nixos.org" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Home Manager]] | |||