Ctrl-Alt-t opens root terminal instead of normal terminal

adamconkey

I installed Terminator and made it my default terminal with this solution, but now Ctrl-Alt-T opens Terminator as a root terminal. How do I get it to open Terminator as a normal terminal?

enter image description here

Sergiy Kolodyazhnyy

What happens ?

TL;DR #1: Basically, you spawn x-terminal-emulator and Unity searches for anything that has x-terminal-emulator in their shortcut file.

  1. You press Ctrl+Alt+T, which spawns x-terminal-emulator. In Debian Alternatives system, x-terminal-emulator is a symlink to a whatever terminal emulator app you would want to use.
  2. Unity's mechanisms search through the list of "shortcut" files in /usr/share/applications. It finds the gksu.desktop file, which has Exec=gksu /usr/bin/x-terminal-emulator line and then takes out the line Name=Root Terminal. That Root Terminal is then displayed on the Unity's panel

Why the same thing doesn't happen with gnome-terminal?

TL;DR #2: gnome-terminal is actually spawned by a wrapper script, to which the default shortcut is linked.

When you run sudo update-alternatives --config x-terminal-emulator you are presented with choices, but none of them is /usr/bin/gnome-terminal. Rather you have /usr/bin/gnome-terminal.wrapper which is a perl script that sets up gnome-terminal first ! If you read through that script, at the end it has the following line :

exec('gnome-terminal',@args);

The exec call then spawns /usr/bin/gnome-terminal , as separate app. Unity again searches /usr/share/applications/ directory and finds gnome-terminal.desktop file which has Name=Terminal line, and it shows it on the launcher.

What can be done?

TL;DR #3: reassign keyboard shortcut,use custom wrapper, or create custom .desktop file. I recommend the .desktop way.

Easiest way is to reassign the shortcut. Use gsettings for that

 gsettings set org.gnome.desktop.default-applications.terminal exec 'sakura'

But that still doesn't solve the quirk with Unity's dash. My preferred solution is to create the custom .desktop file /usr/share/applications/x-terminal-emulator.desktop with the following contents

[Desktop Entry]
Name=MY CUSTOM TERMINAL
Encoding=UTF-8
Exec=/usr/bin/x-terminal-emulator
Icon=gksu-root-terminal
StartupNotify=true
Terminal=false
Type=Application
Categories=GTK;Utility;TerminalEmulator;

That way , you don't have to change anything, but Unity will display MY CUSTOM NAME on the launcher.

Third way, if you are feeling adventurous is to write a wrapper script, something like this:

   #!/bin/sh
   exec /path/to/terminal-emulator ${1+"$@"}

Then you can add it as one of the options in the alternatives system using

sudo update-alternatives   --install /path/to/wrapper name /path/to/wrapper priority 

Side note: priority is an integer, such as 10.

More info

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Alt+Ctrl+T no longer opens a terminal

From Dev

Ctrl Alt T no longer opens terminal

From Dev

ctrl-alt-t opens new terminal window instead of new tab while gnome terminal is active window

From Dev

ctrl-alt-t opens new terminal window instead of new tab while gnome terminal is active window

From Dev

Vim 8 terminal standard `termkey' CTRL-W_N opens new split instead of switching to normal mode

From Dev

Ctrl+Alt+T doesn't open a Terminal in Cinnamon 1.6

From Dev

gnome-terminal.desktop for key shortcut (ctrl+alt+t)

From Dev

Ctrl+Alt+T brings up Trash folder, not a Terminal?

From Dev

Mistyped <Ctrl>+<Alt>+<T> split existing terminal window

From Dev

Focus existing terminal with `Ctrl-Alt-T` shortcut

From Dev

Set Ctrl+Alt+T to open a maximized terminal

From Dev

Set default location for Terminal window opened with Ctrl+Alt+T

From Dev

Ubuntu 18.04 Terminal shortcut Ctrl+Alt+T is not working

From Dev

Make Ctrl-Alt-T to open a terminal tab if any terminal was open

From Dev

annoying CTRL+F# instead of CTRL+ALT+F# Virtual Terminal Switching on Fedora 33 with sway wayland and gdm

From Dev

Meaning of $ and # symbols for normal and root user in terminal

From Dev

How to make "CTRL + ALT + T" open new Terminal window when one is already open?

From Dev

How to make "CTRL + ALT + T" open new Terminal window when one is already open?

From Dev

Set a shortcut for opening Terminator (similar to Ctrl+Alt+T, but not replacing default terminal)

From Dev

How do I get Ctrl + Alt + t to launch ther terminal in Linux Mint 13 MATE?

From Dev

Prevent Ctrl-Alt-T from opening a new terminal window when one already exist?

From Dev

Terminal Short-cut ctrl + alt + T, 2 terminals, different size

From Dev

How to make scripts run in Guake terminal instead of normal terminal?

From Dev

Rebinding/disabling CTRL+ALT+F# Virtual Terminal/Console Switching

From Dev

Format from terminal(ctrl+alt+f1)

From Dev

Is the terminal that you get when typing Ctrl+Alt+F# a process?

From Dev

Why does CTRL-ALT-F1 not send me to a terminal?

From Dev

I can't remove root terminal

From Dev

Terminal opens but shows an error and doesn't work properly

Related Related

  1. 1

    Alt+Ctrl+T no longer opens a terminal

  2. 2

    Ctrl Alt T no longer opens terminal

  3. 3

    ctrl-alt-t opens new terminal window instead of new tab while gnome terminal is active window

  4. 4

    ctrl-alt-t opens new terminal window instead of new tab while gnome terminal is active window

  5. 5

    Vim 8 terminal standard `termkey' CTRL-W_N opens new split instead of switching to normal mode

  6. 6

    Ctrl+Alt+T doesn't open a Terminal in Cinnamon 1.6

  7. 7

    gnome-terminal.desktop for key shortcut (ctrl+alt+t)

  8. 8

    Ctrl+Alt+T brings up Trash folder, not a Terminal?

  9. 9

    Mistyped <Ctrl>+<Alt>+<T> split existing terminal window

  10. 10

    Focus existing terminal with `Ctrl-Alt-T` shortcut

  11. 11

    Set Ctrl+Alt+T to open a maximized terminal

  12. 12

    Set default location for Terminal window opened with Ctrl+Alt+T

  13. 13

    Ubuntu 18.04 Terminal shortcut Ctrl+Alt+T is not working

  14. 14

    Make Ctrl-Alt-T to open a terminal tab if any terminal was open

  15. 15

    annoying CTRL+F# instead of CTRL+ALT+F# Virtual Terminal Switching on Fedora 33 with sway wayland and gdm

  16. 16

    Meaning of $ and # symbols for normal and root user in terminal

  17. 17

    How to make "CTRL + ALT + T" open new Terminal window when one is already open?

  18. 18

    How to make "CTRL + ALT + T" open new Terminal window when one is already open?

  19. 19

    Set a shortcut for opening Terminator (similar to Ctrl+Alt+T, but not replacing default terminal)

  20. 20

    How do I get Ctrl + Alt + t to launch ther terminal in Linux Mint 13 MATE?

  21. 21

    Prevent Ctrl-Alt-T from opening a new terminal window when one already exist?

  22. 22

    Terminal Short-cut ctrl + alt + T, 2 terminals, different size

  23. 23

    How to make scripts run in Guake terminal instead of normal terminal?

  24. 24

    Rebinding/disabling CTRL+ALT+F# Virtual Terminal/Console Switching

  25. 25

    Format from terminal(ctrl+alt+f1)

  26. 26

    Is the terminal that you get when typing Ctrl+Alt+F# a process?

  27. 27

    Why does CTRL-ALT-F1 not send me to a terminal?

  28. 28

    I can't remove root terminal

  29. 29

    Terminal opens but shows an error and doesn't work properly

HotTag

Archive