Solaris dtwmrc help


 
Thread Tools Search this Thread
Operating Systems Solaris Solaris dtwmrc help
# 1  
Old 06-05-2014
Solaris dtwmrc help

Hi everyone... At work, on our Solaris OS, we have a custom sys.dtwmrc file that controls a custom right-click menu that launches a Java program. I need to edit the dtwmrc file to launch the Java program only if the program is not already running. If the program is already running, I need the program to simply be brought to the front (in front of all open windows).

I am not sure how to do this. After looking all over the internet, and finding basically nothing helpful, I decided to see if anyone here knows how to do this.

I noticed that the dtwmrc file launched programs like "f.exec" and "f.terminal". I need a simple "if statement" to check to see if the Java program is already running. Thing is, I don't know if "if statements" are supported in the dtwmrc file.

Is it possible to write custom functions for the "f." functions in the dtwmrc file? Are the "f.exec" functions compiled C programs, and where are they located on the Solaris OS? Any help would be appreciated, because I really don't know how to solve this problem.
# 2  
Old 06-05-2014
There were no conditional statements I'm aware of with dtwm.

A simple workaround would be to replace the program you f.exec by a script that checks if the process is already running then only launch it if not the case.
# 3  
Old 06-05-2014
Quote:
Originally Posted by jlliagre
There were no conditional statements I'm aware of with dtwm.

A simple workaround would be to replace the program you f.exec by a script that checks if the process is already running then only launch it if not the case.
I appreciate the response, but this won't work. Granted, it does solve the problem of checking to see if the program is running, but it will not bring the program to the front if it is already running. That is the problem I'm having. I need to bring the program in front of every active window. The only way I know of to do this is using something like "f.raise" in the dtwm, but I can't "interface" with the dtwm in Java code or a shell script.

For example, in shell script pseudo-code, I could put in something like:
"if [ program is not running ] then [ launch program]"

but in the else statement, I don't know how to do something like (or if it is even possible):
"else [ f.raise program ]".

By the way, I didn't mention in my first post that I'm working in the Common Desktop Environment, although you have probably figured that out already.
# 4  
Old 06-06-2014
I overlook the window raise requirement.

Keeping my script solution, you need to lookup your target application window (xlswin maybe) and then call raise it programmatically by using something like dtwmcmd ( http://www.smart.net/~rlhamil/goodies/dtwmcmd.c ) or xraise ( https://github.com/en0/xraise/blob/master/xraise.c ).
# 5  
Old 06-09-2014
Thanks... I tried to run "xlswin" on my Solaris machine, but the program isn't installed. Is "xlswin" another Solaris open source C project? If so, do you have a link to the code?

EDIT: I was typing it in wrong... It is "xlswins", not "xlswin".
# 6  
Old 06-10-2014
Another, possibly easier and probably much more portable, approach would be to embed the "already running" check into the application itself.

Of course, that only works if you have control of the application...
# 7  
Old 06-11-2014
Download xraise.c and compile with
Code:
gcc -lX11 -o xraise xraise.c

that makes a binary named "xraise".
run
Code:
xwininfo

and click on the window you want to raise.
You get something with window ID and a window name in quotes, e.g. "this is blabla".
Then you can raise it to the top with the command
Code:
./xraise "this is blabla"

In your start script put this command in the else branch.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Solaris

How to add Solaris text console to Solaris grub2 menu?

Hi, I am new to sloaris and just instlled the solaris 11.2, i know little more about linux, i open the /boot/grub/grub.cfg in solaris and there is many other entries forl solaris 11.2 one of them is for 'Oracle Solaris 11.2 text console' but at boot grub2 only show the first default entry that... (1 Reply)
Discussion started by: shamsat
1 Replies

2. Solaris

Workspace Manager Menus - dtwmrc file

When I execute this command: exec xterm –e $SHELL –c “sed –n 4p /folder1/folder2/folder3/file.dat; $SHELL” I have the expecting result: It opens an new terminal, it shows the 4th line of the file and the terminal window stays open  perfect. So I tried to write it in the dtwmrc file to have an... (1 Reply)
Discussion started by: damientdm
1 Replies

3. Solaris

Unable to login using ssh,telnet onto my solaris machine with solaris 10 installed

Hi, I am unable to login into my terminal hosting Solaris 10 and get the below error message "Server refused to allocate pty ld.so.1: sh: fatal: libc.so.1: open failed: No such file or directory " Is there anyways i can get into my machine and what kind of changes are required to be... (7 Replies)
Discussion started by: sankasu
7 Replies

4. Solaris

application compiled on solaris 10 throwing error when executed on solaris 9

I have compiled my application on Solaris 10 with following description SunOS ldg1 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Blade-T6320 The compiler is Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25 But when installing the application on Solaris 9 SunOS odcarch02 5.9... (2 Replies)
Discussion started by: ash_bit2k2
2 Replies
Login or Register to Ask a Question