Browse Source

Add virtualbox resizing script for KDE5

master
Fincer 7 years ago
parent
commit
22d6a81569
4 changed files with 54 additions and 0 deletions
  1. +9
    -0
      Readme.md
  2. +17
    -0
      kde-servicemenus-virtualbox/PKGBUILD
  3. +15
    -0
      kde-servicemenus-virtualbox/virtualbox-resize.desktop
  4. +13
    -0
      kde-servicemenus-virtualbox/virtualbox-resize.sh

+ 9
- 0
Readme.md View File

@ -132,6 +132,15 @@ Plasma 5 Dolphin service menu script for hacking and breaking PDF password prote
FORMAT: Arch Linux PKGBUILD script.
**kde-servicemenus-virtualbox**
--------------
Plasma 5 Dolphin service menu script for resizing VirtualBox VDI files (virtual machines) via right clicking.
Input value: size in gigabyte (only a number, nothing else)
FORMAT: Arch Linux PKGBUILD script + source files.
**kde-thumbnailer-ooxml-kf5**
--------------


+ 17
- 0
kde-servicemenus-virtualbox/PKGBUILD View File

@ -0,0 +1,17 @@
pkgname=kde-servicemenus-virtualbox
pkgver=1
pkgrel=1
pkgdesc="A KDE service menus for resizing virtualbox VDI files (KDE5 Dolphin action)"
arch=('any')
license=('GPL')
depends=('virtualbox' 'dolphin' 'kdialog')
source=('virtualbox-resize.sh'
'virtualbox-resize.desktop')
md5sums=('0b939f4459b6cf0d0b69523bf2fe7c06'
'aa354e3083eaab1eddff76fd97c6c88b')
package() {
mkdir -p $pkgdir/usr/share/kservices5/ServiceMenus/
cp $srcdir/{virtualbox-resize.desktop,virtualbox-resize.sh} $pkgdir/usr/share/kservices5/ServiceMenus/
chmod 755 $pkgdir/usr/share/kservices5/ServiceMenus/{virtualbox-resize.desktop,virtualbox-resize.sh}
}

+ 15
- 0
kde-servicemenus-virtualbox/virtualbox-resize.desktop View File

@ -0,0 +1,15 @@
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
Icon=virtualbox-vdi
MimeType=application/x-virtualbox-vdi
Actions=virtualbox-resize
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel
TryExec=VBoxManage
[Desktop Action virtualbox-resize]
Name=Resize VirtualBox Machine
Icon=virtualbox-vdi
Exec=/usr/share/kservices5/ServiceMenus/virtualbox-resize.sh

+ 13
- 0
kde-servicemenus-virtualbox/virtualbox-resize.sh View File

@ -0,0 +1,13 @@
#!/bin/bash
NEWSIZE=$(( 1024* $(kdialog --inputbox "Please enter new size in gigabytes (GB)")));
while [ $# -gt 0 ]; do
VBOXMACHINE=$1
VBoxManage modifyhd "$VBOXMACHINE" --resize $NEWSIZE
shift
done
if [[ "$NEWSIZE" == ?(-)+([0-9]) ]]; then
kdialog --msgbox "Done. Use a live-cd to extend the partition." --title "Resize VirtualBox Machine"
fi

Loading…
Cancel
Save