Slackware Desktop and Creature Comforts


Started with a a very plain but working fluxbox setup.

Home Directories

Shell (bash) Configuration

bash profile

Create $HOME/.bash_profile file. This simple profile check for a home bin directory and adds it to your PATH if it exists. It also sources the .bashrc file to pickup bash prompts and aliases.

# add home bin to PATH
if [ -d $HOME/bin ] 

# source home bashrc file
if [ -f $HOME/.bashrc ]
    . $HOME/.bashrc


Create $HOME/.basrc file. Create a fancy coloured prompt and a few useful aliases. Did I mention I love awk.

# fancy Prompt
function fancy_path()
 pwd | gawk -F '/' '


    if(NF == 2) {
        if(p1 == "") 
            printf("/%s\n", p0)
            printf("%s/%s\n", p1, p0)
    } else {
        if(p2 != "") 
            printf(".../%s/%s\n", p1, p0)
            printf("/%s/%s\n", p1, p0)


# 30=black, 31=red 32=green 33=yellow 34 = blue 35=magenta 36=cyan 37=white
PS1='\[\033[01;32m\][slack] \[\033[01;34m\]$(fancy_path) \$\[\033[00m\] '

alias ls="ls --color"
alias ll="ls -oh"
alias la="ls -a"
alias lla="ls -al"
alias vi="vim"
alias down="cd $HOME/Downloads"


Add User Account to sudoers

$ su -
# visudo 
   -Uuncomment the wheel line
    #%wheel ALL=(ALL) ALL
   -Added line for longer timeout
    Defaults timestamp_timeout=180

If you did not add your user account to the wheel group when you created the user you need to do it now with the "gpasswd" command

$ gpasswd -a john wheel

Extra Fonts Installation

I like the Inconsolata font. It is monospaced and has a real zero with a stroke thru it so you do not see it as a capital letter O. I also like the Droid Sans mono font and it supports many more unicode symbols including the APL characters. How could you live without a bit of APL!!

Google Inconsolata

Google DroidSansMono

Download the fonts. Unzip and move DroidSansMono.ttf and the Inconsolata-Regular.ttf file into $HOME/.fonts directory

$ cd $HOME/.fonts
$ mkfontdir
$ mkfontscale
$ sudo fc-cache -f -v

Not sure if you need this but, exit and restart X

Terminal Setup and Configuration

I wanted a terminal that supports unicode just incase I break into a fit of APL programming. urxvt seems to be the non-VTE based terminal of choice. This took a lot longer than I expected.

Install via

Download and install the slackbuild for unicode terminal application:

Home/End Key Configuration

Out of the box and keys do not work correctly in bash. There seems to be two approaches to fixing this. First is to change the key bindings on urxvt to match the xterm and the second is to change the readline library configuration to understand rxvt escape codes.

I decide to use readline library configuration. (technically it is not really the readline lib, there is a copy of the readline lib embedded into bash at compile time). The out-of-the-box readline configuration is setup for the linux console and xterm applications. To fix things we need to add the and key escape codes to /etc/inputrc file.

I ran the "od -c" command and noted that Home sends [7~ and the End key send [8~

Edit /etc/inputrc to include these codes.

# /etc/inputrc
# This file configures keyboard input for programs using readline.
# See "man 3 readline" for more examples.

# Configure the system bell.  Options are none, visible, and audible.
#set bell-style none

# Enable 8 bit input.
set meta-flag On
set input-meta On
set convert-meta Off
set output-meta On

# Set various nice escape sequences:
"\eOd": backward-word
"\eOc": forward-word

# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert

# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line

# for rxvt and urxvt.... ADD THESE TWO LINES
"\e[7~": beginning-of-line
"\e[8~": end-of-line

Colour Configuration

Edit the .Xresource file to suit your prefered colours. I found one on the net and edited it a bit using the site.

!! 2016/12/14

!! *background:           rgb:1a/1a/1a 
!! *background:           rgb:12/12/12 
!! *foreground:           rgb:f0/f0/f0
*background:           rgb:00/00/00
*foreground:           rgb:f5/f5/f5
!! *fadeColor:             S_base3
!! *cursorColor:           S_base01
!! *pointerColorBackground:S_base1
!! *pointerColorForeground:S_base01

!! black dark/light
*color0:                rgb:00/00/00
*color8:                rgb:66/66/66

!! red dark/light
*color1:                rgb:9e/18/28
*color9:                rgb:f0/37/4c

!! green dark/light
*color2:                rgb:00/88/00
*color10:               rgb:61/a1/71

!! yellow dark/light
*color3:                rgb:d2/bb/4b
*color11:               rgb:e7/db/52

!! blue dark/light
*color4:                rgb:1a/62/91
*color12:               rgb:26/8d/d2

!! magenta dark/light
*color5:                rgb:96/3c/59
*color13:               rgb:a9/3c/59

!! cyan dark/light
*color6:                rgb:41/81/79
*color14:               rgb:6d/a4/a4

!! white dark/light
*color7:                rgb:be/be/be
*color15:               rgb:ff/ff/ff

TERM and termcap Configuration

Bash uses a few terminal screen control functions to wrap lines when they get to long. To find the right escape sequences for your terminal type it uses the TERM environment variable to look up screen control in the /etc/termcap file. When urxvt runs it sets the TERM variable to rxvt-unicode-256color.

urxvt installed a terminfo file for itself but did not include a termcap entry. Without the termcap entry for "rxvt-unicode-256color" bash will scroll horizontally when you have long command lines. I am not a fan of horizontal scrolling.

We need to add the urxvt entry to termcap.


$ cd /usr/share/terminfo/r directory
$ infocmp -C rxvt-unicode-256color

#   Reconstructed via infocmp from file: /usr/share/terminfo/r/rxvt-unicode-256color
# (untranslatable capabilities removed to fit entry within 1023 bytes)
# (sgr removed to fit entry within 1023 bytes)
# (acsc removed to fit entry within 1023 bytes)
# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
# (some function-key capabilities suppressed to fit entry within 1023 bytes)
rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System):\

Font Configuration

Since we already installed the cool Droid fonts, setting up the font is fairly simple. You can either set it via the command line

urxvt -fn "xft:DroidSansMono:pixelsize=15"

or set it via the .Xresouces file

URxvt.font:   xft:DroidSansMono:pixelsize=15

or set it via a shell script

# 2016/12/13 created
# 2017/01/01 changed font to Droid

urxvt -fn "xft:DroidSansMono:pixelsize=15" -geometry 86x42+10+10 -sl 6000 &

# urxvt -fn "xft:DroidSansMono:pixelsize=15" -geometry 86x46+10+10  -sl 6000 &
# urxvt -fn "xft:Inconsolata-Regular:pixelsize=16" -geometry 86x46+10+10  -sl 6000 &
# urxvt -fn "xft:Terminus:pixelsize=17" -geometry 82x46+10+10 -sl 6000 &
# urxvt -fn "xft:Terminus:pixelsize=17" -geometry 86x46+10+10  -sl 6000 &

Fluxbox Window Manger Configuration

Slight detour..... I wanted a key to pop up the fluxbox "right click" menu so decide to use the "menu" key to do this. This is nice when you have something open full screen and can not click on the desktop.

Added one line to the $HOME/.fluxbox/menu file

Menu :RootMenu

Vim Configuration

Create .vimrc to suit your desires.

" 2014/02/19 created

" ------------------------------------------------------------
" SECTION ONE -- Options
" ------------------------------------------------------------

" vim not vi
set nocompatible
set mouse=a

" search case 
" all-lowercase string your search will be case-insensitive
" any characters in uppercase the search will be case-sensitive 
set ignorecase
set smartcase

" highlight search results (as you type) 
" <leader><space> mapping makes it easy to hide search results
" This gets rid of the distracting highlighting once you done with it
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :nohlsearch<cr>

" just the 81st column of wide lines
highlight ColorColumn ctermbg=magenta
call matchadd('ColorColumn', '\%81v', 100)

" expand tab to 4 spaces 
"   .....use :retab to fix up old files
" use tabs in makefiles, no expandtab 
set tabstop=4
set shiftwidth=4
set expandtab
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0

" always have an extra line on bottom and top
set scrolloff=1

" allow dirty buffers to be hidden
set hidden

" hidden characters tabs, spaces, eol
exec "set listchars=tab:\ubb\ubb,eol:\ub6,trail:\ub7"

" ------------------------------------------------------------
" SECTION TWO -- Functions
" ------------------------------------------------------------
function! Tognums()
" tri-toggle number,relativenumber, and list
if &number
    set nonumber
    set norelativenumber
    set nolist
elseif &relativenumber
    set number
    set norelativenumber
    set list
    set nonumber
    set relativenumber
    set list

" ------------------------------------------------------------
" SECTION THREE -- Key Mappings
" ------------------------------------------------------------
" extra escape key
inoremap jj <ESC>
" extra eol
nnoremap \\ $
" make colon commands easier
nnoremap ; :
vnoremap ; :

"  n=numbers and show hidden chars
"  s=spell
"  c=C comment 
"  c=shell comment 
nnoremap <leader>n :call Tognums()<CR>
nnoremap <leader>s :set spell!<CR>
nnoremap <leader>c <ESC>0i// <ESC><CR>
nnoremap <leader>C <ESC>0i# <ESC><CR>

" using register f for quick macros and shortcuts \f 
" usually record quick macros into reg f .... qf<keystrokes>q
nnoremap <leader>f @f

" buffer shortcuts 
nnoremap <leader>b :bn<cr>
nnoremap <leader>w <c-w><c-w>

" f2 to paste clipboard and add CR (and control-v)
nmap <c-v> "+gP
nmap <F2> "+gPA<CR><ESC>
imap <F2> <ESC>"+gPA<CR><ESC>
" f3 insert todays date 
nnoremap <F3> "=strftime("%Y/%m/%d ")<CR>P
inoremap <F3> <C-R>=strftime("%Y/%m/%d")<CR> 
" markdown underlines
nmap <F4> 0yypv$r=
nmap <F5> 0yypv$r-
" reformt paragraph
" this is pretty stupid and should be fixed
nmap <F6> mZ{V}gq`Z

Final Comfort Bits

Created script to mount the VirtualBox shared directory

# 2016/12/11 copied from another VM

sudo mount -t vboxsf vbshare $VBDIR

Download and install sbopkg from

Guestbook and Comments