File Dialog Box

I’m writing some scripts that do most everything from the command-line.
Only thing GUI that would really help is a File Dialog box for selecting
file locations. What module would give me the fastest access to one?
(I.e., shortest learning time.)

Two things that can be taken for granted:

  • Script will be run on Linux system
  • Script will be run under Gnome desktop environment

I’m writing some scripts that do most everything from the command-line.
Only thing GUI that would really help is a File Dialog box for selecting
file locations. What module would give me the fastest access to one?
(I.e., shortest learning time.)

Two things that can be taken for granted:

  • Script will be run on Linux system
  • Script will be run under Gnome desktop environment

Zenity should do the job for you. In IRB try:

file = zenity --file-selection #=> ‘/home/yeban/foo’

Also, see man zenity for more widgets.

On Sat, Jan 8, 2011 at 12:58 PM, Anurag P.
[email protected] wrote:

Zenity should do the job for you. In IRB try:

file = zenity --file-selection #=> ‘/home/yeban/foo’

Also, see man zenity for more widgets.

In case you don’t have zenity but tk:
wish <(echo 'puts [tk_getOpenFile]; exit')

Also see Tk Reference Manual: tk_getOpenFile