add user-places
This commit is contained in:
parent
312342801f
commit
e3089d72d8
|
|
@ -1,4 +1,5 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
|
imports = [./user-places.nix];
|
||||||
xdg.configFile.arkrc.source = ./arkrc;
|
xdg.configFile.arkrc.source = ./arkrc;
|
||||||
xdg.configFile.kdeglobals.source = ./kdeglobals;
|
xdg.configFile.kdeglobals.source = ./kdeglobals;
|
||||||
xdg.configFile.kiorc.source = ./kiorc;
|
xdg.configFile.kiorc.source = ./kiorc;
|
||||||
|
|
|
||||||
84
user/config/kde/user-places.nix
Normal file
84
user/config/kde/user-places.nix
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
u.bookmarks = let
|
||||||
|
home = config.home.homeDirectory;
|
||||||
|
in
|
||||||
|
lib.mkDefault [
|
||||||
|
{
|
||||||
|
href = "file://${home}";
|
||||||
|
name = "Home";
|
||||||
|
icon = "user-home";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
href = "file://${home}/Desktop";
|
||||||
|
name = "Desktop";
|
||||||
|
icon = "user-desktop";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
href = "file://${home}/Downloads";
|
||||||
|
name = "Downloads";
|
||||||
|
icon = "folder-downloads";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
href = "file:///tmp";
|
||||||
|
name = "tmp";
|
||||||
|
icon = "folder-temp";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
href = "trash:/";
|
||||||
|
name = "Trash";
|
||||||
|
icon = "user-trash";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
href = "remote:/";
|
||||||
|
name = "Network";
|
||||||
|
icon = "folder-network";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
# dolphin complains if user-places.xbel is read-only
|
||||||
|
home.activation.user-places = let
|
||||||
|
path = "${config.xdg.dataHome}/user-places.xbel";
|
||||||
|
bookmarks =
|
||||||
|
lib.strings.concatMapStrings ({
|
||||||
|
href,
|
||||||
|
name,
|
||||||
|
icon,
|
||||||
|
}: ''
|
||||||
|
<bookmark href="${href}">
|
||||||
|
<title>${name}</title>
|
||||||
|
<info><metadata owner="http://freedesktop.org">
|
||||||
|
<bookmark:icon name="${icon}"/>
|
||||||
|
</metadata></info>
|
||||||
|
</bookmark>
|
||||||
|
'')
|
||||||
|
config.u.bookmarks;
|
||||||
|
file-content = ''
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE xbel>
|
||||||
|
<xbel>
|
||||||
|
<info>
|
||||||
|
<metadata>
|
||||||
|
<kde_places_version>4</kde_places_version>
|
||||||
|
<GroupState-Places-IsHidden>false</GroupState-Places-IsHidden>
|
||||||
|
<GroupState-Remote-IsHidden>false</GroupState-Remote-IsHidden>
|
||||||
|
<GroupState-Devices-IsHidden>false</GroupState-Devices-IsHidden>
|
||||||
|
<GroupState-RemovableDevices-IsHidden>false</GroupState-RemovableDevices-IsHidden>
|
||||||
|
<GroupState-Tags-IsHidden>false</GroupState-Tags-IsHidden>
|
||||||
|
<withBaloo>true</withBaloo>
|
||||||
|
<GroupState-SearchFor-IsHidden>false</GroupState-SearchFor-IsHidden>
|
||||||
|
<GroupState-RecentlySaved-IsHidden>false</GroupState-RecentlySaved-IsHidden>
|
||||||
|
</metadata>
|
||||||
|
</info>
|
||||||
|
${bookmarks}
|
||||||
|
</xbel>
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
[ ! -e "${path}" ] && cat > "${path}" <<EOF
|
||||||
|
${file-content}
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -11,5 +11,27 @@
|
||||||
default = "";
|
default = "";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
bookmarks = lib.mkOption {
|
||||||
|
type = lib.types.listOf (lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
href = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "link of the bookmark";
|
||||||
|
example = "file:///tmp";
|
||||||
|
};
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "name of the bookmark";
|
||||||
|
example = "tmp";
|
||||||
|
};
|
||||||
|
icon = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "icon name of the bookmark";
|
||||||
|
example = "folder-temp";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
description = "list of file manager bookmarks";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue