Install Terminator without setting it as default?

Asked by maqp on 2016-06-04

So my program consists of multiple python programs each run on their own terminal, all conveniently launched in Terminator. My program's installer therefore installs Terminator. The issue is, sudo apt-get install terminator sets Terminator as default terminal on Ubuntu 16.04, something the users might not like. Is there a way to stop it from doing this?

Question information

Language:
English Edit question
Status:
Solved
For:
Terminator Edit question
Assignee:
No assignee Edit question
Solved by:
Stephen Boddy
Solved:
2016-06-08
Last query:
2016-06-08
Last reply:
2016-06-04
Manfred Hampl (m-hampl) said : #1

I assume you can set the desired terminal application with help of

update-alternatives --config x-terminal-emulator

Install terminator, and then try setting the selection back to gnome-terminal.wrapper (or whatever you want)

As far as I'm aware we don't set it as default:

http://bazaar.launchpad.net/~gnome-terminator/terminator/trunk/view/head:/debian/terminator.postinst

is the file that is run after the package is uncompressed. As you can see, we are adding Terminator as an alternative, but we do not change the setting (i.e. there is no "update-alternatives --set x-terminal-emulator /usr/bin/terminator.wrapper"). What I think is happening though is that the high priority of Terminator (50) is putting it to the top of the list, before other programs (i.e. xterm=20, gnome-terminal=40). Unless the user has previously set the alternative it is likely to be doing "auto", and picking the highest priority (Terminator). As Manfred says, your install procedure could detect the current value before installing Terminator then, after installation, force set the value to the previous setting.

Note that Terminator has been installed as an alternative since 2008 ( http://bazaar.launchpad.net/~gnome-terminator/terminator/trunk/revision/548 ) and always had a high priority.

maqp (oottela) said : #3

Thanks Stephen and Manfred!

This is the first time I run into the priorities different terminals have. Interesting lesson. A fresh installation of Ubuntu has indeed gnome-terminal with priority of 40, so Terminator supersedes it when installed.

I did some searching based on your help and found that I can view active terminal application before installation with

ps -o 'cmd=' -p $(ps -o 'ppid=' -p $$)

and set it back with

sudo update-alternatives --set x-terminal-emulator /usr/bin/python /usr/bin/x-terminal-emulator

or whatever was active.