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

open terminal at user defined coordinates

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 384 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 16 Jul 2023, 18:18 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Jul 2023, 18:26 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 16 Jul 2023, 19:54
      0
      • S SGaist
        16 Jul 2023, 18:26

        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 16 Jul 2023, 19:54 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?

        J 1 Reply Last reply 16 Jul 2023, 20:17
        0
        • J JacobNovitsky
          16 Jul 2023, 19:54

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

          J Offline
          J Offline
          JonB
          wrote on 16 Jul 2023, 20:17 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 16 Jul 2023, 23:57
          0
          • J JonB
            16 Jul 2023, 20:17

            @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 16 Jul 2023, 23:57 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 24 Jul 2023, 00:05
            3
            • C ChrisW67
              16 Jul 2023, 23:57

              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 24 Jul 2023, 00:05 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 24 Jul 2023, 01:33
              0
              • J JacobNovitsky
                24 Jul 2023, 00:05

                @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 24 Jul 2023, 01:33 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