1753797 Members
8221 Online
108805 Solutions
New Discussion юеВ

changing worksapce name

 
SOLVED
Go to solution
Dedieu
Occasional Advisor

changing worksapce name

I want to notify start and end of programs by changing workspace name or color in the CDE environment.
Is it possible to do it dynamically ?

Thanks
10 REPLIES 10
Alex Glennie
Honored Contributor

Re: changing worksapce name

It possibly could be done but I'd have to check,test & play.

A far better suggestion would be to use CDE's in built functionality !

see the Advanced Users & System Administrators Guide P 231-232 and consider using the MONITOR_TYPE action :

An icon can change colour, say red to green once the task or process is done, in a similar way a letter appears over your mail icon on the front panel when you have new mail.

Carol Garrett
Trusted Contributor

Re: changing worksapce name


We use a script and xdialog to send colored popup messages to users X displays when an event occurs. Heres an example;

/usr/local/bin/xdialog -display orion:0 -bg red -fg black -t "************BACKUP FAILED**********" -O "Display $LOGFILE" -o -m " BACKUP FAILED on $HOSTNAME "


Dedieu
Occasional Advisor

Re: changing worksapce name

more informations,
i only use, in my CDE bar, the switch component. When the workspace changes, i start, if needed, the associated application (1 workspace = 1 application). So when an application is started in a workspace, i don't know it, except if i change the workspace name.
How do you do to change workspace name (c function, dtksh function, ... ) ?

thanks
Carol Garrett
Trusted Contributor

Re: changing worksapce name

The names of the workspaces is controlled by the X resource;

Dtwm*0*wsX*title

Where X is 0 for workspace One, 1 for Two etc. You can see its current setting (if not the default) by doing;

xrdb -query | grep -i dtwm

You can then change it by doing;
xrdb -merge <Dtwm*0*wsX*title: NEWNAME
EOF

But this doesnt update your CDE display immediately, you have to restart the workspace manager in order for it to be displayed. This is not going to be very helpful for your users having to restart the workspace manager just to update the name. Best to use some tool where you can control name (the title of the window) and color more dynamically, like using xdialog.
Alex Glennie
Honored Contributor

Re: changing worksapce name

Have a read of man DtWsmSetCurrentWorkspace, it maybe what you are after ?
Dedieu
Occasional Advisor

Re: changing worksapce name

OK, OK, i restart from the beginning

i have a multi workspace CDE environment where each of these workspace is assigned to an application.

What i attend to do is to be able to tell the user what are the running applications without he has to switch from every workspace to the others.

For instance, suppose i have 2 workspaces : 1 named Netscape and the other Emacs.

In the case Netscape is running, i'd like to change the name for "Netscape *" for instance, the "*" showing the running state.
Another solution would be to switch the color of the workspace button in the front panel switch component.

So i'm looking for a way to do any of these solutions dynamically, regarding the applications running state.

Regards,

Gerard Dedieu
Alex Glennie
Honored Contributor

Re: changing worksapce name

I can't think of a way, but did you check my first suggestion out fully ?

If you chose to launch your applications from icons on the front panel, could you not
change their appearance to indicate if the application was running or not and name the workspaces accordingly depending upon which application was running in each ?

fyi I do have a program which starts an application is a desired workspace though
Dedieu
Occasional Advisor

Re: changing worksapce name

OK, i will go to change icon color.

Where can i find an example for starting an application, no ICCCM compliant, in a specific workspace ?
Alex Glennie
Honored Contributor

Re: changing worksapce name

try attached binary switch : I use CDE's sessionetc script functionality with it :

vi $HOME/.dt/sessions/sessionetc (script so make sure executable)

./switch netscape

/opt/bin/netscape &

sleep 10

./switch emacs

/usr/contrib/bin/emacs &

etc etc