Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 24 2018 19:41

    TheJaredWilcurt on master

    Update ugui.js (compare)

  • Jun 15 2018 02:26
    TheJaredWilcurt commented #10
  • Jun 14 2018 22:06
    AlonsoEnrique opened #10
  • Jan 05 2018 18:15

    TheJaredWilcurt on master

    fix missing l in html fix, get… Merge pull request #9 from Basi… (compare)

  • Jan 05 2018 18:15
    TheJaredWilcurt closed #9
  • Jan 05 2018 18:15
    TheJaredWilcurt commented #9
  • Jan 02 2018 23:05
    Basilmir opened #9
  • Dec 30 2017 23:02
    GAMHer commented #8
  • Dec 29 2017 16:35
    TheJaredWilcurt commented #8
  • Dec 29 2017 15:28
    GAMHer edited #8
  • Dec 29 2017 15:27
    GAMHer opened #8
  • Nov 15 2017 00:22
    Aspvik commented #7
  • Nov 13 2017 02:47
    Aspvik commented #7
  • Nov 13 2017 01:10
    Aspvik commented #7
  • Nov 13 2017 01:04
    Aspvik commented #7
  • Nov 13 2017 01:02
    Aspvik commented #7
  • Nov 13 2017 01:02
    Aspvik commented #7
  • Nov 12 2017 20:18
    Aspvik commented #7
  • Nov 12 2017 17:13
    TheJaredWilcurt commented #7
  • Nov 10 2017 23:32
    Aspvik commented #7
The Jared Wilcurt
@TheJaredWilcurt
VoidVolker
@VoidVolker
cool project ) will stay in stream )
The Jared Wilcurt
@TheJaredWilcurt
Awesome! :D
The Jared Wilcurt
@TheJaredWilcurt
Leonardo
@LeoFCardoso
cool project. Sorry not to read all docs yet. Is multiple file input (drag and drop) available to use?
looking for develop a gui for my cli project pdf2pdfocr
The Jared Wilcurt
@TheJaredWilcurt
hey, unfortunately no, I've been building too many other things to have time to come back and update UGUI to add that feature. I have however started implementing it in other projects built on top of UGUI in different ways.
this is probably the simplest implementation: https://github.com/TheJaredWilcurt/svgo-gui
Defluff is something a little closer to what I'd like to do, but it's a little buggy
I think once I get it polished I'll base the next UGUI update off of it, as it's a pretty common thing I end up needing
The Jared Wilcurt
@TheJaredWilcurt
@LeoFCardoso
Leonardo
@LeoFCardoso
Great. Thanks!
Liam Ormiston
@LiamOrmiston
I've been using UGUI for a project recently and I've had trouble trying to use the same executable on a multiform page. For instance, if I wanted to create my own github gui, I can only use <cmd executable="git"> for one form/submit button. Say I wanted separate buttons for git fetch and get push commands. There seems to be no easy explanation in the documentation on how to accomplish this since form id has to equal the cmd executable. Any help with this?
The Jared Wilcurt
@TheJaredWilcurt
@LiamOrmiston
For simple CLI's the HTML part of UGUI works great. But as you start to deal with complex CLI's (and git is probably one of the most complex ever made), you need to venture out from the HTML part of UGUI, and use the JavaScript part
there is a file called app.js in your project folder, where you can run your App specific javascript
does that example make sense?
The Jared Wilcurt
@TheJaredWilcurt
the part where the command is that gets ran, 'C:\pngquant.exe --force "C:\file.png"', can use string manipulation and the ugui.args feature
$('#submit').click(function () {
    // Update the UGUI args object before accessing it
    ugui.helpers.buildUGUIArgObject();

    var forced = '';
    if (ugui.args.forced.htmlticked) {
        forced = '--force'
    }
    var file = ugui.args.inputfile.fullpath;

    // 'C:\pngquant.exe --force "C:\path\to\file.png"'
    ugui.helpers.runcmd('C:\pngquant.exe ' + forced + ' "' + file + '"');
});
Soroush Hajizadeh
@roushrsh_gitlab

Hi Jared,

I've been trying to use your UGUI to make a GUI that runs in linux. I spent the weekend making the actual UI and set up all the buttons and tools, now I just need it to run my scripts or code in the console when clicked. I noticed in your videos you only show for windows, and I haven't been able to get it to work for linux.

So similar to what you should in your video of git -m commit which takes parts of an argument
A function which takes an input file, the location of installation, and an output folder directory, it will run the program they've chosen.

Example : They will give the location for an app named pictureMaker. The picture they want made. Their desktop as output. This will run in a terminal for them.

./Desktop/BobsFolder/pictureMaker -i /Desktop/Pictures/Dog -o /Desktop/

Or even something simple like "install python"
I want it to attempt to run
"sudo apt install python2.7 python-pip"

Any idea how I can on linux?

I had something like this written:

<cmd executable="print">
<arg> "hi" </arg>
<arg>sudo apt update</arg>
<arg>sudo apt install python2.7 python-pip</arg>
</cmd>

But obviously that won't work in linux. Any ideas?

Thanks,

Roush

Soroush Hajizadeh
@roushrsh_gitlab

Basically @TheJaredWilcurt , what is the

<cmd executable="X">

equivalent for linux based systems?
Cheers!

Soroush Hajizadeh
@roushrsh_gitlab

Hey, I deleted the old one, but I found a minor solution for those who wind up here later. This can be run as a js to open a new terminal to run code in. For example running python use:

<script>
function pythonInstaller(){
var sys = require('sys')
var exec = require('child_process').exec;
var child;
// executes pwd
sys.print("Installing Python");
child = exec("gnome-terminal -e 'sudo apt-get install python'", function (error, stdout, stderr) {
sys.print(stdout);
sys.print(stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
}
</script>

The Jared Wilcurt
@TheJaredWilcurt

@roushrsh_gitlab you would not be able to use sudo as it would prompt for a user password. You could write some custom javascript to handle this password request and pass it along, however that would add a lot more complexity. Also most linux user's prefer to avoid using sudo unless it is needed. The <cmd executable="x"> is for the name of the executable, like apt. and then the <arg>'s are the arguments passed in.
So apt update would translate to

<cmd executable="apt">
  <arg>update</arg>
</cmd>

The power of UGUI comes from when you need to pass in variable content.

<cmd executable="apt-get">
  <arg>install ((appName))</arg>
</cmd>

if you want to run your own child processes, you can do that as well, though you may not need UGUI at that point. UGUI is built on top of NW.js and is meant to allow the creation of UI's for simple command line executables, particularly for those with limited javascript experience.