Recent

Author Topic: Interface for a terminal application  (Read 4289 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Interface for a terminal application
« on: May 08, 2010, 02:16:08 pm »
Hi,

I am a novice user of Linux (Ubuntu). How can I write UI for console application using Lazarus?
Example: Program "shred" od "wipe" which delete files permanently. How can I run this programs with parameters and read states, progress etc?

Regards

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927

xircon

  • New Member
  • *
  • Posts: 25
Re: Interface for a terminal application
« Reply #2 on: May 08, 2010, 04:49:39 pm »
I had some fun with this, I run Mandriva Cooker KDE4, just replace konsole with gnome-terminal:

Code: [Select]
procedure TForm1.Button7Click(Sender: TObject);
var S: longint;
begin
   S := fpsystem ('/usr/lib/kde4/libexec/kdesu '+'"konsole -e /home/steve/repos"');
end;                                          

Runs a script in my home folder in a root console.  This took me hours to work out!!!!

Another example (Mandriva uses su not sudo so YMMV) runs Nautilus as root:
Code: [Select]
procedure TForm1.Button8Click(Sender: TObject);
var S: longint;
begin
  S := fpsystem ('/usr/lib/kde4/libexec/kdesu nautilus');
end;        

I am slowly writing a gui based program of helpful utilites for my own use.

HTH

Steve

« Last Edit: May 08, 2010, 04:54:12 pm by xircon »

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Interface for a terminal application
« Reply #3 on: May 08, 2010, 05:35:10 pm »
Thanks everyone! Don't close topic because I still can have some problems with this ;)

 

TinyPortal © 2005-2018