Last edited: 2021-07-20
I use a blank desktop with no bars, docks or panels. My X11 session
is set up by commands run from the
~/.xsession script. This script
is a literal Rube Goldberg machine, full of pipes and background jobs.
Several functions are defined in this file. There are three ways to
interact with the desktop: with a desktop radial menu (also known as
pie menu) via
pmenu(1), by entering commands via
xprompt(1), or by
sxhkd(1). All of them output a command to a
interpreter function called
xinterp. Responses are output to a
notification window managed by
xnotify(1). Each piece communicates
with another by means of two named pipes,
Window Manager. I use the shod window manager.
It is an hybrid (tiling and floating) tabbed window manager that is
controlled solely by responding to client messages with EWMH hints and
ICCCM events and by using a given key modifier with the mouse pointer.
Windows begin floating on the desktop and are spawned in a proper empty
place. When a window is maximized, it is tiled. Tiled windows are
organized in columns; each tiled window ocupies a row in a column. This
columnated behavior imitates the way
their columns and frames.
Home directory. The contents of my
$HOME directory are listed below.
~/files/doc/is for non-fiction books;
~/files/lit/is for fiction books;
~/files/meme/is the meme folder;
~/files/mus/is the music folder; etc.
~/proj/c/for notes on the C Programming Language; etc.
~/skel/Makefileis a template for a Makefile;
~/skel/man.1is a template for a section 1 man page; etc.
~/usr/local/contains data for programs I install manually;
~/usr/python/is for programs installed with
~/usr/go/is for programs installed with
go(1); etc. Each subdirectory contains the directories
man/(for binaries, source and manual). For example,
~/usr/go/bin/lfis the binary for lf installed by go(1);
~/usr/local/man/man1/xmenu.1is the manual for xmenu(1) installed by its Makefile; etc.
~/var/trash/is for trashed files managed by
~/var/mail/is for email managed by
~/var/history/is for command history from
~/var/cache/is for cache used and generated by several programs.
Profile. Environment variables are set and exported in the
I prefer to use environment variables than configuration files to
configure my programs. At the end of
~/.profile, I set the file mode
$MANPATHenvironment variables to all the installation preffixes. There are a lot of such prefixes in a OpenBSD system,
/usr/local/are the standard directories. I also install some applications that creates prefixes under
/usr/local/heirloom-doctools. In my
$HOMEthere is also some prefixes under
ksh(1)as shell. This shell run commands from the file pointed at by
$ENVat the beginning of the session.
pt_BR.UTF-8. Programs in base ignore the
pt_BRpart, but some programs in ports don't. For character encoding, I use
en_US.UTF-8to force UTF-8 encoding. For collation order, I use
Cto force bytewise sorting rather than Unicode localized collation. I then set
$XCOMPOSEFILE, etc) to the path to several directories and files through my home directory in order for them to comply to my particular
$EDITOR, etc) to the default program to be used to open or edit a file.
Terminal Session. My terminal session is set up by commands run from the
script. I use
ksh(1) with emacs-like keybindings (for ^U and ^K,
etc). I also enable brace expansion. I use few aliases; there are
aliases to file management commands, file listing, commands with
human-readable output, etc.
histfunction lists the command history grepping for the given argument. It can also prompt for a command to be rerun when the first argument is a
dirfunction is a wrapper around
colortree(1). This function can recursively list the entries of the current working directory, or recursively search for a file (if the name of the file is given). Options are
-9(search recursively with depth 1 to 9,
-0(search recursively with infinite depth) and
cdbuiltin command with a function. The path given to the function can be a directory, or a regular file (in which case is considered the directory in which it resides). The function also sets the completion for the
makecommand to the Makefile in the current directory. I also set
$CDPATHto some some recurrent directories. Other kinds of arguments are possible, a
+add the current directory (or the directory after it) to the end of the directory stack;
+4moves the 4th directory on the stack to its beginning;
-4moves to the 4th directory on the stack. If argument is composed with dots, a directory up in the hierarchy becames the current directory.
cd ..goes to the parent directory,
cd ...goes to the parent's parent's directory, etc. If the argument is
..X(where X is a word), go to the first directory up in the hierarchy containing word. For example, if I am at
$HOME/tmp/stuff/fooand I enter the command
cd ..tmp, I go to
❯character. This character is white for normal users and red for the super user. The left prompt is padded at the left with a single space. The right prompt is the cwd with the
$HOMEprefix replaced with a
~. The right prompt is padded at the right with a single space.
I use a secondhand Thinkpad T430 model 23501M2.
What I expected. The following is the stock specification of this model, which comes without the iconic biometric fingerprint reader.
What I bought. However, being secondhand, the computer I bought was different from the stock. It came with a 465GB 7200rpm HD and a nonfunctional Bluetooth.
Modifications. After receiving it, I made some modifications on the computer.
xkbcomp(1)to set the keymap on X11.
Future modifications. There are other modifications I want to do on it. For information on T430 modding, see https://medium.com/@n4ru/3dff3f6a8e2e. I want to do the following.
I use OpenBSD -stable. See https://www.openbsd.org/faq for more information on the operating system and how to install it.
User. After installation, I run
userinfo(8) to make sure my user is in the
wheel user group and in the
staff login class. If it is not, I set
it up with
Doas. Then, I create
/etc/doas.conf to give administrator priviledges to
wheel group. The example file at
reasonable, and could be used. However, I like to not being asked for
a password again for some time after successfully authenticating. I
also do not want the
$DISPLAY environment variable to be retained.
System resources limits. The default system resources limits to the
staff login class defined
/etc/login.conf are reasonable. But the
datasize-cur option can
be increased a little bit, if necessary.
Power management. I enable
apmd(8) for power management in my laptop. I use the
-L flag instead of the
-A flag because it showed to heat less the
computer. I use the
-z 10 flag to suspend the system when the battery
gets to 10% and no AC is connected. I use the
-t 60 for
poll the power state once per 60 seconds and log it via
X Display Manager. If
xenodm(1) wasn't enabled during installation, it can be done so
later like any other system daemon. I also edit xenodm's rc file
/etc/X11/xenodm/Xsetup_0 to comment the line calling
disabling the xconsole window on the login screen. I also add the line
xset b off to disable the system beep.
Enable mic and camera. I did not use mic until covid happened. Then I had to do audio calls
every week. I do not use camera, however. But if necessary, recording
can be enabled by writing to
Configure network. Read faq6.
wscons keymap. I edit
/etc/wsconsctl.conf to set the brasilian layout, remap some
keys, and disable the beep. The changes affect only the console, it
does not affect X sessions. I map the key above Tab and at left of 1
to Esc and CapsLock to Control.
Install firmware packages and update the base system. Finally, I run
fw_update(1) to install and update needed non-free
firmware packages, and
syspatch(8) to update the base system.
Install programs. I use some programs available on the OpenBSD package repository. The following command install them.
I use a VPS at Vultr.com to host this website and other services.
Install patches and vim. The first thing I do after creating the virtual server is to log in as
root via ssh and run
syspatch(8) and install
vim(1). Vim is the
only program not in base that I run in this machine, only for
Create users. There are two users on my vps:
webdev (those are not their
names, they're too obvious, I actually use other names, but let's call
them thus). I create them with
adduser(8) then call
put admin in the
wheel secondary groups.
admin is on the wheel
group and has doas powers;
webdev owns the root directory of the
website and maintains the site.
Copy the public key to the server. I use
scp(1) to copy my ssh public key from my laptop to the
~/ssh/authorized_keys file of each user on the remote machine.
Copy configuration files. The only two configuration files I copy from my local machine to the
remote machine are vimrc and kshrc. I move them to the home directory
of each user on the remote machine. I also create a
to set the
$ENV variable necessary to read kshrc.
Edit doas. conf.To give administrative powers to the wheel group (and, consequently, to
the admin user), I edit the
/etc/doas.conf file on the remote machine.
Change the ssh port. For security reasons, I change the ssh port of the server from 22 to a
random number. I use
rcctl(8) to do that and restart
Protect ssh. For security reasons, I disable root login via ssh, password
authentication and challenge-response. I edit the
/etc/ssh/sshd_config file, uncomment and change the necessary
lines. Then, I restart
Known hosts. To avoid having to type the port, user and hostname on my local machine
every time I call
ssh(1), I edit the
~/.ssh/config file in the home
directory of my local user on my local machine (called thinkobsd (my
thinkpad with openbsd)) to set two configurations, one for the admin
user, and the other for the webdev user. Now, I only need to invoke
ssh webdev to log in as webdev on the server.
Configure httpd. TODO.
Configure acme. TODO.