8

I want to convert some bash scripts into GUI apps using the Ubuntu SDK to create an HTML5 app.

Is this possible?

Are there any tutorials besides the 'Meanings' one that demonstrate this?

Seth
  • 57,282
  • 43
  • 144
  • 200
dibs
  • 3,479
  • 8
  • 27
  • 38
  • @hwez Can you create PHP based apps via the Ubuntu SDK? I want it to be something I can offer to the Ubuntu Software Center once completed. – dibs Jul 06 '14 at 00:35
  • 1
    Tell me exactly what are you wanting to do – hwez Jul 06 '14 at 00:37
  • What I'm telling you is that u can do a command to the server via php it's not going to do it on the page loader – hwez Jul 06 '14 at 00:40
  • @hwez I want to convert bash scripts that I have written to GUI based installable applications via the Ubuntu SDK, I would like to use an HTML5 project if possible but only because I normally develop for web. – dibs Jul 06 '14 at 00:42
  • 7
    No, Ubuntu development *is not* off-topic @krowe. This question is just fine. – Seth Jul 06 '14 at 00:44
  • this answer is everything i can do you can make it by Java with html5 but i'm not a Java programmer i saw this with node.js i think – hwez Jul 06 '14 at 01:17
  • 1
    I suspect this isn't possible solely with HTML5 apps. However, you could make a thin QML wrapper that loads a WebView with your HTML app. The QML could also call (via a C++) plugin, your shell script. But this is rather involved for a simple app :). Another thing to consider is that the AppArmor permission restrictions will likely prevent you from running any useful shell scripts in an app submitted to the App Store. (Though this isn't an issue if you're just writing something for yourself.) – Robert Schroll Jul 14 '14 at 15:24

2 Answers2

1

What is the web server serving the apps? You can always put shell scripts in the /cgi-bin/ folder and invoke the URL.

kos
  • 35,535
  • 13
  • 101
  • 151
-1

sorry i'm so late but that's it
this is how to make an os command on php

<?php 
shell_exec("os command"); ?>

<?php 
// lets try to download file

shell_exec("wget filename.zip"); ?>

//Usage : let's make a youtube downloader for

name this index.htm
<html>
<head>
<title>youtube Downloader</title>
</head>
<body>
<form name="form1" action="downloader.php" method="POST">
<div align="center">
<br><br>
<input type="text" name="youtube-id" size="25" value="Enter youtube video id ">
<br><input type="submit" value="download this video as mp4"><br>
</div>
</form>
</body>
</html>

<?php
/** 'Askubuntu' 
name this downloader.php 
be sure that shell_exec is enabled & you have installed the youtube-dl
installation
$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update
$ sudo apt-get install youtube-dl
youtube-dl -o $videoid $videoid = youtube-dl download -o filename , the video link or video-id*/
$videoid = $_POST['expmonth']; 
shell_exec("youtube-dl -o $videoid $videoid");
 print '<a href="' . $videoid . '">Download</a>';
 ?>

you can make it check if the file exist print with if i just wanted to make a fast answer
enter image description here

hwez
  • 2,956
  • 1
  • 17
  • 15