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
[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'
Was this page helpful?