Página do Sadao Massago

Página do Linux

Linux (and GNOME) Tips.


using scim for desired/all locale
For all user
Change the link /etc/X11/xinit/xinput.d/all_ALL point to /etc/X11/xinit/xinput.d/scim
#sudo ln -sf /etc/X11/xinit/xinput.d/scim /etc/X11/xinit/xinput.d/all_ALL
To return as default, change link to /etc/X11/xinit/xinput.d/default
#sudo ln -sf /etc/X11/xinit/xinput.d/default /etc/X11/xinit/xinput.d/all_ALL
If desire to apply only when login as specific locale, create file or link with name same of deisred locale. For example, to use scim on en_US locale
#sudo ln -s /etc/X11/xinit/xinput.d/scim /etc/X11/xinit/xinput.d/scim/en_US
The locale without setup are used the all_ALL

per user
Same as all user case, copy the config file (or create link) inside .xinput.d folder os user home directory. Recomend to copy instead of link in way to edit and customize.
#mkdir ~/.xinput.d
#cp /etc/X11/xinit/xinput.d/scim ~/.xinput.d/all_ALL
or
#cp /etc/X11/xinit/xinput.d/scim ~/.xinput.d/en_US

per user scim setup
In way to activate/desactivate input method, click on right button on scim icon (on task bar) and select SCIM Setup. On IME Engine->Global Setup, check/uncheck desired input method. The input method are selected, clicking left button on scim icon.

Note: <ctrl><space> enable/disable scim (change IME).

BUG and solution
BUG: can not rename files in nautilus. Sometimes, the imput method on nautilus will changed to xim and loss commutication with scim. Thus, can not type in rename field.
SOLUTION: right click on rename field and select imput method->scim.

To produce accented character on english keyboard
If is not accentuate the character, the keyboard layout is incorrect. Use international layout of keyboard. Edit the file /etc/X11/xorg.conf
#sudo gedit /etc/X11/xorg.conf
and on

 Section "InputDevice"
          Identifier "Generic Keyboard"
 ...

add Option XkbVariant as intl or alt-intl The section becames like this

,----[ /etc/shadow ]------
| ...
| Section "InputDevice"
|
|     Identifier "Generic Keyboard"
|     Driver "kbd"
|     Option "CoreKeyboard"
|     Option "XkbRules" "xorg"
|     Option "XkbModel" "pc105"
|     Option "XkbLayout" "us"
|     Option "XkbVariant" "intl"
| EndSection
| ...
 `----

The above change will be maded using command line setxkbmap
#sudo setxkbmap us -variant intl
or
#sudo setxkbmap us -variant alt-intl
Note that, in gnome, will set keyboard layout per user using system->preference->keyboard

using cedilla on english keybord/environment
On the English keyboard with intl variant, the cedilla are produced by <alt>"," and <shift><alt> "," and on alt-intl variant, are produced by <alt>","+"c" and <alt>","+"C".
The "´"+"c" and "´"+"C" produce accentuated c instead of cedilla. In way to produce cedilla using "´"+"c" and "´"+"C", need to change compositing rule used by X

for all user
=> GNOME desktop only The GNOME use their own imput method as default and will change easy. Editing the file
#sudo gedit /usr/lib/gtk-2.0/2.10.0/immodule-files.d/libgtk2.0-0.immodules
Add location for desired im modules
Ex.: to use Cedilla in english, add, "en" on cedilla

=> All Desktop case In way to change for all desktop (KDE/XFCE), need to change xim compose rule. The xim composite rule for each locale are stored in /usr/share/X11/locale/ Select desired locale, backup and change as desired. For example, to eu_US.UTF-8 act as pt_BR-UTF-8 (for cedilla),

#sudo cp /usr/share/X11/locale/en_US.UTF-8/Compose /usr/share/X11/locale/en_US.UTF-8/Compose.backup
#sudo gedit /usr/share/X11/locale/en_US.UTF-8/Compose

and locate the line
<dead_acute><C> :  "Ć" U0106 # LATIN CAPITAL LETTER C WITH ACUTE
and replace with (or comment and insert)
<dead_acute> <C> :  "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
Locate the line
<dead_acute> <c> : "ć" U0107 # LATIN SMALL LETTER C WITH ACUTE
and replace with (or comment and insert)
<dead_acute> <c> : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA

Copy the setup file /etc/X11/xinit/xinput.d/default as /etc/X11/xinit/xinput.d/xim and set the input method for GNOME and KDE as xim
#sudo cp /etc/X11/xinit/xinput.d/default /etc/X11/xinit/xinput.d/xim
#sudo gedit /etc/X11/xinit/xinput.d/xim

 ,----[ /etc/X11/xinit/xinput.d/xim ]---
| ...
| GTK_IM_MODULE=xim
| QT_IM_MODULE=xim
| ...
 `----

If GNOME one are configured as above (GNOME desktop only), will keep GTK_IM_MODULE as blank to continue using GNOME default one. Create link for all_ALL and/or desired locale
#sudo ln -sf /etc/X11/xinit/xinput.d/xim /etc/X11/xinit/xinput.d/all_ALL
or
#sudo ln -s /etc/X11/xinit/xinput.d/xim /etc/X11/xinit/xinput.d/scim/en_US

Per user
a. Adjust xim compose rule Copy apropriate compose rule from /usr/share/X11/locale/ to .XCompose on home folder. For example, to use cedilla as above, copy pt_BR.UTF-8 one
#cp /usr/share/X11/locale/pt_BR.UTF-8/Compose ~/.XCompose

b. Set xim as default input method copy xinput method file file and and set GTK_IM_MODULE and QT_IM_MODULE as xim
#mkdir ~/.xinput.d
#cp /etc/X11/xinit/xinput.d/default ~/.xinput.d/all_ALL
#gedit ~/.xinput.d/all_ALL
 ,----[ ~/.xinput.d/all_ALL ]---
| ...
| GTK_IM_MODULE=xim
| QT_IM_MODULE=xim
| ...
 `----

for scim user
Note that if are using scim as default input method, the English/European does not affected by above change and continue producing accentuated c for "'"+"c". Need to use <alt>"," and <alt><shift>"," for cedilla. If select X Input Method from right click->input method on text field of GNOME apps, change to xim, but behavior is the same. I don't know how to solve it. Note: the <cntrl><space> enable/disable scim for fast ime switch.

On GDM
The change of xim composite table does not affect input method used by gdm. gdm use GNOME ones.
Question:
1. will change GTK immodules setup for desired user only?
2. Will change composite rule for scim (English/European)?

activate delete on nautilus
on nautilus, edit->preferences,
[behaviour]
Garbage bin
   [v] include a Delete command that bypasses Garbage Bin

printer administrator
In way to change printer setup using system->Administration->printing the user need the part of lpadmin group On system->Administration->users and Groups Click on [Manage Groups] and on lpadmin, click on [properties] On [group members], check desired user.

The advanced user will activate user as group member, direct editing the file /etc/group as root. Made it carefully.
#sudo gedit /etc/group
In way to super becames printer administrator, the line of lpadmin became like

 ,----[ /etc/group ]-----
| ...
| lpadmin:x:108:guest
| ...
 `----

Misc Notes
Nome misc tips.
Fast copy/paste
<middle button> or <left><right> button on mouse excute copy/past of selected text on cursor position. Very usefull to copy text from one app to other, such as command on text editor to terminal.
Direct delete on nautilus
To delete files (does not move to trash), use <shift><del> as in windows.
Show hidden files
Fast way to show/hide hidden files on nautilus, use <ctrl>H.
GNOME register
For gnome config, use gconf-editor
#gconf-editor
script for all users
Note: The script /etc/profile are executed by all users