Thursday, March 4, 2021

RE: Raspberry Pi 400

 One of the things I thought I'd talk about with this machine is configuring it to do something useful. On the outside this appears to be pretty easy, the basic Rasbian boot image pretty much has everything you need to be reasonably productive. The problem is, I don't particularly like the basic setup or the choices of applications. On top of that, I prefer Ubuntu to other flavors of Linux, so I wanted to start there. The basic Ubuntu desktop never appealed to me, Gnome 3 is just not my thing and on my desktop, I use Mates. There is a Mates version I can use, but I wanted to do something a little different. The Raspberry Pi 400 is a pretty decent machine and is very capable of running Mates, but it is still somewhat constrained my modern standards and i have no desire to overclock it, so the less resources the windowing system uses, the more resources I have available for applications and multitasking.

My choice for Window Manager is Dynamic Window Manager (DWM), it is the core of the Suckless Desktop, whose design goal is simplicity in desktop design. The whole thing runs on less than than 300K of memory. It does have some limitations and irritations, but the trade offs are acceptable. DWM is very configurable, but this requires you to recompile it to even change the default color scheme and upgrading it, forces you to make all the changes again before doing so. This is a no thanks for me, the default colors are fine, all I really want to do is change the background and that is easy enough without recompiling anything. So I will simply be using apt-get to install and update it.

I will start off with the Ubuntu 20.04 Server image, I choose this because it does not have xorg or graphical applications preinstalled, it is totally command line and is a blank slate for our purposes. I am a lets script this shit kind of guy, so that is what i did, I created some basic config files to get me started and write a shell script to install the software I regularly use, so once I get Ubuntu Server installed, updated and a new user created, I simply copied all of these files, plus the image I wanted to use as my background, over to my home directory via ssh and ran the setup script.

Some notes about what I did here. I removed snap because i have found snap applications run significantly slower than the normal repository versions, so I remove it to keep from accidentally installing from the snap store. I removed gdm3, because I want the system to boot into text mode by default, I will start DWM manually when I need it. You will note that I have two fairly complete sets of applications, text mode and GUI, I would say I am in the GUI 80% of the time, but I do have a bit of a fetish for the command line and sometimes I will spend a lot of time working in text mode only, and this gives me both for when I am in one of those moods. To answer the obvious question, yes I can be fairly productive at the command line, about the only things I can't do is play videos and the internet experience is less than optimal.

Well that is it folks, I have posted all the files below, so you can use them as a template for yourself so you can customize your setup without too much fuss.

Setup script:


# Update the system
sudo apt-get update

# Install text mode applications, tools and libraries
sudo apt-get install mc links cmus htop neofetch wordgrinder emacs-nox tmux alpine sc finch tpp net-tools i2c-tools build-essential -y

# Install GUI and applications, tools and libraries
sudo apt-get install xorg dwm suckless-tools dmenu feh rxvt-unicode firefox thunderbird gnumeric abiword pidgin pluma audacious vlc -y

# Clean up
sudo apt autoremove --purge snapd -y
sudo apt purge gdm3 -y
sudo apt-get autoremove -y
sudo apt-get clean

# Copy config files and fix some things
cp x.tmux.conf ~/.tmux.conf
cp x.xsession ~/.xsession
cp x.Xdefaults ~/.Xdefaults
mkdir ~/pictures
cp background.jpg ~/pictures
sudo cat wifi.txt >> /etc/netplan/50-cloud-init.yaml

 .tmux.conf file

# loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none

#  modes
setw -g clock-mode-colour colour5
setw -g mode-style 'fg=colour1 bg=colour18 bold'

# panes
set -g pane-border-style 'fg=green bg=white'
set -g pane-active-border-style 'bg=green fg=white'

# statusbar
set -g status-position top
set -g status-justify left
set -g status-style 'bg=green fg=white'
set -g status-left ''
set -g status-right '#[fg=white,bg=black] %d/%m #[fg=white,bg=black] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20

setw -g window-status-current-style 'fg=white bg=black bold'
setw -g window-status-current-format ' #I#[fg=white]:#[fg=white]#W#[fg=white]#F '

setw -g window-status-style 'fg=white bg=green'
setw -g window-status-format ' #I#[fg=white]:#[fg=white]#W#[fg=white]#F '

setw -g window-status-bell-style 'fg=white bg=green bold'

# messages
set -g message-style 'fg=white bg=green bold'

 .xsession file

# set background image
feh --bg-scale ~/pictures/background.jpg

# puts a clock in the upper right hand corner
(while true; do xsetroot -name "` date +"%I:%M %p %D"`"; sleep 5; done ) &

# starts DWM
exec dwm

 .Xdefaults file

URxvt*termName: rxvt
URxvt.buffered:         true
URxvt.background:       black
URxvt.foreground:       green
URxvt.cursorColor:      green
URxvt.underlineColor:   red
URxvt.scrollBar:    False
URxvt.perl-ext:         default,matcher
URxvt.urlLauncher:      /usr/bin/firefox
URxvt.matcher.button:   1
URxvt.transparent:    True
URxvt.shading:        50

 wifi.txt file to setup wireless

            optional: true
                "Access Point SSID":
                    password: "Password"
            dhcp4: true

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.