(2024-01-15) State of my A1370 (so far) and some minor news ----------------------------------------------------------- I promised to tell you what has been set up on my old MacBook Air A1370, so the time has come. As I already mentioned, after all my not so successful experiments, it runs Alpine Linux again, and I'm going to keep it that way from now on. However, the set of software I'm running on top of it is quite different this time, and as bizarre its choice might seem, it is purely a result of a series of experiments on its own. So, grab your snacks and let's begin from the very beginning. The main idea of my setup is to run everything (and I mean everything) from the bare console, without any X or Wayland sessions. At first I thought of using framebuffer-based terminals like fbterm or kmscon (to just be able to use the same font I got used to in X-based terminals), but they had introduced more problems than they solved, so I settled on the bare console with Terminus font (ter-u20b.psf.gz, to be exact). I don't fully like it but I couldn't really find any viable Unicode-aware (and particularly Cyrillic-aware) alternatives that would look decent in such an environment as of this moment. And yes, I created my own layouts using ckbcomp that fully mimic the X layout setting I'm using on my Arch/Garuda with the exception the console cannot use all three together so I just created two separate layout files for two pairs. But they are the same phonetic layouts and the switching is still with Caps Lock which is perfect for me. Still, one of my tty sessions does run a multiplexer. At first it was dvtm, but now I settled on a4 ([1]). Yes, I had to compile it but everything is flawless and the config is very powerful. I had also modified my shell information script to be able to output the information into a4's statusbar ([2]). Although in real life, I rarely use more two tags and open two windows per tag in it. And, of course, all video/gaming/browsing has to be done in another tty outside of it. I also manage sessions with abduco, although that one is more useful on my VPS. Speaking of video/gaming/browsing, I have been successfully using the following tools that involve (pixel-based) GUI of some sort: - Links browser in links -g mode: compiled it myself as the Alpine package version didn't have graphics enabled, had to install GPM just to enable mouse there (although it doesn't require GPM running, I actually disabled it afterwards as this daemon is pretty much useless with the A1370's touchpad) and install all sorts of extra graphics format libraries to support it and SSL too, TTF fonts are also supported just fine, very pleasingly surprised with the results and overall customizability of this browser; - Screenshooting with fbgrab, image viewing with fbi (lol) and PDF viewing with fbgs: the first two work amazing, the third one works... OK; - mpv video player: had to append nouveau.atomic=1 to the kernel command line, afterwards running it successfully with --vo=drm option (more on that later); - Crispy Doom: although the SDL2 backend here has some extreme troubles with mouse support (hence I couldn't get netsurf-fb to work), I've been able to use the keyboard and even a gamepad with Crispy Doom when exporting SDL_VIDEODRIVER=kmsdrm environment variable; - Schism Tracker: again, mouse doesn't work even with GPM running, but everything else works fine, especially in the fullscreen mode (although with this backend everything is fullscreen anyway, but the text becomes much crispier if you set it); - RetroArch: heck yeah! Unlike Mednafen that freezes the system even after displaying the help screen, RetroArch works wonderfully on the GL backend here (without the mouse, of course), even gamepad autodetection works. Just make sure to configure _both_ keyboard and gamepad correctly and independently, and don't forget to set correct system directories as well. Haven't yet tried livestreaming directly from it though, but I'm sure it's gonna be fun if it doesn't fry the hardware. And yes, of course I added my username to wheel, audio, input, video and netdev groups. Still no luck with SDL+kmsdrm mouse support here. It _might_ have something to do with me using busybox mdev instead of udev and/or Alpine's SDL2 being compiled without libudev support, but I'm not even sure how to test this out, and I'm definitely not going to replace the Alpine's version with my own. In case you didn't know, mpv also allows you to view YouTube videos and various platform livestreams if you also install the youtube-dl helper. In the Alpine testing repos (yes, I switched to the edge channel and also enabled the testing repo), you can find a wonderful utility called pipe-viewer that allows you to search and view YouTube videos anonymously... either through VLC or through mpv. So, in order to limit the downloaded picture to the 720p quality (as my A1370's resolution is 1366x768 anyway), I created two aliases for stream/video viewing and youtubing respectively: alias fbstream='mpv --vo=drm --ytdl-format="bestvideo[height<=?768][vcodec!=vp9]+bestaudio/best"' alias yt='pipe-viewer --player=mpv --append-arg="--vo=drm" -7' That's it. The first command also allows you to view e.g. Twitch streams. And there also are some CLI chat clients for Twitch that can be made use of (once you obtain the auth token from the website, that is). I found twitch-chat-cli ([3]) to work best for me, although yes, I did have to obtain the token on another machine and copy it over to the MacBook. Sad but true: Twitch requires you to use a bloated browser to auth into their API. Speaking of chats, the setup still is kind of in progress. At first, I wanted to use everything via WeeChat, but only weechat-matrix worked as expected: tox-weechat didn't compile, and weecord just hanged the entire application. So, I settled on the Toxic client for Tox and still don't know what to do with others. Maybe I'll just get away with Bitlbee and a simpler and more KISS-friendly IRC client. For now, it's not critical though. For other multimedia, I did install essential tools like mpg123, sox, alsa-utils, alsa-tools, alsa-plugins and ffmpeg, but I also installed mpd and mpc (as well as ncmcpp to quickly enqueue new music). Why? Because, first, Alpine doesn't have Open Cubic Player readily available and mpd already has tracker format support, second, I finally had an ambitious idea to make multimedia keys useful on the bare console. But for this to happen, some additional effort had to be made. And I did make it and create the nnkeys.sh script ([4]) that can read a separate config file and even daemonize itself. It is a clever combination of using evtest utility (has to be installed from a separate Alpine package) and AWK scripting to monitor exact keypresses and run command actions on them. Later on, I also introduced a privileged daemon mode to my nnlight.sh backlight management script, so that it could run on boot and all other nnlight.sh invocation just talked to that daemonized script via a named pipe without having to request the privileges. Also, since I don't use Bash at all there (only busybox ash and my favorite oksh which I made the default one), I cannot browse Gopher with my own Bopher-NG script. I also don't like how Lynx does it. So, what do I use? I use sacc([5]) that is even available in the repos. The only thing is, I had to change the $PAGER to most (again, yet another package) because more works incorrectly with it and less displays trailing ^M's on CRLF-terminated lines in text files. Other than that, sacc is a neat KISS-friendly Gopher client that even supports some TLS in case you need it there. For Gemini, I decided to use Amfora because it also has a ready-made Alpine package and because I didn't really like Bombadillo's controls and the fact it doesn't reset terminal attributes on exit. That's if for the state of A1370. As you can see, the setup is pretty much 90% complete and still is in progress, but it definitely was worth it, seeing the _peak_ RAM usage at around 550MB with a video being streamed with pipe-viewer + mpv and a bunch of daemons and links -g running in the background, and the normal usage (without video streaming) doesn't ever exceed 200 MB. Now, let's talk about some other news. First, I completed the mirror scripts for this very phlog and LuxDocs section for them to be available at https://hoi.st in (obviously Links-friendly) HTML2 format. This was done to ease sharing my materials with the "outside world normies" who don't want to install Gopher clients for some reason. As with all other static web pages on my VPS, the mirror is served via the spa-to-http container behind Traefik that, in turn, handles SSL and host-based routing. The setup already is time-tried and I doubt I'm going to move to anything else at this point. Another thing you might have noticed is that have I started sharing URLs to my own Git instance (https://git.luxferre.top) instead of SourceHut or GitLab. Yes, once SourceHut went down recently, I had had enough and decided to migrate to my standalone Git. What most githubbers don't realize is that Git package already has everything you need to create both private AND public Git repos (via the git:// protocol)... short of a Web server. It has a CGI-based Web interface but I don't quite trust it. So, with the thought "GitHubs must die" dominating my head in the second pard of the week, first, I quickly created a helper script called ghmd.sh ([6]) to ease setting everything up (except post-receive hooks), second, I chose stagit ([7]) as the Web UI generator for the repos' Web UI. It took me some time to set up everything correctly in terms of using post-receive hooks to autogenerate the repos on push, but now it works just fine. So, it's just a matter of time to migrate my repos out of SourceHut once it comes up, and also do the same for GitLab just in case. I also see there is something called stagit-gopher, but no, thanks. First, it generates the indexes in some non-standard format (a bit similar to my internal links format in Kopher) specific to another piece of software I'm definitely not planning to use, Geomyidae. Second, I think browsing the Git tree with Gopher is a bit overkill. If I want to create an index to publish here, it will just be a text file with git:// URLs autogenerated from the repo list and their descriptions, using the same "url", "owner" and "description" files in the repo directory that stagit uses. And that would be it. My repos are simple enough to clone and explore offline, and I don't want to mimic HTTP experience in a totally different environment. To sum all this up, this week has been extremely valuable for me as I was able to prove that there is life without X or Wayland, and there is life without third-party Git services. And yes, I feel sorry for Drew, but I also feel this is something I should have done a long time ago instead of opting for paid SourceHut subscription. I'm paying for the VPS anyway. --- Luxferre --- [1]: https://www.a4term.com/ [2]: https://git.luxferre.top/nnscripts/file/nnstatus-stdout.sh.html [3]: https://github.com/martinbjeldbak/twitch-chat-cli [4]: https://git.luxferre.top/nnscripts/file/nnkeys.sh.html [5]: gopher://bitreich.org/1/scm/sacc [6]: https://git.luxferre.top/nnscripts/file/ghmd.sh.html [7]: https://codemadness.org/stagit.html