#! /opt/QtPalmtop/bin/ruby =begin = myqcop by Saki Sakira version 0.1 from 2003 February 18 last revised at 2003 February 18 =end require 'open3' QCOP = '/home/QtPalmtop/bin/qcop' cmd = QCOP + ' "' + ARGV.join('" "') + '"' ENV['LOGNAME'] = `/usr/bin/whoami`.chomp if (ENV['QWS_DISPLAY'] == nil) then ENV['QWS_DISPLAY'] = 'Transformed:Rot270:Vga:0' end qcop_result = '' Open3.popen3(cmd) do |fin, fout, ferr| qcop_result = ferr.read end if (/server disp spec (\S+)/ =~ qcop_result) then ENV['QWS_DISPLAY'] = $1 system(cmd) else $stderr.print qcop_result end