Announcement

Collapse
No announcement yet.

maximise a programme from the command line

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    maximise a programme from the command line

    I have an application written in Gambas3.
    When it runs it minimises itself to an icon in the tool tray. A single click on the icon displays the programme's main form.
    How can I do this from the command line?
    I can get the PID for the programme and have tried :-
    Code:
    wmctrl -iR 15534
    where 15534 is the PID reported by:-
    Code:
    ps -ef
    .
    This produces an error:-
    "X Error of failed request: BadWindow (invalid Window parameter)
    Major opcode of failed request: 20 (X_GetProperty)
    Resource id in failed request: 0x3cae
    Serial number of failed request: 11
    Current serial number in output stream: 11"

    Any ideas would be welcome.

    Kubuntu 13.10

    #2
    wmctrl

    man wmctrl:
    Code:
    NAME
           wmctrl - interact with a EWMH/NetWM compatible X Window Manager.
    
    SYNOPSIS
           wmctrl [ options | actions ]...
    
    ...
           -l     List the windows being managed by the window manager. One line is output for each window, with the line
                  broken  up  into  space  separated  columns.  The first column always contains the window identity as a
                  hexadecimal integer, and the second column always contains the desktop number (a -1 is used to identify
                  a  sticky window). If the -p option is specified the next column will contain the PID for the window as
                  a decimal integer. If the -G option is specified then  four  integer  columns  will  follow:  x-offset,
                  y-offset,  width  and height. The next column always contains the client machine name. The remainder of
                  the line contains the window title (possibly with multiple spaces in the title).
    ...
    
           -R <WIN>
                  Move the window <WIN> to the current desktop, raise the window, and give it focus.
    ...
    
    OPTIONS
    
           -i     Interpret window arguments (<WIN>) as a numeric value rather than a string name for the window. If  the
                  numeric value starts with the prefix '0x' it is assumed to be a hexadecimal number.
    
    ...
    
    ARGUMENTS
    
          <WIN>  This argument specifies a window that is the target of an action. By default the argument is treated as
                  if were a string, and windows are examined until one is found with a title the contains  the  specified
                  string  as  a substring. The substring matching is done in a case insensitive manner. The -F option may
                  be used to force exact, case sensitive title matching. The option -i may be used to interpret the  win‐
                  dow target as a numeric window identity instead of a string.
    ...
    Use the
    Code:
    wmctrl -l
    to get the <WIN>

    and then
    Code:
    wmctrl -iR <WIN>
    Last edited by Rog132; Feb 26, 2014, 11:57 AM.
    A good place to start: Topic: Top 20 Kubuntu FAQs & Answers
    Searching FAQ's: Google Search 'FAQ from Kubuntuforums'

    Comment


      #3
      Thanks for the ideas.
      Code:
      wmctrl -l
      produces:-
      0x01a001c5 -1 bill-CQ2960EA plasma-desktop
      0x01a001bc -1 bill-CQ2960EA plasma-desktop
      0x03e00012 0 bill-CQ2960EA maximise a programme from the command line - rekonq
      0x04800011 0 bill-CQ2960EA Play Music Library
      0x0440001a 0 bill-CQ2960EA bill : bash – Konsole

      None of the items shown is the programme associated with the icon in the tool tray.

      "Play Music Library" is another Gambas3 project that is running as a 'normal' application.

      Perhaps there's an issue of terminolgy here. By 'tool tray, I mean that part of the Kubuntu Plasma screen on the bottom right (at least on my set-up) where I also have Clipboard Contents, Volume Control etc.

      The icon referred to is a Gambas3 email programme which has no window until the icon is clicked

      Hope this makes some sense!

      Comment

      Working...
      X