Op maandag 06-09-2010 om 17:05 uur [tijdzone +0100], schreef Tony
Atkinson:
> 3) Link GUI & CLI operations using common syntax
> 
> I'm in two minds about including this,
> as this is not a usual use-case for the majority of people
> but I'd love for all GUI applications to be invokable via the CLI, using
> some standard syntax
> I've found that often times I'll use a GUI app to perform some set of
> operations, then I'm wanting to perform the same operations across
> multiple files, and currently I'm forced to find alternative apps of
> automating said operations
> 
> Eg. I've recently needed to perform the following operations on several
> hundred photos
> in order for them to blend in with a user-configurable webpage colour
> scheme
> (Making an image whose background gradually fades to transparent at the
> image boundaries)
> - Open image in the Gimp
> - add a transparent layer
> - Select all
> - Shrink selection by 5px
> - Feather selection by 5px
> - Invert selection
> - Clear selection (to transparent)
> - Save as a PNG

> Surely it should be possible to automate such GUI operations using a CLI
> interface
> and if you've got experience with a specific desktop app, I think it
> would be hugely beneficial if you could keep using the same program both
> on the GUI and on the CLI
> 
>         for IMG_FILE in $IMG_FILES; do
>                 gimp-cli
>         
> --process="layer-add:transparent;select-all;select-shrink:5px;select-feather:5px;select-invert;select-clear;file-save:${IMG_FILE}.png"
>  $IMG_FILE
>         done

Your proposal must have been read and implemented by somebody with a
time machine, as The GIMP's batch mode has been around for years.  ;-)


I think doing that in a general way with all GUI applications would mean
that you would have to add support for a common scripting engine to all
applications, somewhat like AppleScript on Mac OS, or ActiveX scripting
in Windows.  Some applications might need major changes to make that
possible, and in some cases it would significantly bloat them or
(partially) duplicate existing scripting functionality (that can't be
removed for backwards compatibility or because it has more/other
features).

The first thing to do if you want to see this happening would be to get
all desktop environments to agree on a common system for this (probably
through FreeDesktop.org).  Good luck with that...


-- 
Jan Claeys


-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss

Reply via email to