how to create an item in the context menu dolphin?

Hello everyone. Can anyone tell me how to add my own item to the "create" section of the Dolphin context menu? I want to add the ability to create a desktop file there, but I have no idea how to do it. I found some guide for KDE 6, where they suggest creating a directory ~/.local/share/kio/servicemenus, but it didn't work
Solution:
Oh, damn, I'm an idiot, I didn't look all this time. I was looking for a new item in the "create" section, and it's right there in the context menu. Nevertheless, here's the contents of the script that creates a desktop file with the name you choose ```BASH [Desktop Entry]...
Jump to solution
6 Replies
asen23
asen233w ago
works fine for me, make sure the format is correct
Грюндик
ГрюндикOP3w ago
format of what? I did it directly with commands from the guide. Nothing appeared in the context menu. Even after rebooting the PC
asen23
asen233w ago
format of the desktop file, like syntax and such
asen23
asen233w ago
GitHub
bazzite/system_files/desktop/kinoite/usr/share/templates/vkBasalt.d...
Bazzite is a custom Fedora Atomic image built with cloud native technology that brings the best of Linux gaming to all of your devices - including your favorite handheld. - ublue-os/bazzite
Solution
Грюндик
Oh, damn, I'm an idiot, I didn't look all this time. I was looking for a new item in the "create" section, and it's right there in the context menu. Nevertheless, here's the contents of the script that creates a desktop file with the name you choose
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;
Actions=CreateDesktopFile;
X-KDE-Priority=TopLevel
[Desktop Action CreateDesktopFile]
Name=Создать desktop file
Icon=document-new
Exec=bash -c 'filename=$(kdialog --title "Создание desktop файла" --inputbox "Введите имя файла (без расширения):"); if [ -n "$filename" ]; then echo -e "[Desktop Entry]\nType=Application\nName=\nGenericName=\nIcon=\nExec=\nTerminal=false\nCategories=;\nKeywords=" > "%f/$filename.desktop" && kate "%f/$filename.desktop"; fi'
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;
Actions=CreateDesktopFile;
X-KDE-Priority=TopLevel
[Desktop Action CreateDesktopFile]
Name=Создать desktop file
Icon=document-new
Exec=bash -c 'filename=$(kdialog --title "Создание desktop файла" --inputbox "Введите имя файла (без расширения):"); if [ -n "$filename" ]; then echo -e "[Desktop Entry]\nType=Application\nName=\nGenericName=\nIcon=\nExec=\nTerminal=false\nCategories=;\nKeywords=" > "%f/$filename.desktop" && kate "%f/$filename.desktop"; fi'

Did you find this page helpful?