NAME
customx
—
customization X
DESCRIPTION
First, read about The X Window System in FAQ. The simplest ~/.xsession file can look like this.
# Set background color xsetroot -solid darkgrey & # Start window manager exec cwm
Add status bar
The status bar is a panel that displays current information about the computer, network, etc. We will use xterm to display the bar and write the information to the terminal using a shell script.
# Launch status bar exec xterm -geometry 191x1+0+0 -fa "monaco" -fs 10 -bg "black" -fg "white" \ -name termbar -class termbar -T termbar -e ~/bar.sh &
#!/bin/sh # status bar for X # Restart itself trap 'exec $0' HUP trap 'tput cnorm; exit 1' INT QUIT TERM # Hide cursor tput civis # Get keyboard layout function kbd { echo -n "$(setxkbmap -query | awk '/^layout:/ {print $2}')" } while true; do BAT=$(apm -l) NET="em0" HOST=$(hostname) DATE=$(date +"%a %b %e %H:%M") # Move cursor to left tput cup 1 1 printf "$HOST" # Move cursor to right tput cup 1 96 printf "$NET $BAT%% $(kbd) $DATE" sleep 2 done
# Set font name and size fontname "monaco:pixelsize=14:regular" # Remove border borderwidth 1 # Autogroup autogroup 3 "xterm,XTerm" ignore termbar autogroup 0 termbar # Add top gap due status bar gap 20 0 0 0
Customizing reousrces
Add these lines to ~/.xsession configuration file.
# Load configuration file xrdb -merge ~/.Xresources
XTerm*faceName: Monaco* XTerm*faceSize: 10 XTerm*scrollBar: false XTerm*internalBorder: 20 ! Load ~/.profile file XTerm*loginShell: true
Copy and paste
XTerm*selectToClipboard: true XTerm*VT100*translations: #override \n\ Ctrl Shift <Key>V: insert-selection(CLAIPBOARD) \n\ Ctrl Shift <Key>C: select-end(CLIPBOARD)
Keyboard switcher
Add following lines to ~/.cwmrc
.
# Key bindings bind-key CMS-p "/home/puffy/kbd.sh"
#!/bin/sh # Switch keyboard script _uskbd="us" _czkbd="cz" [[ "$(setxkbmap -query | awk '/^layout:/ { print $2 }')" == "$_uskbd" ]] \ && setxkbmap -layout $_czkbd \ || setxkbmap -layout $_uskbd