158 lines
4.7 KiB
Nix
158 lines
4.7 KiB
Nix
{ ... }:
|
|
{
|
|
config.dendritic.features.dolphin.homeModules = [
|
|
(
|
|
{ pkgs, config, ... }:
|
|
let
|
|
user = config.dendritic.current.primaryUser;
|
|
|
|
placesXbel = ''
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE xbel>
|
|
<xbel version="1.0"
|
|
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks">
|
|
|
|
<bookmark href="file:///home/${user}/Documents">
|
|
<title>Documents</title>
|
|
<info>
|
|
<metadata owner="http://freedesktop.org">
|
|
<bookmark:icon name="folder-documents"/>
|
|
<bookmark:isSystemItem>false</bookmark:isSystemItem>
|
|
</metadata>
|
|
</info>
|
|
</bookmark>
|
|
|
|
<bookmark href="file:///home/${user}/Downloads">
|
|
<title>Downloads</title>
|
|
<info>
|
|
<metadata owner="http://freedesktop.org">
|
|
<bookmark:icon name="folder-download"/>
|
|
<bookmark:isSystemItem>false</bookmark:isSystemItem>
|
|
</metadata>
|
|
</info>
|
|
</bookmark>
|
|
|
|
<bookmark href="file:///home/${user}/repos">
|
|
<title>Repositories</title>
|
|
<info>
|
|
<metadata owner="http://freedesktop.org">
|
|
<bookmark:icon name="folder-git"/>
|
|
<bookmark:isSystemItem>false</bookmark:isSystemItem>
|
|
</metadata>
|
|
</info>
|
|
</bookmark>
|
|
</xbel>
|
|
'';
|
|
in
|
|
{
|
|
|
|
home.packages = with pkgs; [
|
|
kdePackages.dolphin
|
|
kdePackages.kio
|
|
kdePackages.kio-extras
|
|
kdePackages.kio-fuse
|
|
kdePackages.ark
|
|
kdePackages.ffmpegthumbs
|
|
kdePackages.kdegraphics-thumbnailers
|
|
kdePackages.kpipewire
|
|
whitesur-icon-theme
|
|
];
|
|
|
|
# Helps some non-KDE apps pick Dolphin for directory browsing.
|
|
xdg.mimeApps = {
|
|
enable = true;
|
|
defaultApplications = {
|
|
"inode/directory" = [ "org.kde.dolphin.desktop" ];
|
|
};
|
|
};
|
|
|
|
# Dolphin / KDE bookmarks ("Places" in the sidebar).
|
|
home.file.".local/share/user-places.xbel".text = placesXbel;
|
|
|
|
# Optional: keep GTK bookmarks too, for apps that still use them.
|
|
gtk.gtk3.bookmarks = [
|
|
"file:///home/${user}/Documents Documents"
|
|
"file:///home/${user}/Downloads Downloads"
|
|
"file:///home/${user}/repos Repositories"
|
|
];
|
|
|
|
# Basic KDE config so Dolphin behaves sanely outside Plasma.
|
|
xdg.configFile."kdeglobals".text = ''
|
|
[Icons]
|
|
Theme=WhiteSur
|
|
|
|
[KDE]
|
|
SingleClick=false
|
|
'';
|
|
|
|
# Dolphin settings.
|
|
xdg.configFile."dolphinrc".text = ''
|
|
[General]
|
|
BrowseThroughArchives=true
|
|
ShowFullPath=false
|
|
ShowSpaceInfo=true
|
|
ShowZoomSlider=true
|
|
|
|
[KFileDialog Settings]
|
|
Places Icons Auto-resize=false
|
|
Places Icons Static Size=22
|
|
|
|
[MainWindow]
|
|
MenuBar=Disabled
|
|
ToolBarsMovable=Disabled
|
|
|
|
[PreviewSettings]
|
|
Plugins=appimagethumbnail,audiothumbnail,blenderthumbnail,comicbookthumbnail,directorythumbnail,ebookthumbnail,exrthumbnail,fontthumbnail,gvsthumbnail,htmlthumbnail,imagethumbnail,jpegthumbnail,opendocumentthumbnail,postscriptthumbnail,rawthumbnail,svgthumbnail,windowsexethumbnail
|
|
|
|
[UiSettings]
|
|
ShowStatusBar=false
|
|
ShowZoomSlider=true
|
|
'';
|
|
|
|
# File dialog / view settings.
|
|
xdg.configFile."kiorc".text = ''
|
|
[Confirmations]
|
|
ConfirmDelete=true
|
|
ConfirmEmptyTrash=true
|
|
|
|
[Executable scripts]
|
|
behaviourOnLaunch=alwaysAsk
|
|
'';
|
|
|
|
# Optional: make Ark the preferred archive app in many cases.
|
|
xdg.desktopEntries.ark = {
|
|
name = "Ark";
|
|
exec = "ark %U";
|
|
terminal = false;
|
|
categories = [
|
|
"Qt"
|
|
"KDE"
|
|
"Utility"
|
|
"Archiving"
|
|
];
|
|
mimeType = [
|
|
"application/zip"
|
|
"application/x-tar"
|
|
"application/x-compressed-tar"
|
|
"application/x-bzip-compressed-tar"
|
|
"application/x-xz-compressed-tar"
|
|
"application/x-7z-compressed"
|
|
"application/x-rar"
|
|
];
|
|
};
|
|
services.udiskie = {
|
|
enable = true;
|
|
settings = {
|
|
program_options = {
|
|
file_manager = "${pkgs.kdePackages.dolphin}/bin/dolphin";
|
|
};
|
|
};
|
|
};
|
|
|
|
home.sessionVariables = {
|
|
XDG_ICON_DIR = "${pkgs.whitesur-icon-theme}/share/icons/WhiteSur";
|
|
};
|
|
}
|
|
)
|
|
];
|
|
}
|