X window tweaks
Remap CapsLock as Ctrl
There are three alternatives:
- Edit (or create)
.Xkbmap file in the home directory adding -option ctrl:nocaps line
- Execute
$ setxkbmap -option "ctrl:nocaps"
- Edit
/etc/X11/xorg.conf, adding a line Option "XkbOptions" "ctrl:nocaps" in "InputDevice" keyboard section
Option 3 is system wide. 1 and 3 are presistent.
Tweaking VGA sync timing parameter
Normally X will autodetect supported screen resolutions and appropriate VGA timing information. This information doesn't appear in
xorg.conf, but you can retrieve them by examining
/var/log/Xorg.0.log. (Standard VGA/VESA signal timing can be found
here).
(**) RADEON(0): *Driver mode "1680x1050": 146.2 MHz, 65.3 kHz, 60.0 Hz
(II) RADEON(0): Modeline "1680x1050" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 +hsync -vsync
Alternatively you can get standard VESA timing modes using
cvt command:
$ cvt 1680 1050
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
$
Based on this info, edit
xorg.conf adding following lines:
Section "Modes"
Identifier "dell1680x1050"
Mode "1680x1050-standard"
DotClock 146.25
HTimings 1680 1784 1960 2240
VTimings 1050 1053 1059 1089
Flags "+HSync" "-VSync"
EndMode
EndSection
Continue editing
xorg.conf to add a line
UseModes "dell1680x1050"
in
Section "Monitor".
Change
HTimings or
VTimings values to tweak the position. Consult man page of
xorg.conf for explanation. Probably 'hsyncstart' and 'htotal' are the variables that you want to adjust.
xorg.conf configuration
As root, execute
Xorg :1 -configure. This will probe hardware and drop both a new config in
/root/xorg.conf.new and the log in
/var/log/Xorg.1.log
Multiple, concurrent gnome display sessions
Edit
/etc/X11/gdm/gdm.conf, or
/etc/gdm/custom.conf if distro is RHEL 5, or
/etc/gdm/gdm.conf-custom if ubuntu.
Under
[servers] section, add following entries:
1=/usr/bin/X vt8
0=/usr/bin/X vt7
This will enable two concurrent GUI consoles that can be selected via ctrl+alt+F7 and ctrl+alt+F8. If you're using VMware, ctrl+alt is reserved. To send ctrl+alt to the guest, press and release space bar while pressing ctrl+alt.
X commands, files, and keyboard shortcuts
Commands:
-
xrandr : Resize screen resolution plus many more tricks. $ xrandr shows available modes. $ xrandr -s 1680x1050 to change mode.
-
xdpyinfo : Displays information about an X server
-
xwininfo : Displays window information
-
gdmsetup : gdm setup GUI
-
startx : Starts X session. A front end script for xinit
-
xprop : dump property of a window ($ xprop -display :0 and click on a window)
-
xvinfo :
Files:
-
/etc/X11/xorg.conf : Main configuration file.
-
/var/log/Xorg.0.log : X log file.
-
/etc/gdm/custom.conf : gdm configuration file (RHEL5)
Keyboard Shortcuts:
- ctrl+alt+backspace : kill and restart X session
- ctrl+alt+plus : switch to next display mode
- ctrl+alt+minus : switch to previous display mode
Terminal keyboard shortcut
Applies to both of gnome-terminal and Xfce's Terminal
- ctrl+shift+N : new window
- ctrl+shift+T : new tab
- ctrl+shift+W : close tab
- ctrl+PageUp : previous tab
- ctrl+PageDn : next tab
Use right shift because ctrl+left shift triggers IME.
Terminal color setting
For gnome-terminal, edit
.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml:
<entry name="palette" mtime="1245203166" type="string">
<stringvalue>#000000000000:#CDCB00000000:#0000CDCB0000:#CDCBCDCB0000:#1E1A908FFFFF:#CDCB0000CDCB:#0000CDCBCDCB:#E5E2E5E2E5E2:#4CCC4CCC4CCC:#FFFF00000000:#0000FFFF0000:#FFFFFFFF0000:#46458281B4AE:#FFFF0000FFFF:#0000FFFFFFFF:#FFFFFFFFFFFF</stringvalue>
</entry>
For Xfce's Terminal, edit
.config/Terminal/terminalrc:
ColorForeground=#ffffffffffff
ColorBackground=Black
ColorCursor=#0000ffff0000
ColorSelection=White
ColorSelectionUseDefault=TRUE
ColorPalette1=#000000000000
ColorPalette2=#cdcd00000000
ColorPalette3=#0000cdcd0000
ColorPalette4=#cdcdcdcd0000
ColorPalette5=#1e1e9090ffff
ColorPalette6=#cdcd0000cdcd
ColorPalette7=#0000cdcdcdcd
ColorPalette8=#e5e5e5e5e5e5
ColorPalette9=#4c4c4c4c4c4c
ColorPalette10=#ffff00000000
ColorPalette11=#0000ffff0000
ColorPalette12=#ffffffff0000
ColorPalette13=#46468282b4b4
ColorPalette14=#ffff0000ffff
ColorPalette15=#0000ffffffff
ColorPalette16=#ffffffffffff