Browse Source

Add KDE 5 Dolphin search actions plugin

master
Fincer 7 years ago
parent
commit
033e742247
5 changed files with 73 additions and 0 deletions
  1. +7
    -0
      Readme.md
  2. +27
    -0
      kde-servicemenus-searchactions/PKGBUILD
  3. +10
    -0
      kde-servicemenus-searchactions/searchinside-casesensitive.sh
  4. +19
    -0
      kde-servicemenus-searchactions/searchinside.desktop
  5. +10
    -0
      kde-servicemenus-searchactions/searchinside.sh

+ 7
- 0
Readme.md View File

@ -109,6 +109,13 @@ This script can be used for multiple files at the same time but is developed for
FORMAT: Arch Linux PKGBUILD script.
**kde-servicemenus-searchactions**
--------------
Plasma 5 Dolphin service menu script for searching strings inside files.
FORMAT: Arch Linux PKGBUILD script + source files.
**kde-servicemenus-unlockpdf**
--------------


+ 27
- 0
kde-servicemenus-searchactions/PKGBUILD View File

@ -0,0 +1,27 @@
pkgname=kde-servicemenus-searchactions
pkgver=1
pkgrel=1
pkgdesc="Search strings inside files using Dolphin or Konqueror (KDE5 Dolphin action)"
url=""
arch=('any')
license=('BSD')
install=''
source=(
searchinside.desktop
searchinside.sh
searchinside-casesensitive.sh
)
depends=('kdialog' 'grep' 'findutils' 'dolphin' 'konsole')
optdepends=()
conflicts=()
#provides=''
makedepends=()
package() {
mkdir -p $pkgdir/usr/share/kservices5/ServiceMenus/
cp $srcdir/{searchinside.desktop,searchinside.sh,searchinside-casesensitive.sh} $pkgdir/usr/share/kservices5/ServiceMenus/
chmod 755 $pkgdir/usr/share/kservices5/ServiceMenus/{searchinside.desktop,searchinside.sh,searchinside-casesensitive.sh}
}
md5sums=('97e0476998ae35c034316e07623463b1'
'5466d8b1b6334ea5a7ce9b5e586545af'
'e78a0246503d95489730ec71bb998a97')

+ 10
- 0
kde-servicemenus-searchactions/searchinside-casesensitive.sh View File

@ -0,0 +1,10 @@
#!/bin/bash
THISFOLDER=$(pwd)
echo -e "\e[1mSearch inside files -- [case sensitive]\e[0m"
echo -e "\nCurrent search folder: $THISFOLDER\n"
read -r -p "Enter string to search: " STRING
echo -e "\nFiles containing the string \e[93m$STRING\e[0m in \e[94m$THISFOLDER/\e[0m and subfolders are:\n\e[32m"
grep -Rls $STRING $THISFOLDER
echo -e "\e[91m\nSearch finished\e[0m"

+ 19
- 0
kde-servicemenus-searchactions/searchinside.desktop View File

@ -0,0 +1,19 @@
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory
Icon=system-search
Actions=searchinside;searchinside-casesensitive;
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel
TryExec=grep
[Desktop Action searchinside-casesensitive]
Name=Search inside files (case sensitive)
Icon=system-search
Exec=konsole --workdir $(pwd) -p "tabtitle=Search [case sensitive]" -e /usr/share/kservices5/ServiceMenus/searchinside-casesensitive.sh
[Desktop Action searchinside]
Name=Search inside files (ignore case)
Icon=system-search
Exec=konsole --workdir $(pwd) -p "tabtitle=Search [ignore case]" -e /usr/share/kservices5/ServiceMenus/searchinside.sh

+ 10
- 0
kde-servicemenus-searchactions/searchinside.sh View File

@ -0,0 +1,10 @@
#!/bin/bash
THISFOLDER=$(pwd)
echo -e "\e[1mSearch inside files -- [ignore case]\e[0m"
echo -e "\nCurrent search folder: $THISFOLDER\n"
read -r -p "Enter string to search: " STRING
echo -e "\nFiles containing the string \e[93m$STRING\e[0m in \e[94m$THISFOLDER/\e[0m and subfolders are:\n\e[32m"
grep -Rils $STRING $THISFOLDER
echo -e "\e[91m\nSearch finished\e[0m"

Loading…
Cancel
Save