create_apps_for_appvm.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. #
  3. # The Qubes OS Project, http://www.qubes-os.org
  4. #
  5. # Copyright (C) 2010 Joanna Rutkowska <joanna@invisiblethingslab.com>
  6. #
  7. # This program is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU General Public License
  9. # as published by the Free Software Foundation; either version 2
  10. # of the License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. #
  21. #
  22. SRCDIR=$1
  23. VMNAME=$2
  24. VMDIR=/var/lib/qubes/appvms/$VMNAME
  25. APPSDIR=$VMDIR/apps
  26. if [ $# != 2 ]; then
  27. echo "usage: $0 <apps_templates_dir> <vmname>"
  28. exit
  29. fi
  30. mkdir -p $APPSDIR
  31. echo "--> Converting Appmenu Templates..."
  32. find $SRCDIR -name "*.desktop" -exec /usr/lib/qubes/convert_apptemplate2vm.sh {} $APPSDIR $VMNAME $VMDIR \;
  33. /usr/lib/qubes/convert_dirtemplate2vm.sh $SRCDIR/qubes-vm.directory.template $APPSDIR/$VMNAME-vm.directory $VMNAME $VMDIR
  34. echo "--> Adding Apps to the Menu..."
  35. xdg-desktop-menu install $APPSDIR/*.directory $APPSDIR/*.desktop