Announcement

Collapse
No announcement yet.

Command exec

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

    Command exec

    It is possible to run an application with the command exec and determine the size of the window of the application??

    #2
    Re: Command exec

    Originally posted by a_ras2002
    It is possible to run an application with the command exec and determine the size of the window of the application??
    Not with exec. You might want to read exec's man page to get a little better feel for things.
    we see things not as they are, but as we are.
    -- anais nin

    Comment


      #3
      Re: Command exec

      You can, after the app is running, right-click on the title bar and > Advanced > Special Window Settings... > OK. Under Geometery (the tab opened by default) you will see the size of the window the app is using.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Re: Command exec

        Originally posted by Snowhog
        You can, after the app is running, right-click on the title bar and > Advanced > Special Window Settings... > OK. Under Geometery (the tab opened by default) you will see the size of the window the app is using.
        Cool. Did not know that. Again, I learned something new here.

        Comment


          #5
          Re: Command exec

          You can also use the "--geometry <geometry>" option to set window geometry options when running kde applications from cli. (you may also need to use "--nofork" with it for it to work on some applications, like dolphin or konsole).

          EDIT: example:
          Code:
          konsole --nofork --geometry 600x400-200-200

          Comment


            #6
            Re: Command exec

            Originally posted by kubicle
            You can also use the "--geometry <geometry>" option to set window geometry options when running kde applications from cli. (you may also need to use "--nofork" with it for it to work on some applications, like dolphin or konsole).

            EDIT: example:
            Code:
            konsole --nofork --geometry 600x400-200-200
            The 600x400 it's the window size but what it's the -200-200??

            Comment


              #7
              Re: Command exec

              Information (> HOWTO find Kubuntu's manual / reference / guide / documentation / help) :

              Code:
              konsole --help
              ...
              Generic options:
              --help Show help about options
              --help-qt Show Qt specific options
              --help-kde Show KDE specific options
              --help-all Show all options
              ...
              =>

              Code:
              konsole --help-kde
              ...
              KDE options:
              ...
              --geometry <geometry> sets the client geometry of the main widget - see man X for the argument format
              ...
              =>

              Code:
              man X
              ...

              GEOMETRY SPECIFICATIONS

              One of the advantages of using window systems instead of hardwired terminals is that applications don't have to be restricted to a particular size or location on the screen. Although the layout of windows on a display is controlled by the window manager that the user is running (described below), most X programs accept a command line argument of the form -geometry WIDTHx HEIGHT+XOFF+YOFF (where WIDTH, HEIGHT, XOFF, and YOFF are numbers) for specifying a preferred size and location for this application's main window.

              The WIDTH and HEIGHT parts of the geometry specification are usually measured in either pixels or characters, depending on the application. The XOFF and YOFF parts are measured in pixels and are used to specify the distance of the window from the left or right and top and bottom edges of the screen, respectively. Both types of offsets are measured from the indicated edge of the screen to the corresponding edge of the window. The X offset may be specified in the following ways:

              +XOFF The left edge of the window is to be placed XOFF pixels in from the left edge of the screen (i.e., the X coordinate of the window's origin will be XOFF). XOFF may be negative, in which case the window's left edge will be off the screen.

              -XOFF The right edge of the window is to be placed XOFF pixels in from the right edge of the screen. XOFF may be negative, in which case the window's right edge will be off the screen.

              The Y offset has similar meanings:

              +YOFF The top edge of the window is to be YOFF pixels below the top edge of the screen (i.e., the Y coordinate of the window's origin will be YOFF). YOFF may be negative, in which case the window's top edge will be off the screen.

              -YOFF The bottom edge of the window is to be YOFF pixels above the bottom edge of the screen. YOFF may be negative, in which case the window's bottom edge will be off the screen.

              Offsets must be given as pairs; in other words, in order to specify either XOFF or YOFF both must be present. Windows can be placed in the four corners of the screen using the following specifications:

              +0+0 upper left hand corner.

              -0+0 upper right hand corner.

              -0-0 lower right hand corner.

              +0-0 lower left hand corner.

              In the following examples, a terminal emulator is placed in roughly the center of the screen and a load average monitor, mailbox, and clock are placed in the upper right hand corner:

              xterm -fn 6x10 -geometry 80x24+30+200 &
              xclock -geometry 48x48-0+0 &
              xload -geometry 48x48-96+0 &
              xbiff -geometry 48x48-48+0 &
              ...
              Before you edit, BACKUP !

              Why there are dead links ?
              1. Thread: Please explain how to access old kubuntu forum posts
              2. Thread: Lost Information

              Comment


                #8
                Re: Command exec

                Thanks everyone, for your answers. It works perfectly!!
                But I had one more question, when i run a command for example vncserver i would like to save what it appears in the konsole, but i don't know how can i do this.
                I've tried with vncserver > file.txt but it doesn't work...

                Comment


                  #9
                  Re: Command exec

                  Originally posted by a_ras2002
                  But I had one more question, when i run a command for example vncserver i would like to save what it appears in the konsole, but i don't know how can i do this.
                  I've tried with vncserver > file.txt but it doesn't work...
                  Your command only redirects standard output (stdout) to the file, if you wish to get error messages (stderr) to the file as well, you can use, for example:
                  Code:
                  vncserver > file.txt 2>&1
                  (this will direct stderr (2) to the same place (the file) as stdout (1))

                  Comment


                    #10
                    Re: Command exec

                    Originally posted by kubicle
                    Code:
                    vncserver > file.txt 2>&1
                    (this will direct stderr (2) to the same place (the file) as stdout (1))
                    Unless I'm mistaken, it is vnc4server. I'm in my 9.04 (KDE 4.3.2) and Synaptic doesn't find vncserver but does have vnc4server
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment

                    Working...
                    X