Alter shortcut to open in terminal eclipse

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mgwx
Level 1
Level 1
Posts: 5
Joined: Thu Dec 02, 2021 6:13 pm

Alter shortcut to open in terminal eclipse

Post by mgwx »

How can I change the Eclipse installed shortcut to open in terminal where my bashrc environment gets set.
I know if I right click and select "Open in terminal" works. but it would be nice to have that as an open. Presenty,
it is
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Terminal=false
Encoding=UTF-8
Version=1.1
Name=Eclipse IDE for C/C++ Developers - 2021-09
Exec=env GTK_IM_MODULE=ibus /home/mwremote/eclipse/cpp-2021-09/eclipse/eclipse
Categories=Development;IDE;
Icon=/home/mwremote/eclipse/cpp-2021-09/eclipse/icon.xpm
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mgwx
Level 1
Level 1
Posts: 5
Joined: Thu Dec 02, 2021 6:13 pm

Re: Alter shortcut to open in terminal eclipse

Post by mgwx »

This seems to work:

#!/usr/bin/env xdg-open

[Desktop Entry]
Type=Application
Terminal=false
Encoding=UTF-8
Version=1.1
Name=Eclipse IDE for C/C++ Developers - 2021-09
Exec=sh -c ". /opt/intel/oneapi/setvars.sh; GTK_IM_MODULE=ibus; /home/mwremote/eclipse/cpp-2021-09/eclipse/eclipse"
Categories=Development;IDE;
Icon=/home/mwremote/eclipse/cpp-2021-09/eclipse/icon.xpm
Name[en_US]=sh Eclipse IDE for C/C++ Developers - 2021-09
mgwx
Level 1
Level 1
Posts: 5
Joined: Thu Dec 02, 2021 6:13 pm

Re: Alter shortcut to open in terminal eclipse

Post by mgwx »

Exec=sh -c ". /opt/intel/oneapi/setvars.sh; /home/mwremote/eclipse/cpp-2021-09/eclipse/eclipse" works.
GTK_IM_MODULE=ibus may be unnecessary as it is already set https://discourse.ubuntu.com/t/ibus-no- ... ibus/17727 elsewhere and I suspect but don't know that GTK_IM_MODULE=ibus sets nothing as written.
If I use "&&" instead of ";",
Exec=sh -c ". /opt/intel/oneapi/setvars.sh && GTK_IM_MODULE=ibus && /home/mwremote/eclipse/cpp-2021-09/eclipse/eclipse" works, so GTK_IM_MODULE=ibus) must not be returning error.
SimonPeter
Level 5
Level 5
Posts: 579
Joined: Tue Jul 13, 2021 5:13 am

Re: Alter shortcut to open in terminal eclipse

Post by SimonPeter »

mgwx wrote: Thu Dec 02, 2021 6:28 pm How can I change the Eclipse installed shortcut to open in terminal where my bashrc environment gets set.
I know if I right click and select "Open in terminal" works. but it would be nice to have that as an open. Presenty,
it is
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Terminal=false
Encoding=UTF-8
Version=1.1
Name=Eclipse IDE for C/C++ Developers - 2021-09
Exec=env GTK_IM_MODULE=ibus /home/mwremote/eclipse/cpp-2021-09/eclipse/eclipse
Categories=Development;IDE;
Icon=/home/mwremote/eclipse/cpp-2021-09/eclipse/icon.xpm
Try this (opens a Terminal window, runs eclipse in that and closes when eclipse is closed):
Exec=x-terminal-emulator -e /bin/bash -c 'GTK_IM_MODULE=ibus /home/mwremote/eclipse/cpp-2021-09/eclipse/eclipse'

If you want the Terminal window to be open even after Eclipse closes, use this:
Exec=x-terminal-emulator -e /bin/bash -c 'GTK_IM_MODULE=ibus /home/mwremote/eclipse/cpp-2021-09/eclipse/eclipse ; bash'
mgwx
Level 1
Level 1
Posts: 5
Joined: Thu Dec 02, 2021 6:13 pm

Re: Alter shortcut to open in terminal eclipse

Post by mgwx »

Typo made me think previous suggestion did not work for me
Last edited by mgwx on Fri Dec 03, 2021 8:04 pm, edited 1 time in total.
mgwx
Level 1
Level 1
Posts: 5
Joined: Thu Dec 02, 2021 6:13 pm

Re: Alter shortcut to open in terminal eclipse

Post by mgwx »

I made a typo and that works as well with
Exec=x-terminal-emulator -e /bin/bash -c '. /opt/intel/oneapi/setvars.sh && GTK_IM_MODULE=ibus && /home/mwremote/eclipse/cpp-2021-09/eclipse/eclipse'
Locked

Return to “Software & Applications”