Skip to content

Commit

Permalink
tools: Enable ibus restart in GNOME desktop
Browse files Browse the repository at this point in the history
If ibus-daemon is called via systemd, IBus restart API cannot restart
ibus-daemon but just terminates it.
Now ibus restart command checks the systemd avaiability and restart
ibus-daemon via systemd.
ibus start command is also added to launch ibus-daemon with systemd.

BUG=#2407
  • Loading branch information
fujiwarat committed Jul 19, 2022
1 parent 79e446e commit ab0d176
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 44 deletions.
80 changes: 48 additions & 32 deletions po/ibus10.pot
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: ibus 1.5.26\n"
"Report-Msgid-Bugs-To: https://github.com/ibus/ibus/issues\n"
"POT-Creation-Date: 2022-06-20 20:30+0900\n"
"PO-Revision-Date: 2022-06-20 20:30+0900\n"
"POT-Creation-Date: 2022-07-06 22:08+0900\n"
"PO-Revision-Date: 2022-07-06 22:08+0900\n"
"Last-Translator: Takao Fujiwara <takao.fujiwara1@gmail.com>\n"
"Language-Team: Source\n"
"Language: \n"
Expand Down Expand Up @@ -3099,129 +3099,145 @@ msgstr ""
msgid "Supplementary Private Use Area-B"
msgstr ""

#: tools/main.vala:51
#: tools/main.vala:182
msgid "List engine name only"
msgstr ""

#: tools/main.vala:67 tools/main.vala:192 tools/main.vala:202
#: tools/main.vala:198 tools/main.vala:395 tools/main.vala:437
msgid "Can't connect to IBus.\n"
msgstr ""

#: tools/main.vala:93
#: tools/main.vala:224
#, c-format
msgid "language: %s\n"
msgstr ""

#: tools/main.vala:161
#: tools/main.vala:294
msgid "No engine is set.\n"
msgstr ""

#: tools/main.vala:169
#: tools/main.vala:302
msgid "Set global engine failed.\n"
msgstr ""

#: tools/main.vala:174
#: tools/main.vala:307
msgid "Get global engine failed.\n"
msgstr ""

#: tools/main.vala:217
#: tools/main.vala:328
msgid "Start or restart daemon with \"direct\" or \"systemd\" TYPE."
msgstr ""

#: tools/main.vala:331
msgid "Start or restart daemon with SYSTEMD_SERVICE file."
msgstr ""

#: tools/main.vala:334
msgid "Show debug messages."
msgstr ""

#: tools/main.vala:454
msgid "Read the system registry cache."
msgstr ""

#: tools/main.vala:219
#: tools/main.vala:456
msgid "Read the registry cache FILE."
msgstr ""

#: tools/main.vala:237 tools/main.vala:242
#: tools/main.vala:474 tools/main.vala:479
msgid "The registry cache is invalid.\n"
msgstr ""

#: tools/main.vala:257
#: tools/main.vala:495
msgid "Write the system registry cache."
msgstr ""

#: tools/main.vala:259
#: tools/main.vala:497
msgid "Write the registry cache FILE."
msgstr ""

#: tools/main.vala:295
#: tools/main.vala:535
msgid ""
"Use engine schema paths instead of ibus core, which can be comma-separated "
"values."
msgstr ""

#: tools/main.vala:381
#: tools/main.vala:624
msgid "Resetting…"
msgstr ""

#: tools/main.vala:399
#: tools/main.vala:642
msgid "Done"
msgstr ""

#: tools/main.vala:444
#: tools/main.vala:691
msgid "Set or get engine"
msgstr ""

#: tools/main.vala:445
#: tools/main.vala:692
msgid "Exit ibus-daemon"
msgstr ""

#: tools/main.vala:446
#: tools/main.vala:693
msgid "Show available engines"
msgstr ""

#: tools/main.vala:447
#: tools/main.vala:694
msgid "(Not implemented)"
msgstr ""

#: tools/main.vala:448
#: tools/main.vala:695
msgid "Restart ibus-daemon"
msgstr ""

#: tools/main.vala:449
#: tools/main.vala:696
msgid "Start ibus-daemon"
msgstr ""

#: tools/main.vala:697
msgid "Show version"
msgstr ""

#: tools/main.vala:450
#: tools/main.vala:698
msgid "Show the content of registry cache"
msgstr ""

#: tools/main.vala:451
#: tools/main.vala:699
msgid "Create registry cache"
msgstr ""

#: tools/main.vala:452
#: tools/main.vala:700
msgid "Print the D-Bus address of ibus-daemon"
msgstr ""

#: tools/main.vala:453
#: tools/main.vala:701
msgid "Show the configuration values"
msgstr ""

#: tools/main.vala:454
#: tools/main.vala:702
msgid "Reset the configuration values"
msgstr ""

#: tools/main.vala:456
#: tools/main.vala:704
msgid "Save emoji on dialog to clipboard"
msgstr ""

#: tools/main.vala:458
#: tools/main.vala:706
msgid "Show this information"
msgstr ""

#: tools/main.vala:464
#: tools/main.vala:713
#, c-format
msgid ""
"Usage: %s COMMAND [OPTION...]\n"
"\n"
msgstr ""

#: tools/main.vala:465
#: tools/main.vala:714
msgid "Commands:\n"
msgstr ""

#: tools/main.vala:494
#: tools/main.vala:744
#, c-format
msgid "%s is unknown command!\n"
msgstr ""
Expand Down
3 changes: 2 additions & 1 deletion tools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2013 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -57,6 +57,7 @@ AM_LDADD = \
AM_VALAFLAGS = \
--vapidir=$(top_builddir)/bindings/vala \
--vapidir=$(top_srcdir)/bindings/vala \
--pkg=gio-2.0 \
--pkg=ibus-1.0 \
--pkg=posix \
--pkg=config \
Expand Down
30 changes: 25 additions & 5 deletions tools/ibus.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.\" Copyright (C) Takao Fujiwara <takao.fujiwara1@gmail.com>, 2013-2017.
.\" Copyright (c) Peng Huang <shawn.p.huang@gmail.com>, 2013.
.\"
.TH "IBUS" 1 "May 2017" "@VERSION@" "User Commands"
.TH "IBUS" 1 "Jul 2022" "@VERSION@" "User Commands"
.SH NAME
.B ibus
\- command line utility for ibus
Expand Down Expand Up @@ -45,13 +45,33 @@ Exit ibus-daemon.
\fBlist-engine\fR
Show ibus engines list.
.TP
\fBrestart\fR
Restart ibus-daemon.
\fBrestart\fR [\fB\-\-type=TYPE|\-\-verbose|\-\-help\fR]
Restart ibus-daemon. This command tries to restart ibus-daemon via systemd
firstly and directly secondary by default. If
.B \-\-type=systemd
is given, It tries to restart via systemd only. If
.B \-\-type=direct
is given, It tries to restart with an IBus API only. GNOME desktop runs
ibus-daemon via systemd and other desktops run ibus-daemon directly.
.TP
\fBstart\fR [\fB\-\-type=TYPE|\-\-verbose|\-\-help\fR]
Start ibus-daemon. This command tries to start ibus-daemon via systemd
firstly and directly secondary by default. If
.B \-\-type=systemd
is given, It tries to start as a background process via systemd only. If
.B \-\-type=direct
is given, It tries to start directly only as a foreground process and other
option arguments of ibus command are sent to ibus-daemon. E.g.
ibus start
.B \-\-type=direct
.B \-\-xim
&
GNOME desktop runs ibus-daemon via systemd and other desktops run ibus-daemon directly.
.TP
\fBversion\fR
Show the ibus version.
.TP
\fBread\-cache\fR [\fB\-\-system|\-\-file=FILE\fR]
\fBread\-cache\fR [\fB\-\-system|\-\-file=FILE|\-\-help\fR]
Show the content of the user registry cache if
.B \-\-system
is not given.
Expand All @@ -64,7 +84,7 @@ if
.B \-\-file=FILE
is given.
.TP
\fBwrite\-cache\fR [\fB\-\-system|\-\-file=FILE\fR]
\fBwrite\-cache\fR [\fB\-\-system|\-\-file=FILE|\-\-help\fR]
Save the user registry cache if
.B \-\-system
is not given.
Expand Down
Loading

0 comments on commit ab0d176

Please sign in to comment.