Including a Dolphin script to copy filenames

This commit is contained in:
Bruno F. Fontes 2019-10-13 11:23:07 -03:00
parent c118eebbf4
commit 0cb973041c
Signed by: brunofontes
GPG Key ID: EE3447CE80048495
4 changed files with 46 additions and 0 deletions

24
Dolphin/bf-copy.desktop Normal file
View File

@ -0,0 +1,24 @@
# Copyright 2019 Bruno Fontes <outros+dev@m.brunofontes.net>
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/octet-stream;inode/directory
Actions=copyNameOnly;copyPathOnly;copyPath;
X-KDE-Priority=TopLevel
X-KDE-Submenu=BFCopy
[Desktop Action copyNameOnly]
Name=Copy Filename
Name[pt_BR]=Copiar nome do arquivo
Exec=bash ~/.local/share/kservices5/ServiceMenus/copyName.sh %F
[Desktop Action copyPathOnly]
Name=Copy Path
Name[pt_BR]=Copiar caminho
Exec=bash ~/.local/share/kservices5/ServiceMenus/copyPath.sh %F
[Desktop Action copyPath]
Name=Copy Full Path
Name[pt_BR]=Copiar caminho completo
Exec=bash ~/.local/share/kservices5/ServiceMenus/copyFullPath.sh %F

7
Dolphin/copyFullPath.sh Normal file
View File

@ -0,0 +1,7 @@
#! /bin/bash
#printf "$@" | xsel -b -i
filelist=""
for line in "$@"; do
filelist="$filelist$line\n"
done
printf "$filelist" | xsel -b -i

7
Dolphin/copyName.sh Normal file
View File

@ -0,0 +1,7 @@
#! /bin/bash
filelist=""
for line in "$@"; do
filename=$(basename -- "$line")
filelist="$filelist$filename\n"
done
printf "$filelist" | xsel -b -i

8
Dolphin/copyPath.sh Normal file
View File

@ -0,0 +1,8 @@
#! /bin/bash
filelist=""
for line in "$@"; do
filename=$(basename -- "$line")
folder=${line%"$filename"}
filelist="$filelist$folder\n"
done
printf "$filelist" | xsel -b -i