summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBasioMeusPuga2016-07-05 14:46:07 +0530
committerBasioMeusPuga2016-07-05 14:46:07 +0530
commit5e29db642eda2670611e761a361ebed2f0a9d6a0 (patch)
tree2234dee58d979fdc2e8dbe1bdc7f1ab8a5efcc7e
downloadaur-5e29db642eda2670611e761a361ebed2f0a9d6a0.tar.gz
Works with Dolphin KF5
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD21
-rw-r--r--new_folder_with_selection.desktop10
-rwxr-xr-xnew_folder_with_selection.sh21
4 files changed, 67 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5e0623263cc3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = kde-servicemenus-newfolderwithselection
+ pkgdesc = A KDE service menu for creating a new folder with selection (in Dolphin)
+ pkgver = 1.0
+ pkgrel = 1
+ url = https://aur.archlinux.org/packages/kde-servicemenus-newfolderwithselection
+ arch = any
+ license = GPL
+ depends = dolphin
+ source = new_folder_with_selection.desktop
+ source = new_folder_with_selection.sh
+ sha256sums = b5c13fd2a196e1b0976dc2485774fefb32f1e39b1b84dc72f7bd849649697eb1
+ sha256sums = 7ff641e263c93fa61809567861ab54de9091dc557d396d22ee0fa46988d7fe7e
+
+pkgname = kde-servicemenus-newfolderwithselection
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d997576240b3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,21 @@
+# Maintainer: BasioMeusPuga <disgruntled.mob@gmail.com>
+
+pkgname=kde-servicemenus-newfolderwithselection
+pkgver=1.0
+pkgrel=1
+pkgdesc="A KDE service menu for creating a new folder with selection (in Dolphin)"
+url="https://aur.archlinux.org/packages/${pkgname}"
+arch=('any')
+license=('GPL')
+depends=('dolphin')
+source=('new_folder_with_selection.desktop' 'new_folder_with_selection.sh')
+sha256sums=('b5c13fd2a196e1b0976dc2485774fefb32f1e39b1b84dc72f7bd849649697eb1'
+ '7ff641e263c93fa61809567861ab54de9091dc557d396d22ee0fa46988d7fe7e')
+
+package() {
+ mkdir -p ${pkgdir}/usr/share/kservices5/ServiceMenus/
+ mkdir -p ${pkgdir}/usr/share/new_folder_with_selection/
+
+ install -m 755 new_folder_with_selection.sh ${pkgdir}/usr/share/new_folder_with_selection/
+ install -m644 new_folder_with_selection.desktop ${pkgdir}/usr/share/kservices5/ServiceMenus/
+}
diff --git a/new_folder_with_selection.desktop b/new_folder_with_selection.desktop
new file mode 100644
index 000000000000..10467bf1324a
--- /dev/null
+++ b/new_folder_with_selection.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Service
+ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
+MimeType=Application/octet-stream;inode/directory
+Actions=NFFS
+
+[Desktop Action NFFS]
+Name=New Folder with Selection
+Icon=folder-download
+Exec=sh /usr/share/new_folder_with_selection/new_folder_with_selection.sh %U
diff --git a/new_folder_with_selection.sh b/new_folder_with_selection.sh
new file mode 100755
index 000000000000..9b392b702304
--- /dev/null
+++ b/new_folder_with_selection.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+SAVEIFS=$IFS
+IFS=$(echo -en "\n\b")
+
+foldname=`kdialog --inputbox "Folder to be created" "New Folder" --title "Create New Folder with Selection" --caption "Dolphin" --icon "dolphin"`
+
+if [ $? = 0 ]; then
+ dir=`dirname $1`
+ mkdir "$dir"/"$foldname"
+
+if [ $? = 1 ]; then
+ kdialog --error "Invalid Name"
+ else
+ for file in ${@} ; do
+ mv "$file" -t "$dir"/"$foldname"
+ done
+fi
+fi
+
+IFS=$SAVEIFS