Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. open terminal at user defined coordinates
Forum Update on Monday, May 27th 2025

open terminal at user defined coordinates

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 386 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JacobNovitsky
    wrote on last edited by
    #1

    I need to open terminal at user defined coordinates (usuing Ubuntu/newest Qt Creator)
    Command below works fine for me, but It has no effect for terminal opened with Ctrl+R (run) from Qt creator
    What should I insert to pro file to make below?
    gnome-terminal --geometry 80x24+2720+0

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That's completely unrelated to your .pro file.

      Also, is it your application that triggers the appearance of the terminal or did you check the "Run in terminal" option of Qt Creator ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        That's completely unrelated to your .pro file.

        Also, is it your application that triggers the appearance of the terminal or did you check the "Run in terminal" option of Qt Creator ?

        J Offline
        J Offline
        JacobNovitsky
        wrote on last edited by
        #3

        @SGaist yes, its checked on Run on terminal file
        So how can I make qt creator open terminal in specific coordinate?

        JonBJ 1 Reply Last reply
        0
        • J JacobNovitsky

          @SGaist yes, its checked on Run on terminal file
          So how can I make qt creator open terminal in specific coordinate?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @JacobNovitsky
          Over 10 years ago Qt Creator: Run in Terminal

          Under Tools-Options-Environment-General, change the terminal value from x-terminal-emulator -e to /usr/bin/xterm -e. This did the trick for me.

          Does that option still exist, is that where the gnome-terminal command is specified?

          C 1 Reply Last reply
          0
          • JonBJ JonB

            @JacobNovitsky
            Over 10 years ago Qt Creator: Run in Terminal

            Under Tools-Options-Environment-General, change the terminal value from x-terminal-emulator -e to /usr/bin/xterm -e. This did the trick for me.

            Does that option still exist, is that where the gnome-terminal command is specified?

            C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            Yes that option still exists. By default it will run a stub to launch a suitable terminal emulator for the desktop environment installed; in my case konsole. You can directly select a different terminal emulator if you wish. Provided the underlying terminal emulator takes the standard X11 geometry options (all the common options do IIRC) then you should be able to do this:

            78f97a16-e085-4989-8bbb-2be249bcf6e1-image.png

            J 1 Reply Last reply
            3
            • C ChrisW67

              Yes that option still exists. By default it will run a stub to launch a suitable terminal emulator for the desktop environment installed; in my case konsole. You can directly select a different terminal emulator if you wish. Provided the underlying terminal emulator takes the standard X11 geometry options (all the common options do IIRC) then you should be able to do this:

              78f97a16-e085-4989-8bbb-2be249bcf6e1-image.png

              J Offline
              J Offline
              JacobNovitsky
              wrote on last edited by JacobNovitsky
              #6

              @ChrisW67 if I add -e (?flag), terminal will not be called
              If use without -e flag -> it does nothing

              terminal.png

              C 1 Reply Last reply
              0
              • J JacobNovitsky

                @ChrisW67 if I add -e (?flag), terminal will not be called
                If use without -e flag -> it does nothing

                terminal.png

                C Offline
                C Offline
                ChrisW67
                wrote on last edited by
                #7

                @JacobNovitsky The command to execute your program after launching gnome-terminal is added by Qt Creator. following the -e or --command flag. See the gnome-terminal man page

                The --geometry flag is a little vague. The size components are either in pixels or characters depending on the application. The man page does not shed any light on this and I do not have it to test.
                Have you tried the command from a shell prompt?

                /usr/bin/gnome-terminal --geometry 80x24+2720+0 -e /bin/bash
                # or
                /usr/bin/gnome-terminal --geometry 800x600+2720+0 -e /bin/bash
                

                You can also try it with a single hyphen before geometry rather than two. If the window cannot be placed 2720 pixels from the left of the screen then I would expect it will usually be moved somewhere it can fit.

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved