_           _                 
 | |_ ___  __| |____  ___ _   _ 
 | __/ _ \/ _` |_  / / _ \ | | |
 | ||  __/ (_| |/ / |  __/ |_| |
  \__\___|\__,_/___(_)___|\__,_|

How to build Jotz Live (Debian 13.1 trixie)

date: 30 Oct 2025

Introduction

The instructions below document the process I follow to build my own personal Linux distribution (based on Debian Live), which I call Jotz Live. I rebuild the .iso image every few months to update the versions of the included packages, as well as to add new packages. In between rebuilds, I can try out other packages as normal using apt install, but the changes will be lost at the next reboot.

When I originally began building Jotz Live, I used the examples provided here as my starting point:

Preparing to use Debian Live

First, boot the PC into Debian 13.1 (Trixie using the standard USB live image. (Alternatively, use Jotz Live 13.1)

sudo apt update
sudo apt install live-build

If you're going to build the custom image on a removable drive, you may need to remount it with the appropriate flags set, as shown below (replace the path shown with the one for your device).

sudo mount -o remount,exec,dev /media/user/[YOUR DEVICE NAME GOES HERE]

Custom build configuration

mkdir JotzLive
cd JotzLive/

The following command creates a configuration for the build process.

lb config -d trixie --archive-areas "main contrib non-free-firmware" --parent-archive-areas "main contrib non-free-firmware" --bootappend-live "boot=live locales=en_GB.UTF-8 keyboard-layouts=gb timezone=Europe/Dublin user-default-groups=user,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev,scanner,dialout"

Notes:

  1. The "--archive-areas" and "--parent-archive-areas" options include "non-free-firmware", so that wifi firmware is included. Note that "firmware-linux" is also included in the package list below.
  2. The "dialout" group is included in the list of the live user's groups using "--bootappend-live" option so that serial port can be accessed by e.g. the Arduino IDE.

Selecting packages for custom build

Create a file my.list.chroot containing the list of packages to be included in the custom build.

echo "task-xfce-desktop firmware-linux build-essential printer-driver-all v4l2loopback-dkms exfatprogs live-build vim-gtk3 geany gedit hexedit inkscape gimp imagemagick feh ristretto gphoto2 ffmpeg mplayer vlc mpg123 audacity blender kdenlive obs-studio screenkey gromit-mpx chromium lynx w3m elinks wget curl filezilla freerdp3-x11 gcc clang rustc git gh gdb cgdb ddd freeglut3-dev gcc-arm-none-eabi gdb-multiarch openocd python3-matplotlib python3-scipy python3-serial python3-pygame python3-opencv php octave screen tmux figlet xterm stterm kitty pv xclip htop bpytop fzf gdu ncdu bat ranger mc trash-cli fastfetch wmctrl xdotool testdisk netcat-openbsd jq cmatrix hollywood pandoc texlive texlive-xetex psutils fonts-ibm-plex fonts-ebgaramond-extra fonts-ebgaramond fonts-adf-universalis librsvg2-bin fonts-beteckna fonts-linuxlibertine gpxviewer gpsbabel wine fontforge libfuse2 sshpass ncal datamash" > config/package-lists/my.list.chroot

Automatic login script to apply final desktop tweaks

Add some additional commands to a setup script, "setup.sh", that will be placed in the default user's home directory. This can be used to make some final tweaks to the desktop (e.g. set number of workspaces, remove desktop icon) at login time:

mkdir -p config/includes.chroot/etc/skel
cat > config/includes.chroot/etc/skel/setup.sh << 'EOF'
#!/bin/sh

# Set number of workspaces to two
xfconf-query -c xfwm4 -p /general/workspace_count -s 2

# Hide desktop icons
xfconf-query -c xfce4-desktop --create -t bool -p /desktop-icons/file-icons/show-filesystem -s false
xfconf-query -c xfce4-desktop --create -t bool -p /desktop-icons/file-icons/show-home -s false
xfconf-query -c xfce4-desktop --create -t bool -p /desktop-icons/file-icons/show-removable -s false
xfconf-query -c xfce4-desktop --create -t bool -p /desktop-icons/file-icons/show-trash -s false

# Remove window tiling keyboard shortcuts that use the numeric keypad
for k in `xfconf-query -c xfce4-keyboard-shortcuts -l | grep "/xfwm4/custom/<Super>KP"`; do xfconf-query -c xfce4-keyboard-shortcuts -p $k -r; done

# Set up new window tiling keyboard shortcuts
xfconf-query -c xfce4-keyboard-shortcuts -pn "/xfwm4/custom/<Super>Left" -t 'string' -s tile_left_key
xfconf-query -c xfce4-keyboard-shortcuts -pn "/xfwm4/custom/<Super>Right" -t 'string' -s tile_right_key
xfconf-query -c xfce4-keyboard-shortcuts -pn "/xfwm4/custom/<Super>Up" -t 'string' -s tile_up_key
xfconf-query -c xfce4-keyboard-shortcuts -pn "/xfwm4/custom/<Super>Down" -t 'string' -s tile_down_key

# Identify connected monitor and store name in shell variable
monitor=`xrandr -q | sed -n '0,\|[[:space:]]connected[[:space:]]| s/^\([^[:space:]]*\)[[:space:]]\+connected[[:space:]].*$/monitor\1/ p'`

# Disable wallpaper on connected monitor and set flat background colour
xfconf-query -c xfce4-desktop -pn /backdrop/screen0/$monitor/workspace0/color-style -t 'int' -s 0
xfconf-query -c xfce4-desktop -pn /backdrop/screen0/$monitor/workspace0/image-style -t 'int' -s 0
xfconf-query -c xfce4-desktop -pn /backdrop/screen0/$monitor/workspace0/rgba1 -t double -s 0.4 -t double -s 0.4 -t double -s 0.6 -t double -s 1.0

# Enable touchpad tap to click
xfconf-query -c pointers -pn /SynPS2_Synaptics_TouchPad/Properties/libinput_Tapping_Enabled -t 'int' -s 1
xfconf-query -c pointers -pn /DELL0A2000_06CBCE65_Touchpad/Properties/libinput_Tapping_Enabled -t 'int' -s 1

# Create browser profiles one and two
firefox -CreateProfile one
firefox -CreateProfile two

# Set up shortcuts
echo "firefox -P one -private-window about:profiles &" > ~/one
echo "firefox -P two -private-window about:profiles &" > ~/two

chmod 755 ~/one ~/two
EOF

Set the mode of "setup.sh" so that it's executable:

chmod +x config/includes.chroot/etc/skel/setup.sh

To run the above setup script automatically at login, autostart it by creating the file MyDebLive.setup.desktop, as follows:

mkdir -p config/includes.chroot/etc/skel/.config/autostart
cat > config/includes.chroot/etc/skel/.config/autostart/MyDebLive.setup.desktop << 'EOF'
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=MyDebLive.setup
Comment=
Exec=/home/user/setup.sh
OnlyShowIn=XFCE;
RunHook=0
StartupNotify=false
Terminal=false
Hidden=false
EOF

Add dot files for vim and tmux

Create ".vimrc":

cat > config/includes.chroot/etc/skel/.vimrc << 'EOF'
" Disable compatibility with vi
set nocompatible

" Filetype detection and configuration
filetype on
filetype plugin on
filetype indent on

" Syntax highlighting
syntax on

" Remap up and down arrow keys to move cursor
" one screen line in normal and visual modes
:noremap <Up> gk
:noremap <Down> gj

" Remap up and down arrow keys to move cursor
" one screen line in insert mode
:inoremap <Up> <C-o>gk
:inoremap <Down> <C-o>gj

" Enable line numbers
set number
"set nonumber

" Set tab width
set shiftwidth=4
set tabstop=4
set expandtab

" Set colour scheme
colorscheme ron 

" Disable Vim mouse interaction, which re-enables
" regular terminal highlighting with mouse
set mouse=
EOF

Create ".tmux.conf":

cat > config/includes.chroot/etc/skel/.tmux.conf << 'EOF'
set-option -g escape-time 10
set-option default-terminal tmux-256color
EOF

Fix for wireless keyboard scrolling post-resume from suspend

Use a heredoc to create a file "/lib/systemd/system-sleep/post-suspend.sh" in the live system that will reload the usbhid module every time the system resumes after suspend. The file permissions are also changed to make the file executable.

mkdir -p config/includes.chroot/lib/systemd/system-sleep
cat > config/includes.chroot/lib/systemd/system-sleep/post-suspend.sh << 'EOF'
#!/bin/bash
if [ "${1}" == "post" ]; then
modprobe -r usbhid && modprobe usbhid
fi
EOF
chmod +x config/includes.chroot/lib/systemd/system-sleep/post-suspend.sh

Build the live image

As root, build the bootable live image. This may take several minutes.

sudo lb build

NB The following can be used instead to log the output during the build process:

sudo lb build 2>&1 | tee build.log

Write the image to a USB key

N.B. It is extremely important to identify the correct device filename of your USB drive (e.g. /dev/sdb, /dev/sdc, etc.) before writing the image to it. Writing the image to the wrong device using the command provided below will destroy the data on that device.

Still as root, copy the completed image to a USB drive. This may take several minutes to complete. The sync command ensures that all data has been written to the USB drive before it is removed.

sudo cp live-image-amd64.hybrid.iso /dev/[USB DRIVE DEVICE FILE NAME GOES HERE]
sudo sync

The USB key can now be unplugged and should be ready to use.

Create a backup copy of the iso with today's date added to the filename:

mv live-image-amd64.hybrid.iso `date +%Y.%m.%d_live-image-amd64.hybrid.iso`

Change log

Changes in next version:

  1. Add package openscad.
  2. Check if servers such as ssh, etc. are listening by default. Lock things down.
  3. Maybe add texlive-extra-utils? (for pdfjam, which allows multiple pdf pages to be combined into one).
  4. Maybe add "z3" package (solver)? Deferred for now, pending clarification on whether to use z3 app or python z3 library.
  5. Maybe add "openssh-server" package? I've postponed this until I understand the security implications more clearly.
  6. Add keyboard shortcuts to tile windows left, right, up, down. To set these manually, go to Applications -> Settings -> Window Manager -> Keyboard. Further research required on how to set them by script.
  7. Possibly toggle presentation mode on? xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T. To check current status of presentation mode: xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -v
  8. Add power manager and volume control to system tray. Right click task bar -> Panel> -> Add New Items -> PulseAudio Plugin + Power Manager Plugin. Probable approach is to add the power and audio plugins manually once, then copy the relevant lines from ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml to /etc/xdg/xfce4/panel/default.xml.
  9. Remove XFCE panel 2 (launcher bar at bottom of desktop), probably by editing /etc/xdg/xfce4/panel/default.xml
  10. Add package python3-tinycss2 to enable Inkscape's gear rendering extension.
  11. Disable system bell to prevent occasional loud beeps.

Changes in 30-Oct-2025 version:

  1. Now based on Debian 13.1 trixie. Note change in first step, "lb config -d trixie..."
  2. I was planning to remove/disable apache2, but it seems to be gone already - maybe no longer installed by default?.
  3. Added librsvg2 (package name librsvg2-bin) to support direct insertion of SVG images in a pandoc markdown document.
  4. Added GNU datamash, which is "a command-line program which performs basic numeric,textual and statistical operations on input textual data files" (package name: datamash).
  5. Added package python3-opencv for image processing in Python

Changes in 05-Jan-2025 version:

Changes in 15-Aug-2023 version:

  1. Added "non-free-firmware" to "--archive-areas" and "--parent-archive-areas" in "lb config" command.
  2. Added figlet package.
  3. Removed "julia" package because it seems to have been removed from Debian 12 Bookworm.
  4. Changed "exfat-utils" package to "exfatprogs" because the former seems to have been removed (and maybe additional exfat support is built in by default?).
  5. Removed "pandoc-citeproc" package, which seems to be gone in Debian 12 Bookworm (possibly now built in to pandoc?).
  6. Removed "tilde" and "micro" packages (both terminal-based text editors).
  7. Added "wine" package for running LTspice.
  8. Changed package "vim-gtk" to "vim-gtk3".
  9. Added "fontforge" package.

Changes in 13-Jan-2023 version:

  1. Re-organized packages in list for better readability and to hopefully fix file associations.
  2. Added freerdp2-x11 back in.
  3. Replaced vim with vim-gtk to enable clipboard functionality (still runs in terminal).
  4. Added terminal emulators: xterm stterm kitty
  5. Added mpg123 for internet radio.
  6. Removed tldr, because it required additional step to actually download documentation before it worked.
  7. Added steps to create .vimrc and .tmux.conf in the home directory of the live system.

Changes in 13-Dec-2022 version:

  1. Additional packages for pandoc references: pandoc-citeproc
  2. Additional packages for ARM development: gcc-arm-none-eabi gdb-multiarch openocd (add Frank Duignan's build script, etc. also?)
  3. System monitors / process control: htop, bpytop
  4. Useful free font family from IBM: fonts-ibm-plex
  5. Terminal text editors: vim tilde micro
  6. Terminal multiplexer: tmux
  7. Fuzzy find tool: fzf
  8. Disk usage analyzers: gdu, ncdu
  9. Alternative to cat with extra stuff: bat
  10. File managers: ranger, mc
  11. Command line apps: trash-cli, neofetch (display system info summary)
  12. GNU debugger: gdb
  13. Terminal browser(s): lynx, w3m, elinks
  14. Eye candy: cmatrix, hollywood?
  15. utilities to copy text to system clipboard (e.g. in Vim): xclip
  16. Community driven man pages alternative: tldr (need to run "tldr -u" after install to update content)
  17. Removed these: texstudio texlive-latex-extra darktable openfortivpn freerdp2-x11