Sync from SUSE:SLFO:Main x11-tools revision f3ddce1333569187c068d5e22afe1ec7
This commit is contained in:
commit
e7e8762e03
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
## Default LFS
|
||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
16
i18n.template
Normal file
16
i18n.template
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#
|
||||||
|
# Override system wide input method here
|
||||||
|
#
|
||||||
|
|
||||||
|
# export INPUT_METHOD=scim
|
||||||
|
|
||||||
|
# Most applications support several languages for their output.
|
||||||
|
# To make use of this feature, simply uncomment one of the lines below or
|
||||||
|
# add your own one (see /usr/share/locale/locale.alias for more codes)
|
||||||
|
# This overwrites the system default set in /etc/sysconfig/language
|
||||||
|
# in the variable RC_LANG.
|
||||||
|
#
|
||||||
|
#export LANG=de_DE.UTF-8 # uncomment this line for German output
|
||||||
|
#export LANG=fr_FR.UTF-8 # uncomment this line for French output
|
||||||
|
#export LANG=es_ES.UTF-8 # uncomment this line for Spanish output
|
||||||
|
|
40
none
Normal file
40
none
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
echo "Dummy input method \"none\" (do not use any fancy input method by default)"
|
||||||
|
|
||||||
|
# set XMODIFIERS="@im=local".
|
||||||
|
# "@im=local" means "use compose and dead-keys" and
|
||||||
|
# some programs will use compose and dead-keys only if XMODIFIERS
|
||||||
|
# is set to either "@im=local" or "@im=none".
|
||||||
|
|
||||||
|
export XMODIFIERS="@im=local" # use "Compose"
|
||||||
|
|
||||||
|
# Input of German umlauts in acroread doesn’t work if GTK_IM_MODULE is
|
||||||
|
# unset. Make sure that it is set here.
|
||||||
|
#
|
||||||
|
# Setting it to "xim" is a reasonable setting together with
|
||||||
|
# XMODIFIERS="@im=local" because Compose support then works exactly
|
||||||
|
# as defined in the X11 Compose file.
|
||||||
|
#
|
||||||
|
# But this still causes problems when saving files
|
||||||
|
# with non-ASCII characters in the file name from acroread 8.x because
|
||||||
|
# xim support in acroread 8.x is very buggy
|
||||||
|
# (see http://bugzilla.novell.com/show_bug.cgi?id=370330)
|
||||||
|
#
|
||||||
|
# Apart from problems in acroread, xim is generally
|
||||||
|
# known to be quite buggy. Therefore a better choice is probably
|
||||||
|
# GTK_IM_MODULE=cedilla. This changes 6 Compose key sequences to
|
||||||
|
# produce U+00C7 (LATIN CAPITAL LETTER C WITH CEDILLA) and
|
||||||
|
# LATIN_SMALL_LETTER_C_WITH_CEDILLA which produce
|
||||||
|
# U+00E7 (LATIN SMALL LETTER C WITH CEDILLA) instead of
|
||||||
|
# U+0106 (LATIN CAPITAL LETTER C WITH ACUTE) and
|
||||||
|
# U+0107 (LATIN SMALL LETTER C WITH ACUTE).
|
||||||
|
# Most users won’t notice that small change, and for those who do notice
|
||||||
|
# it is probably even useful.
|
||||||
|
# For details see http://bugzilla.novell.com/show_bug.cgi?id=413879#c27
|
||||||
|
|
||||||
|
export GTK_IM_MODULE=cedilla
|
||||||
|
|
||||||
|
export QT_IM_MODULE=xim # to make Compose work as expected in Qt
|
||||||
|
#export QT_IM_SWITCHER=imsw-none # disable input method switching in Qt
|
||||||
|
export QT_IM_SWITCHER=imsw-multi # enable input method switching in Qt
|
||||||
|
|
||||||
|
return 0
|
3
nvidia-post-uninstall
Normal file
3
nvidia-post-uninstall
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
rm /etc/modprobe.d/nvidia.conf
|
4
nvidia-pre-install
Normal file
4
nvidia-pre-install
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "blacklist nouveau" > /etc/modprobe.d/nvidia.conf
|
||||||
|
|
16
sysconfig.language-x11-tools
Normal file
16
sysconfig.language-x11-tools
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
## Path: System/Environment/Language
|
||||||
|
## Type: string(ibus,fcitx,gcin,scim,scim-bridge,uim,kinput2,kinput2-canna,kinput2-wnn,nabi,wnn,atokx,xcin,none)
|
||||||
|
## Default: ""
|
||||||
|
#
|
||||||
|
# A default input method to be used in X11 can be selected here.
|
||||||
|
# If this variable is set and a script with the same name
|
||||||
|
# as the value of this variable exists in the directory /etc/X11/xim.d/
|
||||||
|
# this script is sourced when X11 is started to start an input method.
|
||||||
|
#
|
||||||
|
# The special value "none" (/etc/X11/xim.d/none) means:
|
||||||
|
# Do not use any input method at all.
|
||||||
|
#
|
||||||
|
# For more details see the comments at the top of /etc/X11/xim.
|
||||||
|
#
|
||||||
|
INPUT_METHOD=""
|
1609
x11-tools.changes
Normal file
1609
x11-tools.changes
Normal file
File diff suppressed because it is too large
Load Diff
103
x11-tools.spec
Normal file
103
x11-tools.spec
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
#
|
||||||
|
# spec file for package x11-tools
|
||||||
|
#
|
||||||
|
# Copyright (c) 2022 SUSE LLC
|
||||||
|
#
|
||||||
|
# All modifications and additions to the file contributed by third parties
|
||||||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
# upon. The license for this file, and modifications and additions to the
|
||||||
|
# file, is the same license as for the pristine package itself (unless the
|
||||||
|
# license for the pristine package is not an Open Source License, in which
|
||||||
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
||||||
|
%if ! %{defined _fillupdir}
|
||||||
|
%define _fillupdir /var/adm/fillup-templates
|
||||||
|
%endif
|
||||||
|
|
||||||
|
Name: x11-tools
|
||||||
|
Requires(post): %fillup_prereq
|
||||||
|
Provides: 3ddiag
|
||||||
|
Provides: xf86tools
|
||||||
|
Obsoletes: 3ddiag
|
||||||
|
Obsoletes: xf86tools
|
||||||
|
Version: 0.1
|
||||||
|
Release: 0
|
||||||
|
Summary: Tools for the X Window System
|
||||||
|
License: GPL-2.0-or-later AND MIT
|
||||||
|
Group: System/X11/Utilities
|
||||||
|
Source2: xf86debug
|
||||||
|
Source31: xim
|
||||||
|
Source32: xim.template
|
||||||
|
Source33: none
|
||||||
|
Source34: sysconfig.language-%{name}
|
||||||
|
Source35: nvidia-pre-install
|
||||||
|
Source36: nvidia-post-uninstall
|
||||||
|
Source37: i18n.template
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description
|
||||||
|
Some useful tools for the X Window System.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
|
||||||
|
%build
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}/usr/bin/
|
||||||
|
install -m 755 %{_sourcedir}/xf86debug %{buildroot}/usr/bin
|
||||||
|
%if 0%{?suse_version} >= 1550
|
||||||
|
mkdir -p %{buildroot}/usr/etc/skel
|
||||||
|
install -m 644 %{_sourcedir}/xim.template %{buildroot}/usr/etc/skel/.xim.template
|
||||||
|
install -m 644 %{S:37} %{buildroot}/usr/etc/skel/.i18n
|
||||||
|
mkdir -p %{buildroot}/%{_distconfdir}/X11/xim.d
|
||||||
|
install -m 644 %{_sourcedir}/xim %{buildroot}/%{_distconfdir}/X11
|
||||||
|
install -m 644 %{_sourcedir}/none %{buildroot}/%{_distconfdir}/X11/xim.d
|
||||||
|
%else
|
||||||
|
mkdir -p %{buildroot}/etc/skel
|
||||||
|
install -m 644 %{_sourcedir}/xim.template %{buildroot}/etc/skel/.xim.template
|
||||||
|
install -m 644 %{S:37} %{buildroot}/etc/skel/.i18n
|
||||||
|
mkdir -p %{buildroot}/etc/X11/xim.d
|
||||||
|
install -m 644 %{_sourcedir}/xim %{buildroot}/etc/X11
|
||||||
|
install -m 644 %{_sourcedir}/none %{buildroot}/etc/X11/xim.d
|
||||||
|
%endif
|
||||||
|
mkdir -p %{buildroot}/%{_fillupdir}/
|
||||||
|
install -c -m 644 %{_sourcedir}/sysconfig.language-%{name} %{buildroot}/%{_fillupdir}/
|
||||||
|
mkdir -p %{buildroot}/usr/lib/nvidia
|
||||||
|
install -m 755 %{_sourcedir}/nvidia-pre-install \
|
||||||
|
%{buildroot}/usr/lib/nvidia/pre-install
|
||||||
|
install -m 755 %{_sourcedir}/nvidia-post-uninstall \
|
||||||
|
%{buildroot}/usr/lib/nvidia/post-uninstall
|
||||||
|
|
||||||
|
%post
|
||||||
|
%{fillup_only -an language}
|
||||||
|
|
||||||
|
%files
|
||||||
|
%dir /usr/lib/nvidia
|
||||||
|
/usr/bin/xf86debug
|
||||||
|
/usr/lib/nvidia/pre-install
|
||||||
|
/usr/lib/nvidia/post-uninstall
|
||||||
|
%if 0%{?suse_version} >= 1550
|
||||||
|
%dir /usr/etc/skel
|
||||||
|
/usr/etc/skel/.i18n
|
||||||
|
/usr/etc/skel/.xim.template
|
||||||
|
%{_distconfdir}/X11
|
||||||
|
%{_distconfdir}/X11/xim
|
||||||
|
%dir %{_distconfdir}/X11/xim.d
|
||||||
|
%{_distconfdir}/X11/xim.d/*
|
||||||
|
%else
|
||||||
|
/etc/skel/.i18n
|
||||||
|
/etc/skel/.xim.template
|
||||||
|
/etc/X11/xim
|
||||||
|
%dir /etc/X11/xim.d
|
||||||
|
/etc/X11/xim.d/*
|
||||||
|
%endif
|
||||||
|
%{_fillupdir}/sysconfig.language-%{name}
|
||||||
|
|
||||||
|
%changelog
|
49
xf86debug
Normal file
49
xf86debug
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "`id -u`" != "0" ]; then
|
||||||
|
echo "You must be root to use this program!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! test -x /usr/bin/gdb; then
|
||||||
|
echo "gdb (package gdb, series d) must be installed before running this program!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# It is recommended to also have installed the following debuginfo packages:
|
||||||
|
# freetype2-debuginfo
|
||||||
|
# xorg-x11-libXau-debuginfo
|
||||||
|
# xorg-x11-libXdmcp-debuginfo
|
||||||
|
# xorg-x11-fontenc-debuginfo
|
||||||
|
# xorg-x11-libs-debuginfo
|
||||||
|
# xorg-x11-driver-video-debuginfo
|
||||||
|
# xorg-x11-driver-input-debuginfo
|
||||||
|
# xorg-x11-server-debuginfo
|
||||||
|
|
||||||
|
tmpfile=`mktemp /tmp/xf86debug.XXXXXXXXXX`
|
||||||
|
|
||||||
|
# generate core file
|
||||||
|
ulimit -c unlimited
|
||||||
|
corefile=`mktemp /tmp/core.Xorg.XXXXXXXXXX`
|
||||||
|
|
||||||
|
echo -n "Starting X Server in Debugger ... "
|
||||||
|
gdb <<EOF > $tmpfile 2>&1
|
||||||
|
file /usr/bin/Xorg
|
||||||
|
set args ${1+"$@"}
|
||||||
|
handle SIGUSR1 nostop
|
||||||
|
handle SIGUSR2 nostop
|
||||||
|
handle SIGPIPE nostop
|
||||||
|
run
|
||||||
|
generate-core-file $corefile
|
||||||
|
bt full
|
||||||
|
cont
|
||||||
|
quit
|
||||||
|
EOF
|
||||||
|
echo "done"
|
||||||
|
|
||||||
|
echo "Debugger output written to $tmpfile."
|
||||||
|
if [ -s $corefile ]; then
|
||||||
|
echo "Core file written to $corefile."
|
||||||
|
else
|
||||||
|
rm $corefile
|
||||||
|
fi
|
251
xim
Normal file
251
xim
Normal file
@ -0,0 +1,251 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# $Id: xim,v 1.28 2004/12/07 11:04:59 mfabian Exp $
|
||||||
|
#
|
||||||
|
# Copyright © 2001 SUSE LINUX GmbH Nuernberg, Germany
|
||||||
|
#
|
||||||
|
# Mike Fabian <mfabian@suse.de>, 2000, 2001, 2002, 2004, 2005, 2006, 2007
|
||||||
|
# Werner Fink <werner@suse.de>, 2007
|
||||||
|
#
|
||||||
|
# This program comes with ABSOLUTELY NO WARRANTY; it may be copied or modified
|
||||||
|
# under the terms of the GNU General Public License version 2 as published by
|
||||||
|
# the Free Software Foundation.
|
||||||
|
|
||||||
|
|
||||||
|
# usually, {/usr,}/etc/X11/xim is used to start a default input method.
|
||||||
|
|
||||||
|
# If want to change the default, you have the following options:
|
||||||
|
#
|
||||||
|
# 1) Set the variable INPUT_METHOD in /etc/sysconfig/language.
|
||||||
|
# For example:
|
||||||
|
# INPUT_METHOD="scim"
|
||||||
|
# This changes the default for all users
|
||||||
|
# 2) set and export the variable "INPUT_METHOD" in ~/.i18n in the
|
||||||
|
# home directory of a user.
|
||||||
|
# For example:
|
||||||
|
# export INPUT_METHOD="scim"
|
||||||
|
# This changes the default only for one user.
|
||||||
|
#
|
||||||
|
# The possible values for the variable INPUT_METHOD are the names
|
||||||
|
# of the scripts which exist in the directory {/usr,}/etc/X11/xim.d/
|
||||||
|
# for example if a script {/usr,}/etc/X11/xim.d/scim exists,
|
||||||
|
# and INPUT_METHOD is set to "scim", this script will be tried first
|
||||||
|
# to start an input method and only if this fails other input methods
|
||||||
|
# will be tried.
|
||||||
|
#
|
||||||
|
# 3) If you don't like the behaviour of any of the available
|
||||||
|
# scripts in {/usr,}/etc/X11/xim.d, you can write your own script
|
||||||
|
# containing the necessary lines to start your preferred input
|
||||||
|
# method and save it as ~/.xim. If a file ~/.xim exists, only
|
||||||
|
# this file is sourced to start an input method and nothing
|
||||||
|
# else.
|
||||||
|
# Usually you need only a few lines, the systemwide
|
||||||
|
# file to start an input method, {/usr,}/etc/X11/xim, is only so
|
||||||
|
# complicated because it tries to find a nice default depending
|
||||||
|
# on the language and the installed input methods.
|
||||||
|
#
|
||||||
|
# For example, if you want to use "scim" as your input method,
|
||||||
|
# it is enough to have the following 5 lines (and nothing else)
|
||||||
|
# in your ~/.xim file:
|
||||||
|
|
||||||
|
# export XMODIFIERS="@im=SCIM"
|
||||||
|
# export GTK_IM_MODULE=scim
|
||||||
|
# export QT_IM_SWITCHER=imsw-multi
|
||||||
|
# export QT_IM_MODULE=scim
|
||||||
|
# scim -d
|
||||||
|
|
||||||
|
echo "$0: Checking whether an input method should be started."
|
||||||
|
|
||||||
|
#
|
||||||
|
# Get variables from the user environment which might influence the start
|
||||||
|
# of an input method (see bug #235044, written by Werner Fink <werner@suse.de>):
|
||||||
|
#
|
||||||
|
|
||||||
|
adduserenv () {
|
||||||
|
local cur var=${1+"$@"}
|
||||||
|
: ${HOSTNAME:=$(hostname)}
|
||||||
|
# Use ~/.i18n
|
||||||
|
if test -e "$HOME/.i18n"; then
|
||||||
|
echo "$0: Checking whether an input method is specified in $HOME/.i18n."
|
||||||
|
eval $(set +u +e
|
||||||
|
if [ -r /etc/profile.d/lang.sh ]; then
|
||||||
|
. /etc/profile.d/lang.sh < /dev/null > /dev/null 2>&1
|
||||||
|
elif [ -r /usr/etc/profile.d/lang.sh ]; then
|
||||||
|
. /usr/etc/profile.d/lang.sh < /dev/null > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
for cur in $var; do
|
||||||
|
test -n "${!cur}" && echo export $cur=${!cur}
|
||||||
|
done)
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
# Fall back to ~/.profile or ~/.login
|
||||||
|
case "$SHELL" in
|
||||||
|
*/sh|*/ash|*/bash|*/ksh|*/mksh|*/pdksh|*/zsh)
|
||||||
|
if test -s "$HOME/.profile" ; then
|
||||||
|
echo "$0: Checking whether an input method is specified in $HOME/.profile."
|
||||||
|
eval $(export HOSTNAME
|
||||||
|
(echo . "'$HOME/.profile' < /dev/null > /dev/null 2>&1"
|
||||||
|
echo "set +u +e"
|
||||||
|
for cur in $var; do
|
||||||
|
echo echo \${$cur+"$cur=\$$cur;"}
|
||||||
|
done
|
||||||
|
echo echo export $var) | $SHELL)
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*/csh|*/tcsh)
|
||||||
|
if test -s "$HOME/.login" ; then
|
||||||
|
echo "$0: Checking whether an input method is specified in $HOME/.login."
|
||||||
|
eval $(export HOSTNAME
|
||||||
|
(echo onintr -
|
||||||
|
echo source "'$HOME/.login' < /dev/null >& /dev/null"
|
||||||
|
echo unset verbose
|
||||||
|
for cur in $var; do
|
||||||
|
echo if \( \${?$cur} \) echo $cur=\`printenv $cur\`
|
||||||
|
done
|
||||||
|
echo echo export $var) | $SHELL)
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# workaround for bnc#853063
|
||||||
|
# activate/deactivate g-s-d keyboard plugin depending on IM
|
||||||
|
gnome_ibus_workaround () {
|
||||||
|
local im=$1
|
||||||
|
im=${im##*/}
|
||||||
|
im=${im#[0-9][0-9]-}
|
||||||
|
test "$im" = "none" && return
|
||||||
|
windowmanager=${WINDOWMANAGER##*/}
|
||||||
|
windowmanager=${windowmanager%-*}
|
||||||
|
if [ "$windowmanager" = "gnome" ]; then
|
||||||
|
local active
|
||||||
|
if [ "$im" = "ibus" ]; then
|
||||||
|
active=true
|
||||||
|
else
|
||||||
|
active=false
|
||||||
|
fi
|
||||||
|
gsettings set org.gnome.settings-daemon.plugins.keyboard active $active
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# if gdm passes the language to Xsession, we should not override this
|
||||||
|
# see http://bugzilla.novell.com/show_bug.cgi?id=440371
|
||||||
|
# The test for $GDM_LANG needs to be changed slightly as soon as other
|
||||||
|
# displaymanager also pass a second argument to Xsession.
|
||||||
|
if test -n "$GDM_LANG" ; then
|
||||||
|
echo "$0: use GDM_LANG=$GDM_LANG"
|
||||||
|
adduserenv INPUT_METHOD
|
||||||
|
else
|
||||||
|
adduserenv LANG LC_CTYPE LC_ALL INPUT_METHOD
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if INPUT_METHOD is already set to something non-empty here, the user should
|
||||||
|
# set it in ~/.i18n or in ~/.profile or ~/.login or on the command line before
|
||||||
|
# using startx. In that case, don't read the system wide default from
|
||||||
|
# /etc/sysconfig/language, use the user supplied value instead:
|
||||||
|
if [ -z "$INPUT_METHOD" ] ; then
|
||||||
|
echo "sourcing /etc/sysconfig/language to get the value of INPUT_METHOD"
|
||||||
|
. /etc/sysconfig/language
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$INPUT_METHOD" != "" ]; then
|
||||||
|
echo "INPUT_METHOD is set to $INPUT_METHOD."
|
||||||
|
echo "Trying to start this user selected input method first ..."
|
||||||
|
if [ -r "/etc/X11/xim.d/$INPUT_METHOD" ] ; then
|
||||||
|
echo "sourcing /etc/X11/xim.d/$INPUT_METHOD"
|
||||||
|
. /etc/X11/xim.d/$INPUT_METHOD
|
||||||
|
if [ "$?" = "0" ]; then
|
||||||
|
echo "Start of $INPUT_METHOD succeeded."
|
||||||
|
gnome_ibus_workaround $INPUT_METHOD
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
echo "Start of $INPUT_METHOD failed."
|
||||||
|
fi
|
||||||
|
elif [ -r "/usr/etc/X11/xim.d/$INPUT_METHOD" ] ; then
|
||||||
|
echo "sourcing /usr/etc/X11/xim.d/$INPUT_METHOD"
|
||||||
|
. /usr/etc/X11/xim.d/$INPUT_METHOD
|
||||||
|
if [ "$?" = "0" ]; then
|
||||||
|
echo "Start of $INPUT_METHOD succeeded."
|
||||||
|
gnome_ibus_workaround $INPUT_METHOD
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
echo "Start of $INPUT_METHOD failed."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "{/usr,}/etc/X11/xim.d/$INPUT_METHOD does not exist."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "INPUT_METHOD is not set or empty (no user selected input method)."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Determine the LC_CTYPE locale category setting
|
||||||
|
tmplang=${LC_ALL-${LC_CTYPE-${LANG-en_US}}}
|
||||||
|
|
||||||
|
echo "Trying to start a default input method for the locale $tmplang ..."
|
||||||
|
|
||||||
|
subdirlist=$tmplang
|
||||||
|
while [ "$tmplang" != "${tmplang%[_.@]*}" ]
|
||||||
|
do
|
||||||
|
tmplang=${tmplang%[_.@]*}
|
||||||
|
subdirlist="$subdirlist $tmplang"
|
||||||
|
done
|
||||||
|
|
||||||
|
im_failed=0
|
||||||
|
|
||||||
|
for subdir in $subdirlist ; do
|
||||||
|
if [ -d /etc/X11/xim.d/$subdir ] ; then
|
||||||
|
echo "Checking for a default input method in /etc/X11/xim.d/$subdir/"
|
||||||
|
for im in /etc/X11/xim.d/$subdir/* ; do
|
||||||
|
if [ -r $im ] ; then
|
||||||
|
echo "sourcing $im ..."
|
||||||
|
. $im
|
||||||
|
if [ "$?" = "0" ]; then
|
||||||
|
echo "$im started sucessfully"
|
||||||
|
gnome_ibus_workaround $im
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "$im failed"
|
||||||
|
im_failed=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for subdir in $subdirlist ; do
|
||||||
|
if [ -d /usr/etc/X11/xim.d/$subdir ] ; then
|
||||||
|
echo "Checking for a default input method in /usr/etc/X11/xim.d/$subdir/"
|
||||||
|
for im in /usr/etc/X11/xim.d/$subdir/* ; do
|
||||||
|
if [ -r $im ] ; then
|
||||||
|
echo "sourcing $im ..."
|
||||||
|
. $im
|
||||||
|
if [ "$?" = "0" ]; then
|
||||||
|
echo "$im started sucessfully"
|
||||||
|
gnome_ibus_workaround $im
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "$im failed"
|
||||||
|
im_failed=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$im_failed" = 0 ] ; then
|
||||||
|
echo "There is no default input method for the current locale."
|
||||||
|
else
|
||||||
|
echo "All default input methods tried for the current locale failed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If there is no default input method for the current locale, source
|
||||||
|
# the dummy input method "none" to get reasonable default settings
|
||||||
|
# of the relevant environment variables:
|
||||||
|
|
||||||
|
if [ -r /etc/X11/xim.d/none ]; then
|
||||||
|
. /etc/X11/xim.d/none
|
||||||
|
elif [ -r /usr/etc/X11/xim.d/none ]; then
|
||||||
|
. /usr/etc/X11/xim.d/none
|
||||||
|
fi
|
||||||
|
|
48
xim.template
Normal file
48
xim.template
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright © 2001 SUSE LINUX GmbH Nuernberg, Germany
|
||||||
|
#
|
||||||
|
# Mike Fabian <mfabian@suse.de>, 2005
|
||||||
|
# Egbert Eich <eich@suse.com>, 2015
|
||||||
|
|
||||||
|
# usually, /etc/X11/xim is used to start a default input method.
|
||||||
|
|
||||||
|
# If want to change the default, you have the following options:
|
||||||
|
#
|
||||||
|
# 1) Set the variable INPUT_METHOD in /etc/sysconfig/language.
|
||||||
|
# For example:
|
||||||
|
# INPUT_METHOD="scim"
|
||||||
|
# This changes the default for all users
|
||||||
|
# 2) set and export the variable "INPUT_METHOD" in ~/.i18n in the
|
||||||
|
# home directory of a user.
|
||||||
|
# For example:
|
||||||
|
# export INPUT_METHOD="scim"
|
||||||
|
# This changes the default only for one user.
|
||||||
|
#
|
||||||
|
# The possible values for the variable INPUT_METHOD are the names
|
||||||
|
# of the scripts which exist in the directory /etc/X11/xim.d/
|
||||||
|
# for example if a script /etc/X11/xim.d/scim exists,
|
||||||
|
# and INPUT_METHOD is set to "scim", this script will be tried first
|
||||||
|
# to start an input method and only if this fails other input methods
|
||||||
|
# will be tried.
|
||||||
|
#
|
||||||
|
# 3) If you don't like the behaviour of any of the available
|
||||||
|
# scripts in /etc/X11/xim.d, you can write your own script
|
||||||
|
# containing the necessary lines to start your preferred input
|
||||||
|
# method and save it as ~/.xim. If a file ~/.xim exists, only
|
||||||
|
# this file is sourced to start an input method and nothing
|
||||||
|
# else.
|
||||||
|
# Usually you need only a few lines, the systemwide
|
||||||
|
# file to start an input method, /etc/X11/xim, is only so
|
||||||
|
# complicated because it tries to find a nice default depending
|
||||||
|
# on the language and the installed input methods.
|
||||||
|
#
|
||||||
|
# For example, if you want to use "scim" as your input method,
|
||||||
|
# it is enough to have the following 5 lines (and nothing else)
|
||||||
|
# in your ~/.xim file:
|
||||||
|
|
||||||
|
# export XMODIFIERS="@im=SCIM"
|
||||||
|
# export GTK_IM_MODULE=scim
|
||||||
|
# export QT_IM_SWITCHER=imsw-multi
|
||||||
|
# export QT_IM_MODULE=scim
|
||||||
|
# scim -d
|
Loading…
x
Reference in New Issue
Block a user