Monday, March 30, 2009

BASH Scripting - Take input from file as STDIN

# Save the STDIN file descriptor
0>&3

# Redirect file as STDIN
0< filename

# Do stuff
...

# Close the file descriptor
exec 0>&-

# Assign STDIN back to 0
3>&0

Tuesday, March 24, 2009

Setting the "Busy" mouse Cursor

GdkCursor *cursor;

cursor = gdk_cursor_new( GDK_WATCH );
gdk_window_set_cursor( widget->window, cursor );