I found this im-launch startup entry after installing Ubuntu 19.10 which executes
sh -c 'if ! [ -e "/usr/bin/ibus-daemon" ] && [ "x$XDG_SESSION_TYPE" = "xwayland" ] ; then exec env IM_CONFIG_CHECK_ENV=1 im-launch true; fi'
I want to know the purpose of this entry and what would happend if i disabled it ?
-e
check the file/usr/bin/ibus-daemon
exists or not? exist means true does not exist means false.!
wants to confirm above value is false if above value is true, it will not execute anything.[ "x$XDG_SESSION_TYPE" = "xwayland" ]
this can have either one of below values based on how you choose to login at the login screen. which session you will choose x11 or wayland."xx11" = "xwayland" "xwayland" = "xwayland"
example output of $XDG_SESSION_TYPE
another example:
if the first expression is false and x$XDG_SESSION_TYPE = xwayland then exec the command
env IM_CONFIG_CHECK_ENV=1 im-launch true
if the first expression is true or x$XDG_SESSION_TYPE is not equal to xwayland then don't do anything.
see
man test
and
you can read more about what this command does
then exec env IM_CONFIG_CHECK_ENV=1 im-launch true;
see
man env
& manim-launch
By default in Ubuntu 19.10
/usr/bin/ibus-daemon
exists. so the command will not be executed.when there is the file
/usr/bin/ibus-daemon
and my session isx11
here is something about IM
when there is no file
/usr/bin/ibus-daemon
and my session iswayland
here is the thing which is different from above, which means the env is applied and then a chain reaction followed.
so, if you disable or enable this from startup list nothing happens unless no existence of this file
/usr/bin/ibus-daemon
and your session iswayland
conditions are met.I was doing some research on how to configure Ubuntu to make it more performant and ended up here, which is interesting.
My
im-launch
startup entry:As answer was detailed by @UnKNOWn but @foobar's comment was my situation, so I took a deep dive.
Breaking The Command Down:
sh
is a command language interpreter that executes commands read from a command line string, the standard input, or a specified file.exec
command in Linux is used to execute a command from the bash itself.if CONDITION true THEN execute COMMAND
im-launch
command is used to start a input method framework server daemon such a ibus-daemon, set up the appropriate environment variables for the client programs,and execute SESSION-PROGRAM such as x-session-manager.ibus-daemon
is a daemon program for ibus and it is also a start up program for users to activate ibus daemon, engines and panel.daemon
is a computer program that runs as a background process, rather than being under the direct control of an interactive user.ibus
is an intelligent input bus.bus
is simply a set of wires connecting multiple modules (processor, memory, IO devices).The
exec
Then my question was why do
exec env
when we are already execution the command fromsh
.The
exec
command replaces the current shell process with the specified command. Normally, when you run a command a new process is spawned (forked), the exec command does not spawn a new process. Instead, the current process is overlaid with the new command. In other words the exec command is executed in place of the current shell without creating a new process.Use of
env
- If you want to modify the environment for a program before executing the main program, you'd often write an script and at the end of it start the main program. But there is no need for the script to stay in memory at that time. So, exec is used in these cases so that, the main program can replace the mother script.I added the following comment to my im-launch startup item: "Check for display server type, x11 or wayland"
I have only one thing to add that was hinted by @UnKNOWn and his comment.
IM-Launch could mean Input Method. Such as the one referred to on wikipedia
This also supports Anit's answer by his mentioning ibus future readers can find on wiki here
In plain simple terms it would appear to be a way to check which keyboard layout/language is to be used.. but i wouldn't quote me ...From a google search microsoft has much to say on the subject.
Just thought the 'IM' bit was semi important and above answers weren't clear for me..