Sponsored Content
Full Discussion: Running a script from CDE...
Top Forums UNIX for Dummies Questions & Answers Running a script from CDE... Post 6470 by Perderabo on Wednesday 5th of September 2001 10:33:11 AM
Old 09-05-2001
dtksh was developed to solve problems like this. It is an advanced form of ksh with many add-ons that result in virtually the entire x api being available to the shell programmer. The scripts are really x clients in themselves that can run without using a xterm client for support.

But its power is also its shortcoming. The learning curve is very steep. Sample code:

Code:
widget=${Progs[ii]}
XtGetValues $widget x:x y:y 
XtDestroyWidget $widget
XtCreateManagedWidget BUTTON pushbutton XmPushbutton $BBOARD \
   background:$colorBackSave \
   foreground:$colorForeSave \
   highlightColor:$colorBackGround highlightThickness:0 \
   labelString:$asys2 \
   height:$Bheight width:$bwidth1 x:$x y:$y \
   fontList:"$lblfont" \
   shadowThickness:4
XtAddCallback $BUTTON activateCallback buttonpushed
XTAddCallback $BUTTON armCallback buttonArmed
RequestOp[$BUTTON]=$opsave
RequestArg[$BUTTON]=$asys
Progs[ii]=$BUTTON
ProgsA[$BUTTON]=$ii

That put a pushable button on the screen. But still, if you know x and ksh very well, you can get it done.

Besides dtksh, there are other interpreted lauguages out there with a graphical interface. But dtksh is the only one I have tried.

Another approach is to use html. Then you run a web server and web browser on the same box and let the operator fire up the browser. html is much easier than x.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Display program running on CDE via GNOME

Hi All, I have one AIX box (5.1 with CDE running) and one Linux box ( FC3 with GNOME on it). What I want to be able to do is : SSH from the Linux box into the AIX box and then open an X term to launch a X window application. I am not able to do that. My guess is that the window mangers and... (4 Replies)
Discussion started by: navinxavier
4 Replies

2. AIX

CDE running but not display on screen

Runing p550Q via HMC I'd like to start using graphic interface CDE: lslpp -l | grep X11.Dt* X11.Dt.ToolTalk -- AIX CDE ToolTalk Support X11.Dt.bitmaps -- AIX CDE Bitmaps X11.Dt.helpmin -- AIX CDE Minimum Help Files X11.Dt.helprun -- AIX CDE Runtime Help X11.Dt.lib -- AIX CDE... (0 Replies)
Discussion started by: silves
0 Replies

3. Solaris

Running from Shell Vs running from RC script

Hi, i have a script which need to do behave differently when run as a startup process from init.d/ rc2.d script and when run manually from shell. How do i distinguish whether my script is run by init process or by shell?? Will the command /proc/$$/psinfo | grep "myscript" work well???... (2 Replies)
Discussion started by: vickylife
2 Replies

4. Shell Programming and Scripting

Running a unix script(which is calling another script inside that) in background

Hi all, I am having a script ScriptA which is calling a script ScriptB in the same server and copying files to second server and have to execute one script ScriptC in the second server. THis First script ScriptA is the main script and i have to execute this process continously. for Keeping... (2 Replies)
Discussion started by: rohithji
2 Replies

5. Shell Programming and Scripting

script for reading logs of a script running on other UNIX server

Hi, I have a script, running on some outside firwall server and it's log of success or failure is maintained in a file. I want to write a script which ftp that server and reads that file and checks the logs and if failure , I will send mail notification. Please let meknow if I am not... (1 Reply)
Discussion started by: vandana.parwani
1 Replies

6. UNIX Desktop Questions & Answers

How to migrate Solaris 10 CDE config to HP-UX CDE.

Hello, Do you guys by any chance know what is the best (if any ) way to move CDE configuration from a SOLARIS 10 machine to HP-UX? Just the config (actions, text files etc). Thanks in advance! (0 Replies)
Discussion started by: binary0x01
0 Replies

7. Solaris

Connect to SunOS CDE from another CDE

I have two CDE desktop accounts on different server (called this CDE#1, CDE#2) on the same network. However, my current setup is connecting to the Solaris CDE#1,CDE#2 via Citrix. My plan is to connect to CD#1 and then somehow connect to CDE#2. How do I do this? I am just a regular user... (0 Replies)
Discussion started by: tthach830
0 Replies

8. Shell Programming and Scripting

Shell Script for continuously checking status of a another script running in background, and immedia

Hi, I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help.. i am using below command to run script nohup system_traps.sh & but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies

9. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

10. Shell Programming and Scripting

Why script is running sometimes and not running sometimes?

Hi, I have a script which does couple of database connection and run some SELECT queries to get some output in the file. I am surprised to see :eek: that when i run my script some times it gives the desired out put and sometimes it shows some error :confused: . Suppose if i execute it say... (3 Replies)
Discussion started by: Sharma331
3 Replies
IRXEVENT(1)							   User Commands						       IRXEVENT(1)

NAME
irxevent - infrared X-event sender SYNOPSIS
irxevent [option]... [config file] DESCRIPTION
Irxevent is a program that I wrote to send button clicks and key presses to X applications triggered by a LIRC driven remote control. You can control your favorite CD/MP3 player or your TV tuner program or any other X application that responds to keyboard or mouse input. If you like to you can send emacs ^X^S from your armchair. Irxevent is a complement to irexec and irpty. -d --daemon fork and run in background -h --help display usage summary -V --version display version FILES
Irxevent works with the same config file as irexec and irpty (~/.lircrc). For a complete sample .lircrc look at examples/lircrc. Part of your .lircrc could look like this: begin prog = irxevent button = VIDEO_UP config = Key SHIFT-KP_Add CurrentWindow end begin prog = irxevent button = VIDEO_DOWN config = Key SHIFT-KP_Subtract CurrentWindow end begin prog = irxevent button = STOP config = Key ctrl-c CurrentWindow end begin prog = irxevent button = 0 config = Key f xawtv config = Key f xawtv end begin prog = irxevent button = POWER config = Key q xawtv end begin prog = irxevent button = CH_DOWN config = Button 1 329 92 kscd end begin prog = irxevent button = UP config = Button 1 110 80 GQmpeg end begin prog = irxevent button = DOWN config = Button 1 130 80 GQmpeg end Simply said config = lines may look like this: config = Key [shift-][ctrl-][alt-]<key> [Focus] <windowname> | WindowID <id> | CurrentWindow | RootWindow config = Button <button> <x> <y> [Focus] <windowname> | WindowID <id> | CurrentWindow | RootWindow config = xy_Key <x> <y> [shift-][ctrl-][alt-]<key> [Focus] <windowname> | WindowID id | CurrentWindow | RootWindow some more examples: config = Key Up xawtv config = Key Down xawtv config = Button 1 50 110 xclickme config = Key q xawtv config = Key ctrl-c mpg123 config = Key shift-Page_Up rxvt In BNF this looks like: LINE = "config =" <KEY|BUTTON|XYKEY> <TARGET> | "config =" <KEY|BUTTON|XYKEY> "Focus" <TARGET> XYKEY = "xy_Key" <x_position> <y_position> <MOD><KEYSPEC> KEY = "Key" <MOD><KEYSPEC> MOD = ["shift-"]["numlock-"]["ctrl-"]["alt-"]["meta-"] ["numlock-"]["mod3-"]["mod4-"]["mod5-"]["altgr-"]["scrlock-"] KEYSPEC = Keyname | "KeySym:"KeySym | "KeyCode:"KeyCode BUTTON = "Button" <1..5> <x_position> <y_position> TARGET = Windowname | "WindowID" id | "CurrentWindow" | "RootWindow" Keyname: is the key symbol that is declared in X windows. E.g. "Up" refers to the cursor arrow pointing up. "KP_Add" is the plus sign on the key pad. Just take a look at irxevent.keys (in the documentation directory) if you are not sure about a symbol's name. KeySym: number as returned by XStringToKeysym(3x). KeyCode: number as returned by XKeysymToKeycode(3x). Windowname: can be the first characters of the window name displayed by the window manager or the name that is displayed below the icon. Some pro- grams use the name displayed by the window manager to show a lot of status information but don't change the icon name (like xawtv). Others append information to the window name ("GQmpeg - kill_windooz.mp3"). If neither window name nor icon name match the given Win- downame information from XClassHint(3x) will be checked. CurrentWindow: refers to the active window as returned by XGetInputFocus(3x). Most times this is the window with your mouse pointer in it. RootWindow: refers to the root window as returned by RootWindow(3x). You may need this to send events to the window manager. WindowID id: refers to the window with window identifier id. id should be a decimal number. It is useful when irxevent can't find the desired win- dow by other means. Focus: will send the specified event to the given window only if it currently has the input focus. This of course does not make much sense when combined with CurrentWindow. TROUBLESHOOTING
If you have problems finding the coordinates for a button click you can try xev -id <window_id>. The window_id can be found using xwininfo. If xev and xwininfo are not part of your distribution you can find them at a FTP server using the search engine at: http://ftpsearch.ntnu.no/ . xev also reports the names of key symbols like "Control_L" (your left control key) or "KP_Subtract" (the 'minus' key on your keypad). There are programs that do not accept any synthetic X-events by default because they can cause security problems. Currently xterm and xemacs are known to ignore events simulated by irxevent. You can however make xterm accept external events by enabling "Allow SendEvents" in the "Main Options" (hold down the Ctrl button and press the left mouse button inside the xterm window). You can as well place this line into your .Xresources file to change this permanently: XTerm.vt100.allowSendEvents: true Yet another possibility is to start xterm like this: xterm -xrm "XTerm.vt100.allowSendEvents: true" xemacs will accept events if you set a built-in variable. The following was taken from the online help: `x-allow-sendevents' is a built-in boolean variable. Value: t Documentation: *Non-nil means to allow synthetic events. Nil means they are ignored. Beware: allowing emacs to process SendEvents opens a big security hole. In order to allow events you have to evaluate this lisp code (press Meta-x and enter the following expression): (setq x-allow-sendevents t) Placing this line into your .xemacs-options file should have the same result. If you have problems sending events please drop me an email. AUTHOR
Written by Heinrich Langos <heinrich@mad.scientist.com>. SEE ALSO
The documentation for lirc is maintained as html pages. They are located under html/ in the documentation directory. irxevent 0.9.0-pre1 October 2010 IRXEVENT(1)
All times are GMT -4. The time now is 03:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy