<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: change CDE workspace in a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564007#M838809</link>
    <description>Thanks to Alex.  That was just what I was looking for!  If only I could modify it to allow users to enter "next" to go to the next workspace.  I gotta learn more C.</description>
    <pubDate>Tue, 21 Jun 2005 12:43:42 GMT</pubDate>
    <dc:creator>Tom Fellowes</dc:creator>
    <dc:date>2005-06-21T12:43:42Z</dc:date>
    <item>
      <title>change CDE workspace in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564003#M838805</link>
      <description>How can I change my CDE workspace in a script?  I have KeyBindings setup, but need to do this from within a script (do something, change to next workspace, do something else).&lt;BR /&gt;&lt;BR /&gt;HP-UX 11.11 on b2600&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;Tom F&lt;BR /&gt;HTSI&lt;BR /&gt;Greenbelt, MD</description>
      <pubDate>Tue, 14 Jun 2005 13:07:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564003#M838805</guid>
      <dc:creator>Tom Fellowes</dc:creator>
      <dc:date>2005-06-14T13:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: change CDE workspace in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564004#M838806</link>
      <description>Send -HUP signal to CDE session???&lt;BR /&gt;Never tried it though.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Tue, 14 Jun 2005 13:33:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564004#M838806</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-06-14T13:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: change CDE workspace in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564005#M838807</link>
      <description>The CDE workspace setup is saved in the users ~/.dt/sessions/ files and directories. Most are readable ascii files. As far as I know, they are read during logon. The 'return to home' session is only written if the 'set home session' is selected. The 'resume current session' is written on exit. Options are in StyleManager -&amp;gt; Startup.&lt;BR /&gt;&lt;BR /&gt;You can savely edit the files from a script using your favorite tools like `sed`, `awk`, `perl` and such. Best to force 'set home session' with those settings since the 'resume current session' will overwrite the settings on exit. My way was to teach myself with reverse engineering: just set or unset the option and see what changes.</description>
      <pubDate>Wed, 15 Jun 2005 02:41:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564005#M838807</guid>
      <dc:creator>C. Beerse_1</dc:creator>
      <dc:date>2005-06-15T02:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: change CDE workspace in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564006#M838808</link>
      <description>/* include files  */&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;XM&gt;&lt;BR /&gt;#include &lt;DL&gt;&lt;DT&gt;&lt;BR /&gt;&lt;BR /&gt;/* functions */&lt;BR /&gt;void main(int, char**);&lt;BR /&gt;void ws_change(Widget widget, Atom aWorkspace, XtPointer client_data);&lt;BR /&gt;&lt;BR /&gt;/* global variables  */&lt;BR /&gt;static XmString xms;&lt;BR /&gt;static Widget toplevel;&lt;BR /&gt;static Widget *wWs;&lt;BR /&gt;static Atom *paWsSet = NULL;&lt;BR /&gt;static unsigned long numWorkspaces;&lt;BR /&gt;static Atom *paWs;&lt;BR /&gt;&lt;BR /&gt;static Display *display;&lt;BR /&gt;static Window  root;&lt;BR /&gt;static int     screen;&lt;BR /&gt;static  Widget  top, form, top1;&lt;BR /&gt;static  XtAppContext app_context;&lt;BR /&gt;static  Arg args[10];&lt;BR /&gt;static  int n, i, status, pNumWorkspaces;&lt;BR /&gt;static Atom *ppaWorkspaces, foundWsAtom = NULL;&lt;BR /&gt;static DtWsmWorkspaceInfo *ppWsInfo;&lt;BR /&gt;static DtWsmCBContext wsmcontext;&lt;BR /&gt;static char *desiredWs;&lt;BR /&gt;&lt;BR /&gt;/* main - main logic for program */&lt;BR /&gt;void main (int argc, char **argv)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;    /* initialize toolkit */&lt;BR /&gt;    n = 0;&lt;BR /&gt;    XtSetArg (args[n], XmNallowShellResize, True);  n++;&lt;BR /&gt;    XtSetArg (args[n], XtNmappedWhenManaged, False);  n++;&lt;BR /&gt;    toplevel = XtAppInitialize (&amp;amp;app_context, "Dtswitch", NULL, 0,&lt;BR /&gt;       &amp;amp;argc, argv, NULL, args, n);&lt;BR /&gt; display = XtDisplay(toplevel);&lt;BR /&gt; screen = DefaultScreen(display);&lt;BR /&gt; root = RootWindow(display, screen);&lt;BR /&gt; XSynchronize(display, screen);&lt;BR /&gt;&lt;BR /&gt; if ( argc != 2 )&lt;BR /&gt; {&lt;BR /&gt;  printf("must provide name of a workspace to switch to\n");&lt;BR /&gt;  printf("we'll just monitor workspace changes now\n");&lt;BR /&gt;  desiredWs = NULL;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt;  desiredWs = argv[1];&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; status = DtWsmGetWorkspaceList(display, root, &amp;amp;ppaWorkspaces,&lt;BR /&gt;            &amp;amp;pNumWorkspaces);&lt;BR /&gt; if (status != Success )&lt;BR /&gt; {&lt;BR /&gt;  printf("problem obtaining workspace list, exiting with status %d\n", &lt;BR /&gt;    status);&lt;BR /&gt;  exit(status);&lt;BR /&gt; }&lt;BR /&gt; /*&lt;BR /&gt; printf("Number of workspaces returned is %d\n", pNumWorkspaces);&lt;BR /&gt; */&lt;BR /&gt; for (i=0;i&lt;PNUMWORKSPACES&gt;&lt;/PNUMWORKSPACES&gt; {&lt;BR /&gt;  status = DtWsmGetWorkspaceInfo(display, root, ppaWorkspaces[i],&lt;BR /&gt;          &amp;amp;ppWsInfo);&lt;BR /&gt;  if (status != Success )&lt;BR /&gt;  {&lt;BR /&gt;   printf("problem getting workspace info %d\n", status);&lt;BR /&gt;  }&lt;BR /&gt;  else&lt;BR /&gt;  {&lt;BR /&gt;   printf("Workspace %d , title is %s, name is %s\n",i, &lt;BR /&gt;     ppWsInfo-&amp;gt;pchTitle,&lt;BR /&gt;     XGetAtomName(display,ppWsInfo-&amp;gt;workspace));&lt;BR /&gt;   if ((desiredWs != NULL) &amp;amp;&amp;amp; &lt;BR /&gt;      (0 == strcmp(desiredWs, ppWsInfo-&amp;gt;pchTitle)))&lt;BR /&gt;   {&lt;BR /&gt;    foundWsAtom = ppWsInfo-&amp;gt;workspace;&lt;BR /&gt;   }&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; wsmcontext = DtWsmAddCurrentWorkspaceCallback(toplevel, ws_change, NULL);&lt;BR /&gt; /*&lt;BR /&gt; printf("wsmcontext is %d\n", wsmcontext);&lt;BR /&gt; */&lt;BR /&gt;    XtRealizeWidget (toplevel);&lt;BR /&gt;&lt;BR /&gt; if (foundWsAtom != None)&lt;BR /&gt; { &lt;BR /&gt;  printf("Atom is %x, name is %s\n",&lt;BR /&gt;    foundWsAtom,XGetAtomName(display, foundWsAtom));&lt;BR /&gt;  XFlush(display);&lt;BR /&gt;  status = DtWsmSetCurrentWorkspace(toplevel, foundWsAtom); &lt;BR /&gt;  XFlush(display);&lt;BR /&gt;  printf("status is %d\n",status);&lt;BR /&gt;  /*&lt;BR /&gt;  if ( status != Success )&lt;BR /&gt;  {&lt;BR /&gt;   printf("workspace %s does not exist\n", desiredWs);&lt;BR /&gt;  }&lt;BR /&gt;  */&lt;BR /&gt; } &lt;BR /&gt; else&lt;BR /&gt;  printf("Never found a match - workspace doesn't exist\n");&lt;BR /&gt; /*&lt;BR /&gt;    XtAppMainLoop (app_context);&lt;BR /&gt; */&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void  ws_change(Widget widget, Atom aWorkspace, XtPointer client_data)&lt;BR /&gt;{&lt;BR /&gt; printf("In the change workspace callback\n");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Requires CDE dev kit libs to compile : resulting switch executable usage :&lt;BR /&gt;&lt;BR /&gt;switch Two &lt;BR /&gt;&lt;BR /&gt;nb Uses CDE default naming convention wrt Workspaces ie doesn't cope with customised names for workspaces ... maybe of some use to you ?&lt;/DT&gt;&lt;/DL&gt;&lt;/XM&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Wed, 15 Jun 2005 04:46:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564006#M838808</guid>
      <dc:creator>Alex Glennie</dc:creator>
      <dc:date>2005-06-15T04:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: change CDE workspace in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564007#M838809</link>
      <description>Thanks to Alex.  That was just what I was looking for!  If only I could modify it to allow users to enter "next" to go to the next workspace.  I gotta learn more C.</description>
      <pubDate>Tue, 21 Jun 2005 12:43:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-cde-workspace-in-a-script/m-p/3564007#M838809</guid>
      <dc:creator>Tom Fellowes</dc:creator>
      <dc:date>2005-06-21T12:43:42Z</dc:date>
    </item>
  </channel>
</rss>

