This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to create Shortcut to Move file(s) to specific folder

Tags: None
(comma "," separated)
jtibrewala
Registered Member
Posts
6
Karma
0
Hello all, I have an archive folder somewhere on my system where I commonly move old files to. In Dolphin, how can I create a shortcut so that selected file/files/folders can be moved to that specific folder without me having to cut, navigate and paste to that folder every time?
User avatar
Rog131
Registered Member
Posts
828
Karma
10
jtibrewala wrote:Hello all, I have an archive folder somewhere on my system where I commonly move old files to. In Dolphin, how can I create a shortcut so that selected file/files/folders can be moved to that specific folder without me having to cut, navigate and paste to that folder every time?


HI !

1) Dolphin places menu

You could add the folder to the Dolphin places menu: Dolphin Handbook: https://docs.kde.org/stable5/en/applica ... index.html -> Places menu: https://docs.kde.org/stable5/en/applica ... aces-panel

and then drag&drop:

Image


2) KDE Service/Context menus

Older document: https://techbase.kde.org/Development/Tu ... vice_Menus


At here with the:

KDE Frameworks: 5.30.0
Desktop: KDE Plasma 5.8.5
Dolphin: 16.12.1


The KDE service menus are at:
Code: Select all
$ kf5-config --path services

=>
~/.local/share/kservices5/ServiceMenus/
and
/usr/share/kservices5/ServiceMenus/

Making a file: ~/.local/share/kservices5/ServiceMenus/moveto.desktop
Code: Select all
[Desktop Entry]
Type=Service
Icon=transform-move
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/allfiles;
Actions=moveTo;
X-KDE-Priority=TopLevel
#X-KDE-Submenu=
Encoding=UTF-8

[Desktop Action moveTo]
Name=Move To MyContainer
Icon=transform-move
Exec=echo "%U" | sed 's# /#\\n/#g' | while read url; do kdemv5 "$url" /media/sda1/MyContainer/; done


Note #1
If some part of the path '~/.local/share/kservices5/ServiceMenus/' is missing you could add the missing parts.

Note #2
The files are moved to the /media/sda1/MyContainer/.
Change the correct path if you are using this.

Note #3
This adds a top level action, 'X-KDE-Priority=TopLevel'.
If you want to use sub menus use the 'X-KDE-Submenu='


There is a new context menu:
Image

The kdemv5 is:
Code: Select all
$ kdemv5 --help
Usage: kdemv5 [options] urls... url
Command-line tool for network-transparent operations

Options:
  -v, --version              Displays version information.
  -h, --help                 Displays this help.
  --noninteractive           Non-interactive use: no message boxes. If you
                             don't want a graphical connection, use --platform
                             offscreen
  --overwrite                Overwrite destination if it exists (for copy and
                             move)
  --author                   Show author information.
  --license                  Show license information.
  --desktopfile <file name>  The base file name of the desktop entry for this
                             application.

Arguments:
  src                        Source URL or URLs
  dest                       Destination URL



The kdemv5 is part of the kde-cli-tools:
Tools based on KDE Frameworks 5 to better interact with the system.

Released as part of the plasma desktop.

If the file exists:
Image

More

Documentation on creating and publishing Service Menu: viewtopic.php?f=225&t=136966
Desktop Entry Specification: https://standards.freedesktop.org/deskt ... ec/latest/


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], ourcraft