Advice: Try to understand what the script does and attempt to write your own version.  If you cut and paste the next time you'll have to visit my stupid site again ;-).  Remember, it's not free software but to learn what makes you free.

Basic Configuration Tips For Linux Graphical Environment

Avoiding Dependencies

Unfortunately, in 1987 I had to do the compulsory military service (In Argentina, my country, it was abolished in 1994).  A pair of days before Christmas, four of us were on duty.  We had to stay four hours seated in a room like reinforcement in case of emergency(!?).

In the calmly of the night the young officer in charge asked us, one by one, the typical 'What would you do if you won the big prize of Christmas lottery?'

At that time (I was nineteen) my companions and me thought that we were just losing fourteen months of our lives.  Nowadays, with half life's experience on my back, I realized that it was just one of the lot of arbitrary stupid things that society forces individuals to do.  Now I don't see a big difference between military service and school, neighborhood or family.  I've received worse abuses from teachers, neighbors, friends, relatives than from sergeants or captains.  Violence is spontaneous, natural, explicit.  Despotism is, the most of the times, subliminal, innocent.

And people support these abuses because they don't dare to find out to what extent they really depend on all that stuff.

With the same assurance the young version of me added one more "life of luxury" to the others' descriptions I know exactly what I would answer to the officer if I was able to go back to that instant of my life, "I would buy a little house in a quiet place, far from all towns, and I would refrain myself from squandering".

With Linux A Window Manager Is Enough

Between others you can use FVWM, JWM, IceWM or Fluxbox.

Since we manage without desktop environments for idiots we don't need applications taking decisions for us, i.e. Firefox creating Desktop and Downloads without asking.  Run this:

# Remove stupid settings

sed -i "s#\$HOME/Desktop#$HOME#" ~/.config/user-dirs.dirs
sed -i "s#\$HOME/Documents#$HOME#" ~/.config/user-dirs.dirs
sed -i "s#\$HOME/Downloads#$HOME#" ~/.config/user-dirs.dirs
sed -i "s#\$HOME/Templates#$HOME#" ~/.config/user-dirs.dirs
sed -i "s#\$HOME/Music#$HOME#" ~/.config/user-dirs.dirs
sed -i "s#\$HOME/Public#$HOME#" ~/.config/user-dirs.dirs
sed -i "s#\$HOME/Videos#$HOME#" ~/.config/user-dirs.dirs
sed -i "s#\$HOME/Pictures#$HOME#" ~/.config/user-dirs.dirs



What's priority in graphical interfaces?  If you 'use' your machine surely your answer is a good font rendering.

First, let's avoid disrespectful and destructive fake innovation.  Even if it would be logic (not the case), in the same way we don't decide to change in English "I was" for "I amed" when a system file has lived in some place during decades it should stay there.  Run as root:

# Preserve per user fonts.conf traditional place

sed -i '/<fontconfig>/,/<\/fontconfig>/d' /etc/fonts/conf.avail/50-user.conf
echo '<fontconfig>' >> 50-user.conf
echo -e '\t<include ignore_missing="yes">~/.fonts.conf</include>' >> \
echo '</fontconfig>' >> /etc/fonts/conf.avail/50-user.conf

Create ~/.fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<match target="pattern">
	<edit name="dpi" mode="assign">
<match target="font">
	<edit mode="assign" name="rgba">
<match target="font" >
	<edit mode="assign" name="hinting">
<match target="font" >
	<edit mode="assign" name="hintstyle">
<match target="font" >
	<edit mode="assign" name="antialias">
<match target="font">
	<edit name="autohint" mode="assign">

Add the following lines to your ~/.Xdefaults

Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintslight
Xft.rgba: rgb
Xft.dpi: 96

Unified Keybindings

It doesn't care if emacs, vi or whatever while having for goal an unified set.  Taking in care that 'unified' doesn't mean 'exactly' the same behavior in all apps, in some cases 'different' (or, more suitable said, 'complementary') key bindings avoid problems between applications that have to live together.

You can append this to your ~/.gtkrc-2.0.

# ~/.gtkrc-2.0

# Generic Unix key bindings
binding "gtk-unix-text-entry"
	bind "<ctrl>u" { "delete-from-cursor" (paragraph-ends, -1) }
	bind "<ctrl>h" { "delete-from-cursor" (chars, -1) }
	bind "<ctrl>w" { "delete-from-cursor" (word-ends, -1) }
	bind "<ctrl>b" { "move-cursor" (paragraph-ends, -1, 0) }
	bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) }
class "GtkEntry" binding "gtk-unix-text-entry"

# Vi key bindings (as far as possible)
binding "gtk-vi-tree-view"
	bind "j" { "move-cursor" (display-lines, 1) }
	bind "k" { "move-cursor" (display-lines, -1) }
	bind "l" { "move-cursor" (logical-positions, 1) }
	bind "h" { "move-cursor" (logical-positions, -1) }
	bind "slash" { "start-interactive-search" () }
binding "gtk-vi-menu"
	bind "j" { "move-current" (next) }
	bind "k" { "move-current" (prev) }
	bind "l" { "move-current" (child) }
	bind "h" { "move-current" (parent) }
class "GtkTreeView" binding "gtk-vi-tree-view"
class "GtkMenuShell" binding "gtk-vi-menu"

# Emacs key bindings
#binding "gtk-emacs-text-entry"
#	bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) }
#	bind "<ctrl>f" { "move-cursor" (logical-positions, 1, 0) }
#	bind "<alt>b" { "move-cursor" (words, -1, 0) }
#	bind "<alt>f" { "move-cursor" (words, 1, 0) }
#	bind "<ctrl>a" { "move-cursor" (paragraph-ends, -1, 0) }
#	bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) }
#	bind "<ctrl>d" { "delete-from-cursor" (chars, 1) }
#	bind "<ctrl>BackSpace"	{ "delete-from-cursor" (chars, -1) }
#	bind "<alt>d" { "delete-from-cursor" (word-ends, 1) }
#	bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) }
#	bind "<ctrl>k" { "delete-from-cursor" (paragraph-ends, 1) }
#	bind "<ctrl>space" { "entry.set_position" () }
#binding "gtk-emacs-text-view"
#	bind "<ctrl>p" { "move-cursor" (display-lines, -1, 0) }
#	bind "<ctrl>n" { "move-cursor" (display-lines, 1, 0) }
#	bind "<ctrl>space" { "set-anchor" () }
#binding "gtk-emacs-tree-view"
#	bind "<ctrl>s" { "start-interactive-search" () }
#	bind "<ctrl>f" { "move-cursor" (logical-positions, 1) }
#	bind "<ctrl>b" { "move-cursor" (logical-positions, -1) }
#binding "gtk-emacs-menu"
#	bind "<ctrl>n" { "move-current" (next) }
#	bind "<ctrl>p" { "move-current" (prev) }
#	bind "<ctrl>f" { "move-current" (child) }
#	bind "<ctrl>b" { "move-current" (parent) }
#class "GtkEntry" binding "gtk-emacs-text-entry"
#class "GtkTextView" binding "gtk-emacs-text-view"
#class "GtkTreeView" binding "gtk-emacs-tree-view"
#class "GtkMenuShell" binding "gtk-emacs-menu"

# End of ~/.gtkrc-2.0

Comfortably navigating a PDF file:

# ~/.xpdfrc

bind ctrl-+ any zoomIn
bind ctrl-- any zoomOut

#continuousView yes

# Vi keybindings
bind h any scrollLeft(16)
bind l any scrollRight(16)
bind k any scrollUp(16)
bind j any scrollDown(16)
bind ctrl-y any scrollUp(16)
bind ctrl-e any scrollDown(16)
bind ctrl-u any scrollUpPrevPage(100)
bind ctrl-d any scrollDownNextPage(100)
bind ctrl-b any scrollUpPrevPage(800)
bind ctrl-f any scrollDownNextPage(800)
bind g any gotoPage(1)
bind G any gotoLastPage
bind / any find
bind f any toggleFullScreenMode

# Emacs keybindings
#bind ctrl-b any scrollLeft(16)
#bind ctrl-f any scrollRight(16)
#bind ctrl-p any scrollUp(16)
#bind ctrl-n any scrollDown(16)
#bind alt-v any scrollUpPrevPage(900)
#bind ctrl-v  any scrollDownNextPage(900)
#bind alt-< any gotoPage(1)
#bind alt-> any gotoLastPage
#bind ctrl-s any find

urlCommand "firefox %s"

# End of ~/.xpdfrc

Let's Go

Using xinit you can run the X server like a child of your user's shell process having control over it.  You'll have even more control using the xinit command instead of startx, since the former read exclusively your ~/.xinitrc customizations.

# ~/.xinitrc

# Background
xsetroot -solid gray40

# Start Apps
xclock -geometry -0+0 &
xterm -geometry +0+0 &

# Start Window Manager

# End of ~/.xinitrc

An example of TWM config:

# ~/.twmrc -- Walter A. Iglesias

# General options
ButtonIndent 0
BorderWidth 2
ConstrainedMoveTime 0
TitlePadding 6
UsePPosition "on"

# Adjust the following to your screen resolution (Rest the necessary pixels to
# the hight to not cover Icon Manager)
MaxWindowSize "1024x714"
IconManagerGeometry "=1024x26+0-0" 6

# Fonts
TitleFont	"-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*"
ResizeFont	"-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*"
MenuFont	"-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*"
IconFont	"-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*"
IconManagerFont	"-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*"

# Colors
	BorderColor		"gray34"
	MenuBorderColor		"gray34"
	IconBorderColor		"gray34"

	DefaultBackground	"gray34"
	TitleBackground		"gray34"
	MenuBackground		"gray34"
	IconBackground		"gray34"
	IconManagerBackground	"gray34"
	MenuTitleBackground	"white"

	BorderTileBackground	"gray34"
	BorderTileForeground	"gray34"

	DefaultForeground	"white"
	TitleForeground		"white"
	MenuForeground		"white"
	IconForeground		"white"
	IconManagerForeground	"white"
	MenuTitleForeground	"gray34"

	IconManagerHighlight	"green"
	MenuShadowColor		"white"

# Don't draw title bar to these apps
NoTitle { "TWM Icon Manager" "XClock" "xosview" "xbiff" "xload" }

# Don't show these apps at icon manager
IconManagerDontShow { "XClock" "xosview" "xbiff" "xload" }

DefaultFunction f.nop

# Defining functions
MoveDelta 7
Function "move-or-raiselower"	{ f.move f.deltastop f.raiselower }
Function "move-or-iconify"	{ f.move f.deltastop f.iconify }
Function "resize-or-fullzoom"	{ f.resize f.deltastop f.fullzoom }
Function "deiconify-n-raise"	{ f.deiconify f.raise }
Function "forwiconmgr-n-raise"	{ f.forwiconmgr f.lower }
Function "backiconmgr-n-raise"	{ f.backiconmgr f.lower }
Function "warpto-n-cycle" {
	f.warpto "TWM Icon Manager"
	f.function "forwiconmgr-n-raise"
Function "warpto-n-backcycle" {
	f.warpto "TWM Icon Manager"
	f.function "backiconmgr-n-raise"

# Mouse click
Button1 = : root : "main"
Button3 = : root : "windowops"
Button2 = : root : "TwmWindows"

Button1 = : t|f : f.function "move-or-raiselower"
Button3 = : title : "windowops"

Button1 = m : w : f.function "move-or-raiselower"
Button3 = m : w : f.resize

Button1 = : iconmgr : f.function "deiconify-n-raise"
Button3 = : iconmgr : f.iconify

# Redmont title bar buttons
RightTitleButton ":dot" = f.iconify
RightTitleButton ":resize" = f.function "resize-or-fullzoom"
RightTitleButton ":xlogo" = f.delete

# Key bindings
"Tab"	= m	: all : f.function "warpto-n-cycle"
"Tab"	= m | s	: all : f.function "warpto-n-backcycle"
"F11"	= m 	: all : f.fullzoom
"F12"	= m 	: all : f.hzoom
"F10"	= m 	: all : f.zoom
"F8"	= m 	: all : f.iconify
"F4"	= m 	: all : f.delete

# programs
"u"	= mod4 : all : !"/usr/bin/urxvt &"
"n"	= mod4 : all : !"/usr/bin/firefox &"

# Menu
menu "main"
	"Menu"			f.title
	"XTerm (Win+u)"		! "xterm &"
	"Firefox (Win+n)"	! "firefox &"
	"Mutt (Win+m)"		! "xterm -T \"Mutt\" -e sh -c \"/usr/bin/mutt\" &"
	""			f.nop

	"Show Icon bar"		f.showiconmgr
	"Hide Icon bar"		f.hideiconmgr

	""			f.nop
	"Exit" "Quit-Verify"

menu "Icon bar"
	"Show"			f.showiconmgr
	"Hide"			f.hideiconmgr

menu "Quit-Verify"
	"Restart TWM"		f.restart
	"Exit"			f.quit

menu "windowops"
	"Window Ops"		f.title
	"Maximize (Alt+F11)"	f.fullzoom
	"H. Maximize (Alt+F12)"	f.hzoom
	"V. Maximize (Alt+F10)"	f.zoom
	"Iconify (Alt+F3)"	f.iconify
	"Resize"		f.resize
	"Move"			f.move
	"Raise"			f.raise
	"Lower"			f.lower
	"Identify"		f.identify
	""			f.nop
	"Focus"			f.focus
	"Unfocus"		f.unfocus
	""			f.nop
	"Close (Alt+F4)"	f.delete
	"Kill"			f.destroy

# End ~/.twmrc

Run Dialog Using BASH

You know what's installed in your machine, don't you?  What's the menu for?

# ~/bin/run
# Run Dialog using BASH - Walter Alejandro Iglesias
# Based on:
# Copy it to your ~/bin directory, change the execution bit
# and bind it to a Alt+F2 or whatever key.

# Get screen with to center run dialog
screen=`xrandr | grep '\*' | grep -o '^ *[0-9]*' | grep -o '[0-9]*'`
vgeom=`echo "( $screen / 2 ) - ( $width / 2 )" | bc`

# Customize
term=xterm	# xterm or rxvt
name=run	# Use this name to set the properties in your window manager

if [ "$term" = "rxvt" ] ; then
	keysym=-keysym.Return\ "&\nexit\n"
elif [ "$term" = "xterm" ] ; then
	grep '! Run' ~/.Xdefaults >/dev/null || {
		echo ""						>> ~/.Xdefaults
		echo "! Run"					>> ~/.Xdefaults
		echo -n 'run.VT100*translations: #override'	>> ~/.Xdefaults
		echo ' <Key>Return: string("&\nexit\n")'	>> ~/.Xdefaults
		echo "run.VT100*cursorUnderLine: on"		>> ~/.Xdefaults
		echo "run.VT100*cursorBlink: yes"		>> ~/.Xdefaults

if [ ! -e $bashrc ] ; then
	echo '#!/bin/sh'				>> $bashrc
	echo '# ~/.runrc'				>> $bashrc
	echo ''						>> $bashrc
	echo 'HISTFILE=$HOME/.run_history'		>> $bashrc
	echo 'HISTCONTROL=ignorespace:erasedups'	>> $bashrc
	echo 'HISTIGNORE=exit'				>> $bashrc
	echo 'shopt -s histappend'			>> $bashrc
	echo 'bind "TAB: menu-complete"'		>> $bashrc
	echo 'bind "set show-all-if-ambiguous off"'	>> $bashrc
	echo 'PS1="> "' >> $bashrc

# Run it
$term	-name $name		\
	-title Run		\
	-geom $geometry		\
	-fn $font		\
	-bg $background		\
	-fg $foreground		\
	$keysym			\
	-e bash --rcfile $bashrc

exit 0

# End of ~/bin/run