Linux over the years has become easier to use and is gaining ground everyday over Windows. So if you haven’t gone to the Linux side of the force you should do it now.
I have a Pi4 running Bullseye (Debian 11) and I have been setting up my environment to run some things. I started with the Lite build from the Raspberry Pi website and added on what I wanted.
These days a lot of scripts depend on Python and there is a package manager for Python called Pip. It doesn’t come with it out of the box so I had to install it and update it.
sudo apt install python3-pip python3 -m pip install --update pip
On my setup it complained about the $PATH for the /home/$USER/.local/bin. Most likely because I use the Fish Shell instead of Dash. If you’re using fish you just add the path to the config.fish file.
set -x PATH $PATH /sbin/:/bin/:/usr/bin:/usr/sbin:/home/pi/.local/bin: function ll ls -lh $argv end
If you’re using a different user other then “pi” you’ll need to change what is in bold to suite your user name. After update/create the config.fish file you just logout and log back in and run the update command again.
python3 -m pip install --update pip
Now even with a Pi4 it is still much slower then a desktop and speed and memory is still valuable. For fun I wanted to use my Hantek USB scope so I downloaded OpenHantek. Thing is this software requires a X11 Server. I also don’t want to run a full window manager with it because I want all I can get out of the Pi so the Scope runs well. Lets install X11 and make it run only the OpenHantek software.
sudo apt install xserver-xorg sudo apt install xinit sudo apt install x11-xserver-utils sudo apt install xterm sudo apt install lightdm sudo apt install awesome awesome-extra
The last two commands installs the light Display Manager and the Awesome Window Manager but this is only to test things and make sure X11 is running properly. just run the command startx and X11 should start up. From there you can reboot.
When it’s back up again at the command prompt download the OpenHantek ARM binary deb file and install it with apt.
cd ~ wget https://github.com/OpenHantek/OpenHantek6022/releases/download/3.2.5/openhantek_20211216-31c5ee2_armhf.deb sudo apt install openhantek_20211216-31c5ee2_armhf.deb
Now we need to disable lightdm because if we don’t then X11 will crash.
sudo systemctl disable lightdm
Now we can edit the .xinitrc file and the only line in the file should look like this.
nano ~/.initrc /usr/bin/X11/xterm & exec /usr/bin/OpenHantek
Now when you run startx it will only load up OpenHantek. When you quit the program it will go back to the shell console.
This trick works on a lot of software as long as it’s not tied to a Window Manager. For fun I created a BASH Menu so instead of X11 loading up a certain program from the xinitrc file I have only a xterm instance running and with the bash menu I can load up programs such as OpenHantek and Sublime-Text.
#!/bin/bash echo "SELECT PROGRAM"; echo "1. OpenHantek" echo "2. Sublime-Text" echo "0. Exit from menu " echo -n "Enter your menu choice [1-2]: " while : do read choice case $choice in 1) echo "You have selected the option 1" /usr/bin/OpenHantek | clear ;; 2) echo "You have selected the option 2" /snap/sublime-text/113/opt/sublime_text/sublime_text | clear ;; 0) echo "Quitting ..." exit;; *) echo "invalid option";; esac echo "SELECT PROGRAM"; echo "1. Sublime Text" echo "2. Open Hantek" echo "0. Exit from menu" echo -n "Enter your menu choice [1-2]: " done
This is a real old school way of doing it but it works.