Skip to content

Instantly share code, notes, and snippets.

@tmm1
Created April 9, 2012 08:00
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tmm1/2342235 to your computer and use it in GitHub Desktop.
Save tmm1/2342235 to your computer and use it in GitHub Desktop.
How to pimp your linux

THIS ASSUMES YOU RUN DEBIAN (or ubuntu, mint) AND ARE NOT A SUCKA MC

XDM

sudo aptitude install xdm
sudo echo '/usr/bin/xdm' > /etc/X11/default-display-manager

spectrwm, dmenu

sudo aptitude install dmenu libxtst-dev
git clone git://opensource.conformal.com/spectrwm.git
cd spectrwm/linux
make && sudo make install

Tell XDM to start specrtwm:

  • Edit ~/.Xsession:
exec i3status | dzen2 -fn -*-terminus-medium-*-*-*-*-*-*-*-*-*-*-* &  
exec uxterm &  
exec /usr/local/bin/spectrwm  

/etc/spectrwm.conf

# colors for focussed and unfocussed window borders
color_focus     = blue
color_unfocus   = rgb:88/88/88

# bar settings     
# (bar is handled by dzen2, not spectrwm)
bar_enabled             = 0
region                  = screen[1]:1024x754+0+14

# mod key, (windows key is Mod4) (apple key on OSX is Mod2
modkey = Mod4

quirk[XTerm:xterm]          = XTERM_FONTADJ

program[menu]       = dmenu_run  -fn $bar_font -nb $bar_color -nf $bar_font_color -sb $bar_border -sf $bar_color -p SUP? -i
spawn_term      = uxterm
program[chrome] = google-chrome
bind[chrome] = MOD+c
program[nautilus] = nautilus
bind[nautilus] = MOD+n
program[xlock] = /usr/bin/xtrlock
bind[xlock]     = MOD+Shift+l

~/.Xresources

! font menu (ctl-rightclick)
UXTerm.fontMenu.fontdefault.Label: Normal
UXTerm.fontMenu.font1.Label: Illegible
UXTerm.fontMenu.font2.Label: Smallest
UXTerm.fontMenu.font3.Label: Small
UXTerm.fontMenu.font4.Label: Large
UXTerm.fontMenu.font5.Label: Huge
UXTerm.fontMenu.font6.Label: Bold

! stop eating ALT-
UXTerm*eightBitInput: false

! truetype plz
UXTerm.vt100.renderFont: true
UXTerm*faceName: Terminus
UXTerm*faceSize: 8

! does this do anything? dunno
Xft.antialias: true
Xft.autohint: false
Xft.hinting: true
Xft.hintstyle: hintfull
Xft.rgba: rgb
Xft.dpi: 96
Xft.lcdfilter: lcddefault
Xft.embolden: false
Xft.render: true

! bitmap fonts
UXTerm.vt100.utf8Fonts.font: -efont-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1
UXTerm.vt100.utf8Fonts.font1: nil2
UXTerm.vt100.utf8Fonts.font2: -efont-fixed-medium-r-normal--10-*-*-*-c-*-iso10646-1
UXTerm.vt100.utf8Fonts.font3: -efont-fixed-medium-r-normal--12-*-*-*-c-*-iso10646-1
UXTerm.vt100.utf8Fonts.font4: -efont-fixed-medium-r-normal--16-*-*-*-c-*-iso10646-1
UXTerm.vt100.utf8Fonts.font5: -efont-fixed-medium-r-normal--24-*-*-*-c-*-iso10646-1
UXTerm.vt100.utf8Fonts.font6: -efont-fixed-bold-r-normal--16-*-*-*-c-*-iso10646-1
UXTerm.vt100.utf8Fonts.boldFont: -efont-fixed-bold-r-normal--14-*-*-*-c-*-iso10646-1

! word selection
UXTerm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48,35:48

! termtype
UXTerm*termName: xterm-256color

! fix colors
UXTerm*background: black
UXTerm*foreground: green
UXTerm*color0: rgb:00/00/00
UXTerm*color1: rgb:a8/00/00
UXTerm*color2: rgb:00/a8/00
UXTerm*color3: rgb:a8/54/00
UXTerm*color4: rgb:00/00/a8
UXTerm*color5: rgb:a8/00/a8
UXTerm*color6: rgb:00/a8/a8
UXTerm*color7: rgb:a8/a8/a8
UXTerm*color8: rgb:54/54/54
UXTerm*color9: rgb:fc/54/54
UXTerm*color10: rgb:54/fc/54
UXTerm*color11: rgb:fc/fc/54
UXTerm*color12: rgb:54/54/fc
UXTerm*color13: rgb:fc/54/fc
UXTerm*color14: rgb:54/fc/fc
UXTerm*color15: rgb:fc/fc/fc
UXTerm*boldMode: false
UXTerm*colorBDMode: true
UXTerm*colorBD: rgb:fc/fc/fc

~/.screenrc

(I didn't make most of this)

# Easier than remembering to always run from non-X
unsetenv DISPLAY
# Likewise, for charset
setenv LC_CTYPE en_US.UTF-8

# Add stuff to xterm (and cousins) title bars.  This is a moderate abuse of the
# hardstatus feature--it just puts the hardstatus stuff into an xterm title
# bar.
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'

# erase background with current bg color
defbce "on"

#termcapinfo xterm*|Eterm|mlterm 'hs:ts=\E]0;:fs=\007:ds=\E]0;screen\007'
defhstatus "screen � (�t) | $USER@�H"
hardstatus off

# Make screen messages stand out a little more - black on bright green.
sorendition "+b kG"

# Variants on Sven's custom messages.
activity "%c activity -> %n%f %t"
bell "%c bell -> %n%f %t^G"
vbell_msg " *beep* "

# I know about screen.  I don't need to see it every time I start the program.
# (Which is, admittedly, rarely.)
startup_message off
# don't log new screen windows in utmp.
deflogin off
# Never, ever turn this off.
autodetach on
# Just in case it isn't clear...
shell bash
vbell off
verbose on
#escape ^za
# I like a large scrollback
defscrollback 10000
# Run everything in UTF-8.
defutf8 on
# If a window goes unresponsive, don't block the whole session waiting for it.
nonblock on

# want alt-arrow to switch windows? you got it.
#bindkey "^[[1;3D" prev
#bindkey "^[[1;3C" next

# Use the function keys to switch among windows.
#bindkey -k k1 select 1
#bindkey -k k2 select 2
#bindkey -k k3 select 3
#bindkey -k k4 select 4
#bindkey -k k5 select 5
#bindkey -k k6 select 6
#bindkey -k k7 select 7
#bindkey -k k8 select 8
#bindkey -k k9 select 9
#bindkey -k k; select 10
#bindkey -k F1 select 11
#bindkey -k F2 select 12
#### windows 13-24 are Shift-Fn.  May not work in all terminals.
#bindkey -k F3 select 13
#bindkey -k F4 select 14
#bindkey -k F5 select 15
#bindkey -k F6 select 16
#bindkey -k F7 select 17
#bindkey -k F8 select 18
#bindkey -k F9 select 19
#bindkey -k FA select 20
####### screen only seems to understand up to FA.
#bindkey -k FB select 21
#bindkey -k FC select 22
#bindkey -k FD select 23
#bindkey -k FE select 24

# select works on window names, too.  This gives me the first window with a
# free shell.
#bind s select zsh

# Make shift-PgUp and shift-PgDn work like they do in xterm.  (Note that this
# requires xterm to be configured to pass those keys through, and not try to
# act on them itself.)
bindkey "^[[5;2~" eval "copy" "stuff ^u"
bindkey -m "^[[5;2~" stuff ^u
bindkey -m "^[[6;2~" stuff ^d

bind c screen 0
#bind 0 select 10

# Login toggle is too close to screen redraw.  How about explicitly setting
# login state, anyway?
bind 'L'
bind 'I' login on
bind 'O' login off

# It's sometimes useful to have a quote key.
bind ^Q mapdefault
bind q mapdefault

# And since that leaxes xon unbound, let's remove xoff, too.
bind ^S

# Using tab to move around regions gets annoying.  These help.
bind ^j focus down
bind ^k focus up
bind ^t focus top
bind ^b focus bottom

# More fixes for the IBM 3151.  Force the terminal's backspace (^H) to generate
# the required ^?.  (This renders ^H unusable for help from the terminal.)
bindkey -k kb stuff "\177"

# This lets me use specific commands from screen escape sequences.
multiuser on
aclchg :window: +x select

# caption description:
 caption always "%{= KW}%?%n -%C|%D|%M %d|%H %?%F%{+u KG}%?%L=%-Lw%45>%{+b wK}%n%f* %t%{-}%+Lw%-0<"
  attrcolor b ".I"

test

@rohit-gupta
Copy link

rohit-gupta commented Apr 26, 2018

If I just want to use the UXTerm settings but not XDM/Spectrwm, can I just copy the Xresources file to make it work ?

@Hoekstraa
Copy link

Yeah, no problem @rohit-gupta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment