A fledgling bash function library
+2025-05-16
+Messing with bash functions
+I needed a function for writing colour text, so I thought why not start a library +and learn some bash scripting? Anyway, it's up on my git repository.
+ +From 420ceb49b53a8fa9d8ba8443e42e50cd7bd7cea9 Mon Sep 17 00:00:00 2001
From: Philip Wittamore I needed a function for writing colour text, so I thought why not start a library
+and learn some bash scripting? Anyway, it's up on my git repository. I had previously upgraded the bios
+on this machine so I could whitelist future hardware. The new card was easy to install: remove the keyboard by unscrewing 2 screws under the RAM trapdoor Carefully remove the keyboard by sliding it towards the screen to uncover the lower tabs and unplug it,
+then remove the screws holding the palmrest and remove the palmrest carefully unplugging it. The wifi card socket is on the right next to the M2 ssd socket I removed pin 51 on the AC7620 with a dremel rather than using tape. Pin 51 is used to activate or deactivate certain card functions,
+including Bluetooth, and can be problematic on certain thinkpads. I did the same for my T430. See also Deactivating the X220 internal Bluetooth controller I downloaded all my purchased books, around 500, before Amazon terminated the possibility. Even though it says "purchase" on their site in reality they are now selling you a license, and only allowing books to be read on Kindles.
+ Enough of this. Using Calibre I created a library that can be read on any ebook reader, and purchased a Kobo Clara colour.
+ Now I'm as happy as a pig in muck. Oh and Amazon, I won't be buying books from you any more. There's more than enough alternative sources. ** I love Glynn Stewarts science fiction stories, but most of his work is
+published on Amazon. The solution was simple, I subscribed to Glynn's Patreon account and
+receive advanced copies of his books that I can read on any reader. https://www.patreon.com/glynnstewart That said, I've read nearly all of Michael Connelly's books but some of
+his ebooks on Google or Kobo are country restricted. For example I' unable to purchase the
+full series of the Jack Macevoy series because I'm in France. WTF? All this
+does is tell me to get a book from another author. Get a clue guys! Anacron ensures cron scripts are run on machines that are frequently powered off On Artix it can be run via cron (cronie) So I deactivated it. Got a red touchpoint for that! edit ~/.config/wikiman/wikiman.config to your liking. I use the chawan browser instead of w3m for example. Note: wikiman can be used in the TTY which can be a life saver if you have borked your installation. Back in 2001 I was using Pyradio with Cava on Manjaro with i3 Today I'm using the same apps on Arch Linux with DWM Not quite sure if I'm going backwards or forwards... Here's a handy app that fills pyradio with a few thousand stations I tried several bash prompt scripts but returned to just having a single line in my .bashrc This site is a great generator I used the base 16 colour palette so that it ends up displayed using the Pywal16 terminal palette. But there is hope. Betterfox makes your Firefox safer and faster by modifying user.js There's a lot of super interesting information on the site too. I've added my blog scripts to the git server just in case someone
+needs a quick simple blog like this one. Blog articles are simply html, the site structure is on your computer
+and there are a couple of Bash scripts to manage it: Note that these Bash scripts rely on your having set up ssh correctly to allow
+you to ssh to your web server without entering a password. The articles are listed by three php files that include a search form. Many years ago my window managers were FVWM and Windowmaker, and they were a great deal of fun. Installing DWM is a breath of fresh air, giving me a bit of nostalgia for the good old days.
+ I'm trying to not fall into the trap of patching DWM to death and adding useless bling, just keeping it simple. However, today I installed xscreensaver and my screen lit up reminding me that like the indie web, older stuff can be fun. Here's my totally not objective shortlist to date I obtained some HRC61~63 steel rods and made my own carbide wood turning tools. As the rods are 12mm with a round profile instead of square, presentation of the carbide cutters at various angles, not just 90° is enabled.
+My thinking was that I needed some beefy handles to provide leverage and facilitate control.. The handles are made of Ash, and came from the winter woodpile. A more noble end than being thrown in the woodburner. First impressions are good, specially the round cutter. It looks like these tools are shapers, and position themselves between
+the roughing gouge and finition. Note that you'll need a hss+cobalt drill bit to make a hole in the hardened steel shafts. Shafts: Linear bearing shafts, 12mm x 600mm Carbide inserts: I might get some diamond shaped carbide cutters too, but I have some home made hss tools that do roughly the same job. See here and here
+for more of my home made lathe tools #woodturning #tools #homemade Retrieve the primary key to enable the installation of our keyring and mirror list Install the chaotic-keyring and chaotic-mirrorlist packages Append (adding at the end) the following to /etc/pacman.conf Run a full system update along syncing the mirrorlist The repository is ready to use! 🚀 Since I've got a fibre connection I've been musing about not paying for a VPS and using a home server instead. I have an unused laptop that could fit the bill maybe. The advantage of a laptop is that 1) I have one and 2) No need for
+a ups or screen. I'm not really sure that I'll build a home server like this, but I'm collecting info. One of the things I was wondering is how to stop a laptop from entering suspend when the lid is closed. I found a
+comment on unixstackexchange that explains how to do it on a non-systemd installation. (and a systemd one too but who cares about that?) Find the path of the lid switch: Find the line for the lid and enter the command to deactivate it, for example: If it works, you can add the above line to /etc/rc.local to make it permanent. On systemd installations, edit /etc/systemd/logind.conf and uncomment the following line: HandleLidSwitch=ignore. Powersave, and Performance Attempting to use any other in tlpui will not give the desired results Check available govenors: See also: Linux
+power consumption control The offers are Unfiltered resolution, Protective resolution, Protective with Child Protection,
+Protective with Ad blocking, Protective with Child protection and Ad blocking DWM isn't a desktop environment, so there are a few things to add, like notifications and
+audio keys. I installed dunst and acpid. Dunst is managed by systemd, if you edit ~/.config/dunst/dunstrc
+restart dunst with systemctl --user restart dunst.service The audio keys are registered in dwm/config.h
+ The audio keys run a bash script which sets volume, speaker mute, and microphone mute. I'm running Arch Linux on a Thinkpad X220, so I need to make the mic/mute button's led
+lights up when muted. This can't be done with normal user permissions, so I installed acpid.
+On Arch linux all acpi events are passed to /etc/acpi/handler.sh, so I added another
+function to this file.
+ This is intended for my own records, I don't use git yet, perhaps I should look into it. I haven't added any patches to my dwm 6.5 source code, but I have modified dwm.c to enable circulating through tags,
+and edited config.h to play nicely with Pywal16 and my French keyboard. Super+Shift+Left/Right keys circulate through tags I added this at line 235 I added this function at line 2067 Here is my modified config.h https://tools.suckless.org/slstatus/ After fiddling with dwm-blocks and dwm-bar, I decided that the only thing I want to see
+in my status bar is battery info and date/time. The rest can be done with btop and alerts. So I cloned the slstatus source code from suckless.org and added the following in slstatus/config.h As I'm using the Jetbrains mono nerdfont in DWM I added some icons in slstatus/components/battery.c No pretention here, just learning. Let me know if I should keep my day job :-) I have upgraded my server to the latest Debian version, Trixie (13) without problem. Mailcow have posted some simple steps to follow here An interesting addition for smartphone driven boycotts Détrumpez-vous is an app for iPhone and Android that signals products that are of American origin. I'm going to test this on my weekly shopping. I've updated my dmenu fork, it now has the following patches: I've also tweaked the patches to work with xresources. I wanted to keep my status bar simple, and slstatus fitted the bill But I was missing an indication of the CPU temperature as I got tired of using conky
+as it was only visible on empty DWM tags, and I didn't want to try writing a program in C to do it. So a new status monitor was needed. I liked the idea of dwmblocks firing up bash scripts,
+but I tried the original and several forks without luck. I finally settled on
+dwmblocks-async, because it is more recent and ... it worked. Artix Linux is mostly Arch Linux, minus systemd of course, and plus packages that
+replace it's absence. In order to access packages that may not be available via Artix, it's possible to add
+the Arch Linux Extra Mirror. Edit /etc/pacman.conf and activate the mirror. Populate the Arch Linux keyring and synchronize the repository I edited my .bashrc to alias ls to eza like so: Pretty I inherited a small low angle block plane from my dad. Nice looking with brass buttons, but upon inspection the blade wasn't straight.
+I removed it and checked, it was square and just needed sharpening, but when I looked at the cast iron base,
+the seat of the blade at throat level was thicker on one side, making it impossible to align. The sides were also both slightly more that 90° which didn't help. The easiest solution was to remove the adjustable front throat and reform the blade seat with a file. It worked, and after flattening the foot of the plane and sides using sandpaper on a granit slab,
+ then sharpening the blade I now have a very nice block plane. I wouldn't mind having half the garden for wild flowers, although I'm not
+sure what the maintenance would be like, there's a lot of native flora that is
+a pain here in Brittany. Anyway I sowed a small patch to see what happens, a trial run. I'm sure the bees
+will appreciate. Here's Newsboat opening an article with Chawan inside Ghostty: When I ssh into a vps I found some keys where not working in mc (midnight commander). The solution was to edit ~/.ssh/config and add: Nothing much there yet, but I've got cgit running... After all I've said against Gopher and Gemini, I've started my own Gopher hole. Just proves humans are fickle and you shouldn't listen to my rants and I'm an incorrigible fiddler. You'll need a gopher browser such as Lagrange (GUI) or
+Lynx (TUI) for this link: gopher://nagatha.fr and my backup machine was in an unstable state for a while and I hadn't fixed it. Examination of my collection of USB keys found no linux installer, so I was stumped through lazyness. But at the bottom of a pencil holder I found another usb key with an old copy of Linux Mint which enabled me to download Arch and recover. Luckily all my inportant files were saved, and I use Bitwarden too, so with a new SSD I was quickly back up and running. It doesn't have a screen so I'll need to do a headless installation I found some simple instructions here: https://tarneo.fr/posts/arch_headless/ Find the IP address of the machine, and ssh to it. You can then run
+archinstall for example. The center element in html is depreciated, and validation of the page shows warnings.
+Instead the use of the css style text-align:center is precognised. But this is ignored in terminal text browsers, and I prefer some sort of consistency, so I've removed center elements and text-align css.
+The page itself is centered setting margins. Chawan gives the best rendering on the terminal, here I'm using Ghostty. The package chawan-git in the AUR doesn't compile as the included NIM version is too old Here's how I installed it in Artix Linux Install the NIM compiler from https://nim-lang.org/install.html The default dependancies were already installed on my hard disk: (OpenSSL, libssh2, brotli) And it's done. I use mostly use chawan as newsboat's browser, it's really good. Thanks to Kachick Previous article: rdrview or chawan An enjoyable 3 hour radio time machine Like everything, there's a learning curve due to the multiplicity of options. The first thing I did was copy the Bookerly font to the Koreader fonts folder on the Kobo, as I find the default Noto fonts too ugly for reading. The second thing I did was remove the Koreader installation log file and
+logo which stuck out like a sore thumb in the file manager The third thing I have to do is read the user guide... Anyhow reading is a pleasure once I fixed the font, font size, and line spacing The Ladybird web browser is truly something different, and a hope for the future. It has no connection to Google, no rehash of older web engines, with no corporate influence looming over it. Written transparently, W3C standards compliant, it will be available for public beta in 2026, with release is planned for 2028 There's an aphid eating light at the end of the tunnel. My bird feeder only has Blue Tits, Coal Tits, and sparrows - but you never know. Bretagne Vivant - comptage des oiseaux Bretagne Vivante has been Brittany's leading association for the protection of nature and biodiversity since 1959.
+Recognized as a non-profit organization, it works on a daily basis to improve knowledge and preservation of the region's natural heritage.
+It also manages a network of protected sites and nature reserves throughout Brittany and Loire-Atlantique.
+Passing on and sharing its passions is also at the heart of Bretagne Vivante's missions. saving laptop battery power without the need to delve deeper into technical details. TLP’s default settings are already optimized for battery life, so you may install it and just sit back and relax. Nevertheless, TLP is completely customizable to get even more power savings or meet your exact requirements. I enabled the panel cpufreq plugin on my Thinkpad X220 and saw that AC/BAT power changes
+were handled correctly I've been using Lynx as a Gopher browser on Artix Linux,
+and I like it a lot as it renders cleanly, has logical
+keybindings, and enables following html links. But... Trying to open video files with an external application
+wasn't working. Luckily on one test I saw an error
+concerning "mpeg_play". The only mention of this file is as a VIEWER entry in
+lynx.cfg. But changing it to something else has no effect
+at all. Somewhere in lynx, mpeg_play is hardcoded. 🤔. Checking the Lynx source code, I found it in HTInit.c Why short circuit the config file this way? Anyway, I wrote a bash script named mpeg_play:
+#!/usr/bin/env bash chmod +x mpeg_play and put it in my PATH and it works! The question remains: why is this hard coded? As for mpeg_play, it appears in Linux mailcap
+entries in the 90's and seems to have been bundled
+in ximagetools. Mpeg_play appears to date back a long way as a UNIX application: http://www.geom.uiuc.edu/software/mpeg_play A little tweak made this script capable of opening playlists
+
+ ----------
+#!/usr/bin/env bash ---------- The latest version can be found at git.wittamore.fr While updating Mailcow this morning Docker gave me a "too many requests" error. It seems that Docker now limits the IPv6’s subnet instead of the IPv6 address itself, which
+could mean your pull limit is shared. To fix this you can create a personal account at docker.com, this will allow 200 image pulls per 6 hours.
+My Mailcow installation does 7 pulls for an update. Once the account created, copy the personal access token, go back to your server and enter docker login -u (login) Mailcow will now update without error. This is roughly what I did to have an Nginx web server on the same machine as dockerized
+Mailcow Note: mail.xxxxx.com is your mail server (MX), yourdomain.com is whatever domain you wish to use. The problem is that Mailcow can no longer use port 80 to update it's ssl certificates that
+are used by postfix and dovecot. Instead certbot puts them in /etc/letsencrypt/live.
+To fix this the following script runs from crontab daily. Inspiration: Felix Moesbauer Don't forget to check and correct if necessary your DANE and MTA-STS records if you use them On your mail server: Create a TLSA record: The last line or the result will be something like: Enter this TLSA line in your mail server's DNS record. Do the same for the following ports: You can check your DANE records at huque.com This is a fallback to DANE, you can run both. Note: https access to mta-sts.yourdomain.com is obligatory You can check your domain's MTA-STS at mxtoolbox.com
+ All this worked for me :-) I hope it does for you! The X220 has a notoriously bad internal microphone. It can be somewhat improved by making the input mono with module-remap-source
+ /etc/modules-load.d/microphone.conf Replace master= with your device, and master_channel_map= with the device's channel It's a bit better, although an external usb microphone is the real solution. This is a modification of the default dwm-battery script If you haven't noticed, I'm blogging (phlogging) on my gopher site now. If you have a termnal, install lynx and point it to gopher://wittamore.fr If you don't, point your web browser to gopherproxy,
+the results are not as good but you'll get the gist. Inspiration from Bread on Penguins and BugsWriter I've been messing with DWM patches but I went back to naked DWM.
+The only caveat is a couple of lines of code in dwm/config.h to integrate Pywal16,
+that allows me to have a colour theme that matches whatever wallpaper I'm using. It's possible to patch DWM with the Xresources patch but patches are version dependant and can be a pain.
+I prefer simple and maintainable. Install pywal16 In dwm/config.h I removed the default colour settings: and replaced them with this line: In my .xinitrc I have wal -Rq which recalls the last wallpaper setting. This script chooses the wallpaper then recompiles dwm and dmenu. Note: I use RBW to access my Bitwarden password vault on the command line or in
+scripts, so I need to make sure it is unlocked before running Neomutt, hence
+the Exec line in the desktop entry. RBW sudo pacman -S rbw I've updated my builds of dwm, dmenu, and st, available on my git server Although I've compiled St, Kitty and Ghostty are my favorite terminal emulators. St has many patches, but not all of them work together. St is meant to be a bare bones -suckless- terminal emulator. The DWM build has the xrdb, rotatestack, adjacenttag, center, statuscmd and swallow patches. I was using slstatus with time and battery indications, but dwmblocks-async adds bit of flair. Dmenu has the xresources and center patches. curl is able to access gopher files, and newsboat has an "exec" command
+that can be used run commands. So to read a gopher rss feed you can simply edit .newsboat/urls and add the following line: "exec:curl gopher://url" For example: "exec:curl gopher://lucio.albenga.es/0/lfa/en/phlog/rss.xml"
+ Some really interesting videos, Bread on Penguins is taking up where
+ Luke Smith left off
+ So with my nice new DWM installation I waltz into a Jitsi meeting only to find that my microphone
+wasn't working even though it appeared to. Something was missing in pulseaudio after I removed XFCE4, or
+wasn't taken into account in DWM. Then I noticed that Librewolf was looking for Pipewire. What? Eventually I got it working, but the microphone was distorted and full of parasites.
+Adding a module remap to
+turn the two laptop microphones into mono was a tad better but I decided go for the bleeding
+edge and install Pipewire instead of Pulseaudio. Follow the instructions at Noise suppression for Voice In order to change the default source: And that's the best I'll probably ever get out of the internal X220 microphones. Why not just use Alsa? Because I use a bluetooth headset and noise suppression. Why not just use an external microphone? I've ordered one :-) Just to add, Bluetooth Autoconnect was built for Pulseaudio but works fine with Pipewire. Bluetooth autoconnect will connect any client that is paired and trusted, in my case a headset. If you use Chaotic-Aur, pacman -S bluetooth-autoconnect will install it. Use yay -S bluetooth-autoconnect if not. I found the solution here: udev desktop notifications I'm building a list of RSS feeds that work in the terminal.
+There are a lot of feeds out there but not all of the linked articles display well. Basically it's a question of whether the page linked in the RSS feed is displayed well in
+a text browser, which isn't always the case. I find the Chawan text browser gives the best
+web display in general and includes images, so I'm using it as a benchmark. It's always possible to use rdrview to pre-format the text before sending to cha,
+with browser "rdrview -B cha %u" in .newsboat/config, but this removes the images. This is an ongoing task so it will probably end up as a static page I started using the Jetbrains font for this blog, but adding the font in the css file makes it
+pretty heavy, and I've been considering removing it. BUT... I stumbled on this post
+and tried Neil's suggestion on the JetbrainsMono-Regular truetype font, and the font filesize was reduced from 274k to 66Kb So I decided to try it on the JetBrainsMono Regular Nerdfont, a whopping 2.4Mb, but the result was even better, 18Kb! Understanding why will take a bit of forensics, in the mean time this blog has become much lighter. I wound up just using the default monospace for the main text, and Ultra (reduced) for the title . Sudo is quite bloated and not without security problems. It is intended to cover situations
+that normal Linux users will never encounter, and its configuration is messy. Doas is an application from OpenBSD that is simpler and cleaner. Here are the steps I took to install doas and replace sudo: Add my username to the group wheel: Create /etc/doas.conf and add: Modify the ownership and permissions: You should now be able to remove sudo: Create a symlink to sudo So now it would be nice to have the equivalent of sudoedit. Create /root/scripts/doasedit (I use the micro editor): Create /usr/local/bin/doasedit: Modify the permissions Test doasedit: add this line: save and you should see: My Diskstation isn't always on, so I run this from the command line rather than cron. To avoid errors devices and links are skipped, permissions, times, group and owner are not written and files are compared by size only. Ssh is configured with ssh-copy-id for passwordless access and host:port details in .ssh/config The Thinkpad X220 has a screen resolution of 1366x768 (16:9), which suits the size of the 13" screen,
+but sometimes you stumble on applications that have gui elements that are taller than the screen. In Linux, it's possible to change the screen scaling to emulate a larger screen with xrandr.
+It won't look as crisp as the real resolution, but might get you out of a bind. This command will emulate a 1920x1080 (16:9) screen: or 1600x900: To return to the original scaling, type: On the other hand , if you have for example a 1920x1080 (16:9) screen but would like to
+scale down to 1600x900 In XFCE4, you can also magnify the resolution in you can also do this on the command line with where SCALE is either 1 or 2
+ I've started using this tool to clean up my scripts. Testing via the web
+ interface displays links to explanations of the errors or warnings found.
+ Other apps have user IDs: Signal, Matrix, Session, Briar, Jami, Cwtch, etc.
+SimpleX does not, not even random numbers.This radically improves your privacy. Slim is an lightweight login manager that has been ressurected, patched, and improved. Oh the power of open source software... My default locale is en-US, but I wanted to display weekdays in French in the slstatus bar. The solution is to add setlocale to the function in I got fed up with the powerline prompt and installed starship
+with the gruvbox-rainbow preset. And with that, I'm done for the day. Xlibre released for testing on Artix Linux Artix is becoming what Arch should have been. While corporations have been instrumental in Linux's progression over the years,
+allowing them to forge Linux into a new sort of Windows where applications are becoming totally phagocyted by a
+few pieces of software (Wayland, Systemd,...) requires solid resistance. Kudos to the people making this happen. My attempt to recalibrate the battery on my X220 failed. Hunting for info I found this on github
+ It's a TLP bug that was fixed a couple of weeks ago. The solution was to install the git versions of tlp. Now I can plug in my X220 to the mains and run tlp recalibrate BAT0 overnight. Artix Linux is a distribution based on Arch, but without systemd. Seeing how systemd has become insidious within Linux it's no mean feat. After watching this video,
+and having read a lot of systemd warnings by old timers,
+I decided to try Artix. I prefer a rolling release distribution, and I like Arch a lot,
+so Artix was the logical choice. After the first hour of floundering around I got it working. For some reasong the default network manager was limiting network access, for example the Artix site
+and my own site were ok, but reddit and duckduckgo were not allowed. I checked /etc/hosts but couldn't find
+the culprit. In the end I removed ConnMan and installed networkmanager and it worked straight away. In addition
+I can now use nmtui. There are still things to fix, for example the SLiM desktop manager no longer works, true it's ancient,
+so I'll have to find a replacement Until then I'm just typing startx after logging in. I have dwm running, bluetooth and pipewire too, so it's just a question of fiddling around. such as command line interface tools (CLI), text mode interface tools (TUI), developer tools and more no matter what platform or medium. The site also has RSS feeds, and is present on mastodon and BlueSky among others Nice site I'm re-reading this book on my Kobo. It's a book I first read back in the 70's.
+I probably bought it at Shakespeare & Co. a famous bookshop in the latin quarter of Paris, where
+I could go and spend a couple of hours reading a book in a big leather armchair,
+so it bears a touch of nostalgia for me. The premise is of an intelligent species (the Moties), locked in it's own solar system,
+victim of endless cycles of expansion and destruction due to it's fertility.
+Larry Niven thought big when he wrote novels like Ringworld, and here it's no exception. Some things seem a bit dated, for example the descendents of Russia, America or Scotland
+being important in the distant future, but all in all a good thought provoking read.
+To me it begs the question: what if our own species winds up becoming Moties? The Last Thing the EU Needs Is Its Own Linux Distro Having installed Linux in a couple of schools only to have the teachers showered in Microsoft freebies and propaganda,
+I fully support this guy because otherwise I know how this is going to end up. The roll over and beg attitude of authorities towards Microsoft lobbying is terrifying, and it has to change through top down
+directives that place independant European solutions first.
+ One of my favorite Youtubers on the subject of our spinning universe
+ No wonder I get vertigo. So I've decided to upgrade it. I've purchased a B140HAN01.3 screen and an LCD controller board kit from Aliexpress I'll update this article when it arrives The parts arrived, but when I installed them only the backlight works. I tried another LCD controller kit
+but there's no display. I hit a wall with the screen supplier who won't replace it. Lesson learned. After installing thinkfan, Adding thinkpad_acpi to What did work was editing Then On my Thinkpad X220 there's a blue Thinkvantage button that only gets used when the machine boots to select different options. Using xev the button is referenced as XF86XK_Launch1, here I use it to run a rofi menu for logging out, shutting down, rebooting, etc. dwm/config.h power-menu can be found here I've been playing with suckless tools: dwm, dmenu, st, surf Dwm and dmenu are fantastic, st and surf not so much. Both st and surf have patches that are incompatible, and
+often outdated. The user is expected to know how to correct the patch
+rejections, which is often possible, but knowledge of C is your best bet. Suckless software is intended to be somewhat elite. Their web site
+is frankly not suckless, perhaps intentionally? Some of the patches proposed
+address problems that have already been solved in the main program. Surf compiles but with GTK warnings about obsolete functions. St is a headbanger if you want kittygraphics, boxdraw, and ligatures for example. The educational aspect of suckless software is of course is invaluable,
+and if it's the objective, then that's fine. The problem arises when you want to
+build something that will fulfill your needs. Because of all this I use Kitty or Ghostty instead of st, and Librewolf
+instead of Surf. I just hope dwm doesn't fall into the same hole of wanting to
+be elite to the point of not fulfilling it's task, which would be a terrible shame. I kinda figured out that although youtubers attempt to make you feel a has-been if
+you don't use all the bells and whistles that come with zsh, that Bash does everything I need, and I can extend it if needed. Minimalism might be my aim, but it's not a do of die mantra, even so zsh appears rather flash and with esoteric possibilies that I will never use. I'm also keeping my bash scripts, there seems to be little point in making them reliant on some other shell. There are also a number of things that can improve your bash "experience" like Blesh - Bash Line Editor So I'm sticking to Bash for now. Edit: after adding blesh I found that Midnight Commander (mc) took a few seconds to start, I fixed it with an alias: Re-Edit: sometimes typing in the termnal was non responsive, I got annoyed after a while and removed Blesh from .bashrc Turns out simple is best, who would have thought it? Sometimes a badly written application will display a panel that is bigger than my X220's screen resolution, which is 1366x768. To quickly solve this I've affected the Scroll Lock key to a script that toggles scaling between 1366x768 and 1600x900 The scaling adds some fuzziness but gets the job done. Until now I was using synclient TouchpadOff=1 in my .xinitrc, but I was getting odd
+results when using the keyboard mouse buttons. It turns out oddly the lower left area of my touchpad was infrequently active
+and messing things up. Replacing synclient with xinput set-prop 11 172 0 fixed it. I obtained the touchpad ID with xinput list and the command with xinput -list-props 11 It's traditional to show off one's Thinkpad screenshot basking in all it's Linuxian glory, so here we are. Here's a way of testing various distributions of Linux using your browser Artix Linux is included I've updated my git server with patched versions of DWM, Dmenu and ST The cgit server is also fixed, I didn't realise that https cloning wasn't working. It works now, for example:
+ I have my web server aliased in ~/.ssh/config as "web" I have goaccess installed on my laptop to view the web stats on a vps First install Goaccess on Arch Linux View the remote stats (adjust the path for your actual log location) I've added an alias in my .bashrc : I have 2 vps's that were underused, so I've put everything on to a single vps, which has the benefit of halving costs. My days of writing and hosting web sites for others are over, I just have to cater for myself now. Which is quite nice really... My Kindle paperwhite is sleeping in a drawer since I bought a Kobo, but there's something I can do with it. Run Linux, use Koreader, play games ...
+ What happened to colour? Where did it go? I wonder if we have reached peak blandness. Verify the value: If you don't see FR then it's not correctly set. will correct that. To make it persistant, edit /etc/default/crda and addBloggings
+ Back
+
+ A fledgling bash function library
+2025-05-16
+Messing with bash functions
+Bloggings
+ Back
+
+ AC7260 wifi/bluetooth card on Thinkpad X220
+2025-04-05
+Easy card replacement
+
+Bloggings
+ Back
+
+ Amazon playing silly buggers
+2025-03-21
+I've dropped my Kindle for a Kobo
+
Bloggings
+ Back
+
+ Anacron on Artix
+2025-06-16
+On Arch Anacron is a systemd process
+The /etc/crontab file
+
+# /etc/crontab: configuration file for cron
+# See cron(8) and crontab(5) for details.
+# m h dom mon dow user command
+
+SHELL=/bin/bash
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+MAILTO=root
+HOME=/
+
+# run-parts
+# (also runs the 0anacron script every hour)
+12 * * * * root run-parts /etc/cron.hourly
+22 10 * * * root run-parts /etc/cron.daily
+32 10 * * 0 root run-parts /etc/cron.weekly
+42 10 1 * * root run-parts /etc/cron.monthly
+
+
+The /etc/cron.hourly/0anacron script
+
+#!/bin/sh
+# Check whether 0anacron was run today already
+if test -r /var/spool/anacron/cron.daily; then
+day=`cat /var/spool/anacron/cron.daily`
+fi
+if [ `date +%Y%m%d` = "$day" ]; then
+exit 0;
+fi
+
+# Do not run jobs when on battery power
+if test -x /usr/bin/on_ac_power; then
+/usr/bin/on_ac_power >/dev/null 2>&1
+if test $? -eq 1; then
+exit 0
+fi
+fi
+/usr/sbin/anacron -s
+
+
+The /etc/anacrontab file
+
+# /etc/anacrontab: configuration file for anacron
+
+# See anacron(8) and anacrontab(5) for details.
+
+SHELL=/bin/sh
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+MAILTO=root
+# the maximal random delay added to the base delay of the jobs
+RANDOM_DELAY=45
+# the jobs will be started during the following hours only
+START_HOURS_RANGE=3-22
+
+#period in days delay in minutes job-identifier command
+1 5 cron.daily nice run-parts /etc/cron.daily
+7 25 cron.weekly nice run-parts /etc/cron.weekly
+@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
+
+
+ Bloggings
+ Back
+
+ Annoying touchpad
+2025-04-28
+My palm keeps hitting the trackpad
+
+sudo pacman -S xf86-input-synaptics
+synclient TouchpadOff=1
+
+Bloggings
+ Back
+
+ Archwiki on my laptop
+2025-05-15
+Wikiman enables you to peruse wiki's on your computer
+
+pacman -S wikiman
+pacman -S arch-wiki-docs
+cp /etc/wikiman.conf ~/.config/wikiman/
+
+Bloggings
+ Back
+
+ Back to the future
+2025-04-25
+4 years afterwards
+
+Pyradio-m3u
+Bloggings
+ Back
+
+ Bash prompt without scripts
+2025-05-06
+A pretty prompt in one line of my .bashrc
+
+export PS1='\[\e[30;102m\] \A \[\e[92;103m\]\[\e[30m\] \u@\h \[\e[93;107m\]\[\e[30m\] \w \[\e[0;97m\]\n\[\e[0m\]\$ '
+
+
Bloggings
+ Back
+
+ Betterfox
+2025-03-22
+With all the hoohaa around Firefox wanting your data I started using Floorp instead.
+Bloggings
+ Back
+
+ Blog scripts
+2025-05-13
+My simple blog scripts
+
+
+Bloggings
+ Back
+
+ Bringing back the fun
+2025-04-23
+I installed xscreensaver and it's cool
+Bloggings
+ Back
+
+ Browser choices
+2025-04-02
+Browser, browser, on the wall, who is the fairest of them all?
+
+
+Bloggings
+ Back
+
+ Carbide tools for wood turning
+2025-09-07
+Making my own tools
+
15mm round
+15mm squareBloggings
+ Back
+
+ Chaotic Aur
+2025-03-23
+Chaotic Aur is an automated building repo for AUR packages
+sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
+sudo pacman-key --lsign-key 3056513887B78AEB
+
+sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
+sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
+
+[chaotic-aur]
+Include = /etc/pacman.d/chaotic-mirrorlist
+
+
+sudo pacman -Syu
+
+sudo pacman -S firedragon
+Bloggings
+ Back
+
+ Closing laptop lid without suspend
+2025-07-04
+Looking into using a laptop as a home server
+cat /proc/acpi/wakeup
+echo 'PNP0C0D:00' | sudo tee /sys/bus/acpi/drivers/button/unbind
+Bloggings
+ Back
+
+ Cpu scaling governors on Thinkpad X220
+2025-03-26
+There are only two CPU scaling governors on my Thinkpad X220
+cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
+Bloggings
+ Back
+
+ DNS4U European DNS servers go live
+2025-06-16
+The EU now has an alternative to Google and Cloudflare DNS
+
+
+Bloggings
+ Back
+
+ DWM Dunst and Thinkpad audio keys
+2025-04-24
+How I got them working, microphone mute led included
+dwm/config.h
+
+...
+{ 0, XF86XK_AudioMicMute, spawn, SHCMD("~/.local/bin/dwm-audio mictoggle") },
+{ 0, XF86XK_AudioMute, spawn, SHCMD("~/.local/bin/dwm-audio voltoggle") },
+{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("~/.local/bin/dwm-audio volquieter") },
+{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("~/.local/bin/dwm-audio vollouder") },
+...
+
+
+~/.local/bin/dwm-audio
+
+#!/bin/bash
+# Manage Thinkpad Audio keys
+
+msgTag="Audio"
+
+# Microphone
+if [[ "$@" == "mictoggle" ]]; then
+ pamixer --default-source -t
+ micmute="$(pamixer --default-source --get-mute)"
+ if [[ "$micmute" == "true" ]]; then
+ # Mic muted notification
+ dunstify -t 1000 -a "Microphone" -u low -i audio-input-microphone \
+ -h string:x-dunst-stack-tag:$msgTag "Microphone muted"
+ else
+ # Mic unmuted notification
+ dunstify -t 1000 -a "Microphone" -u low -i audio-input-microphone \
+ -h string:x-dunst-stack-tag:$msgTag "Microphone unmuted"
+ fi
+ exit 0
+fi
+
+# Speakers
+if [[ "$@" == "voltoggle" ]]; then
+ pamixer --toggle-mute
+elif [[ "$@" == "vollouder" ]]; then
+ pamixer -i 10
+elif [[ "$@" == "volquieter" ]]; then
+ pamixer -d 10
+fi
+
+volume="$(pamixer --get-volume-human)"
+mute="$(pamixer --get-mute)"
+if [[ $volume == 0 || "$mute" == "true" ]]; then
+ # Sound muted notification
+ dunstify -t 1000 -a "changeVolume" -u low -i audio-speakers \
+ -h string:x-dunst-stack-tag:$msgTag "Volume muted"
+else
+ # Volume notification
+ dunstify -t 1000 -a "changeVolume" -u low -i audio-speakers \
+ -h string:x-dunst-stack-tag:$msgTag -h int:value:"$volume" "Volume: ${volume}"
+fi
+
+
+Microphone mute led
+
+...
+button/micmute)
+ if [[ "$(cat /sys/devices/platform/thinkpad_acpi/leds/platform\:\:micmute/brightness)" == "1" ]]; then
+ echo "0" > /sys/devices/platform/thinkpad_acpi/leds/platform\:\:micmute/brightness
+ else
+ echo "1" > /sys/devices/platform/thinkpad_acpi/leds/platform\:\:micmute/brightness
+ fi
+;;
+...
+
+
+Bloggings
+ Back
+
+ DWM circulate through tags
+2025-05-07
+Small modifications to DWM source code so far.
+
+Super+left/Right keys circulate through windows in a tag.dwm.c
+
+static void view_adjacent(const Arg *arg);
+
+
+void
+view(const Arg *arg)
+{
+ if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
+ return;
+ selmon->seltags ^= 1; /* toggle sel tagset */
+ if (arg->ui & TAGMASK)
+ selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+ focus(NULL);
+ arrange(selmon);
+}
+
+config.h
+
+/* See LICENSE file for copyright and license details. */
+#include
+Bloggings
+ Back
+
+ DWM slstatus
+2025-04-25
+KISS
+
+static const struct arg args[] = {
+ /* function format argument */
+ { battery_remaining, "%s", "BAT0" },
+ { battery_state, " %s", "BAT0" },
+ { battery_perc, " %s%%", "BAT0" },
+ { datetime, " | %s", "%a %d-%m %T" },
+};
+
+
Bloggings
+ Back
+
+ Poems
+2025-08-22
+Playing with words
+
+
+
+Bloggings
+ Back
+
+ Debian 12 to 13 upgrade
+2025-08-27
+Server upgrade successful
+Bloggings
+ Back
+
+ Detrumpify
+2025-05-03
+Technology against politics
+Bloggings
+ Back
+
+ Dmenu updates
+2025-06-16
+more patches added to dmenu
+
+
+
+Bloggings
+ Back
+
+ Dwmblocks
+2025-06-02
+eating previous thoughts
+Bloggings
+ Back
+
+ Enable Arch Extra repository in Artix
+2025-06-20
+Extending Artix package library
+pacman -S artix-archlinux-support
+wget https://archlinux.org/mirrorlist/all/ -O /etc/pacman.d/mirrorlist-arch
+
+
+[extra]
+Include = /etc/pacman.d/mirrorlist-arch
+
+pacman-key --populate archlinux
+pacman -Syu
+
+ Bloggings
+ Back
+
+ Eza
+2025-03-24
+Eza is a replacement for ls that uses symbols that are found in nerdfonts
+
alias ls="eza --icons=always"
+alias ll="eza --icons=always -l"
+alias la="eza --icons=always -la"
+
+Bloggings
+ Back
+
+ Fixing my dad's Stanley 8 CFW lock plane
+2025-08-27
+Cast iron fixes
+Bloggings
+ Back
+
+ Flowers for the bees
+2025-04-12
+I sowed some flower seeds
+Bloggings
+ Back
+
+ France rejects backdoors
+2025-03-22
+It's always a warm fuzzy feeling when we do something smart
+
+Bloggings
+ Back
+
+ Ghostty
+2025-03-27
+I've been playing with Ghostty, a new terminal emulator that seems very promising
+

Tips
+Host *
+ setenv Term=xterm-256colorRessources
+
+
+Bloggings
+ Back
+
+ Git repository
+2025-05-07
+I've added a git repository
+Bloggings
+ Back
+
+ Gopher it
+2025-09-14
+My Gopher hole
+Bloggings
+ Back
+
+ Greycoders list of minimalist web sites 2025
+2025-04-03
+Avoiding web pages filled with ads, videos, and bandwidth-heavy content
+
+Bloggings
+ Back
+
+ Hard disk fail
+2025-03-19
+The hard disk on my X220 failed
+Bloggings
+ Back
+
+ Headless Arch Install
+2025-03-21
+I have a micro pc I'd like to use as a web server
+
+sudo pacman -S archiso
+mkdir arch-headless && cd arch-headless
+cp -r /usr/share/archiso/configs/releng/ .
+mkdir releng/airootfs/root/.ssh/
+cp ~/.ssh/id_rsa.pub releng/airootfs/root/.ssh/authorized_keys
+sudo mkarchiso -v -o ./out ./releng
+
+Insert a usb key, mine is in /dev/sdc, and create a bootable usb drive
+dd if=./out/archlinux-2025.03.21-x86_64.iso of=/dev/sdc bs=4M; sync
+
+Bloggings
+ Back
+
+ Html center element
+2025-04-10
+Making things simpler still
+Librefox
+
Chawan (terminal)
+
W3M (terminal)
+
Links (terminal)
+
Bloggings
+ Back
+
+ Install the Chawan text browser on Artix
+2025-06-15
+the Arch package doesn't compile, here's the solution
+cd ~/src
+git clone https://git.sr.ht/~bptato/chawan && cd chawan
+make
+sudo make install
+cha -V
+Bloggings
+ Back
+ Jazz radio recording from 1976
+ 2025-05-24
+ KBCA Jazz Radio - Los Angeles
+
Recorded February 1976Bloggings
+ Back
+
+ Koreader for e-ink devices
+2025-03-24
+I installed Koreader on my Kobo Clara Colour last night
+Bloggings
+ Back
+
+ Ladybird web browser
+2025-06-26
+L'éspoir fait vivre
+Bloggings
+ Back
+
+ Les Oiseaux des Jardins
+2025-04-04
+Identify garden birds in Brittany
+
Bloggings
+ Back
+
+ Linux System Performance Tuning
+2025-03-26
+Linux System Performance Tuning: Optimizing CPU, Memory, and Disk
+
+
+Bloggings
+ Back
+
+ Linux power consumption control
+2025-03-23
+TLP is a feature-rich command line utility for Linux
+sudo pacman -S tlp tlpui cpupower
+sudo systemctl enable tlp.service
+
Bloggings
+ Back
+
+ Lynx, Gopher, and video files
+2025-09-21
+Getting Lynx to open video files
+
+
+/usr/bin/mpv --title="Mpv" >/dev/null 2>&1 $1
+
+Lynx can now play media files in Gopher holes.
+(Note the --title parameter is to get it to play nice with dwm).Update 2025-09-23
+
+
+# necessary for Lynx browser video files
+# chmod +x and place in your PATH
+
+# mpv can sometimes take a few seconds to open when streaming
+# so I use notification that it's happening
+
+dunstify -t 2000 -a "Video" -u low -i "media-playback-start-symbolic"\
+ -h string:x-dunst-stack-tag:"Media" "MPV Launching" &
+
+# detect if playlist
+# Lynx uses an anonymous file in /tmp, so we can only
+# detect a file type by it's contents, not it's extension
+
+if [ "$(grep -c "EXT3MU" "$1")" -eq 1 ]; then
+ # this is a playlist
+ # I use dwm, the mpv options used here make it compatible
+ mpv --geometry=1068x600 --ontop --idle=yes --force-window=yes\
+ --playlist="$1" >/dev/null 2>&1 &
+else
+ mpv --geometry=1068x600 --ontop --idle=yes --force-window=yes\
+ "$1" >/dev/null 2>&1 &
+fi
+
+exit 0
+Bloggings
+ Back
+
+ Mailcow Docker too many requests
+2025-04-29
+Dcker changes
+Bloggings
+ Back
+
+ Mailcow with Nginx reverse proxy (updated)
+2025-09-11
+Improved instructions with DANE and MTS-STA info
+
+ Bloggings
+ Back
+
+ Mailcow with Nginx reverse proxy (updated)
+2025-04-19
+Using other web services with Mailcow
+
+
+
+and set SKIP_LETS_ENCRYPT=y in /opt/mailcow-dockerized/mailcow.conf
+cd /opt/mailcow-dockerized;docker compose restart# url for letsencrypt
+location ^~ /.well-known/acme-challenge/ {
+ allow all;
+ default_type "text/plain";
+ # Path can be used for cert-validation on all domains
+ root /var/www/html/letsencrypt;
+ break;
+}
+
+server {
+ listen 443 ssl;
+ listen [::]:443 ssl;
+ http2 on;
+
+ server_name mail.xxxxx.com;
+
+ charset UTF-8;
+ access_log /var/log/nginx/access.mail.xxxxx.com;
+ error_log /var/log/nginx/error.mail.xxxxx.com;
+ include snippets/error_pages.conf;
+ ssl_certificate /etc/letsencrypt/live/mail.xxxxx.com/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/mail.xxxxx.com/privkey.pem;
+ include /etc/letsencrypt/options-ssl-nginx.conf;
+ ssl_dhparam /etc/letsencrypt/ssl-dhparams-2048.pem;
+
+ include /etc/nginx/letsencrypt_path;
+
+ location / {
+ proxy_pass http://127.0.0.1:8480;
+ proxy_buffering off;
+ include /etc/nginx/proxy_params;
+
+ }
+
+}
+
+server {
+
+ listen 80;
+ listen [::]:80;
+ server_name mail.xxxxx.com;
+ return 301 https://mail.xxxxx.com;
+}
+
+
/etc/nginx/sites-enabled/mail.xxxxx.comProblem
+#!/usr/bin/env bash
+
+# we are running behind an nginx proxy, where certbot is run by systemd,
+# so the mail.xxxxx.com certificates are updated, but not copied to the mailcow folder
+# in case the certificate isn't renewed automatically, run this:
+# sudo certbot -n certonly --webroot -w /var/www/html/letsencrypt -d mail.xxxxx.com
+
+t1="/etc/letsencrypt/live/mail.xxxxx.com/fullchain.pem"
+t2="/opt/mailcow-dockerized/data/assets/ssl/mail.xxxxx.com/cert.pem"
+
+# test if certificate has been updated
+differ=$(cmp -b $t1 $t2 | grep -c "differ")
+
+[[ "$differ" = "0" ]] && exit 0
+
+# these files are required in /data/assets/ssh/mail.xxxxx.com
+cp /etc/letsencrypt/live/mail.xxxxx.com/fullchain.pem /opt/mailcow-dockerized/data/assets/ssl/mail.xxxxx.com/cert.pem
+cp /etc/letsencrypt/live/mail.xxxxx.com/privkey.pem /opt/mailcow-dockerized/data/assets/ssl/mail.xxxxx.com/key.pem
+
+# these files are required in /data/assets/ssl/ (turns out sending failed otherwise)
+cp /etc/letsencrypt/live/mail.xxxxx.com/fullchain.pem /opt/mailcow-dockerized/data/assets/ssl/cert.pem
+cp /etc/letsencrypt/live/mail.xxxxx.com/privkey.pem /opt/mailcow-dockerized/data/assets/ssl/key.pem
+
+# update postfix & docker
+docker exec $(/usr/bin/docker ps -qaf name=postfix-mailcow) postfix reload
+docker exec $(/usr/bin/docker ps -qaf name=dovecot-mailcow) dovecot reload
+
+DANE
+apt install hash-slinger -y
+tlsa --create --selector 1 -p 25 --certificate /etc/letsencrypt/live/mail.xxxxx.com/fullchain.pem mail.xxxxx.com
+
+_25._tcp.mail.xxxxx.com. IN TLSA 3 1 1 443ac7c5c70fbfbc...
+_110._tcp.mail.xxxxx.com
+_143._tcp.mail.xxxxx.com
+_465._tcp.mail.xxxxx.com
+_587._tcp.mail.xxxxx.com
+_993._tcp.mail.xxxxx.com
+_995._tcp.mail.xxxxx.com
+
+
MTA-STS
+
+
+
+version: STSv1
+mode: enforce
+max_age: 172800
+mx: mail.xxxxx.com
+
+
+server {
+ listen 443 ssl;
+ listen [::]:443 ssl;
+ http2 on;
+
+ charset UTF-8;
+ access_log /var/log/nginx/access.mts-sta.yourdomain.com;
+ error_log /var/log/nginx/error.mts-sta.yourdomain.com;
+ include snippets/error_pages.conf;
+ ssl_certificate /etc/letsencrypt/live/mta-sts.yourdomain.com/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/mta-sts.yourdomain.com/privkey.pem;
+ include /etc/letsencrypt/options-ssl-nginx.conf;
+ ssl_dhparam /etc/letsencrypt/ssl-dhparams-2048.pem;
+
+ include /etc/nginx/letsencrypt_path;
+
+ root /var/www/html/mta-sts;
+ index index.html index.htm;
+
+ server_name mta-sts.yourdomain.com;
+
+ location / {
+ try_files $uri $uri/ =404;
+ }
+}
+server {
+ listen 80;
+ listen [::]:80;
+ server_name mta-sts.yourdomain.com;
+ return 301 https://mta-sts.yourdomain.com;
+}
+
+
/etc/nginx/sites-enabled/mta-sts.yourdomain.comBloggings
+ Back
+
+ Menu editor for XFCE4
+2025-03-23
+Alacarte is a gui menu editor for Gnome and XFCE
+yay -S alacarte-xfce
+Bloggings
+ Back
+
+ Microphone distortion on Thinkpad X220
+2025-04-27
+Trying to fix a bad microphone
+
+# make micro mono
+module-remap-source master=alsa_input.pci-0000_00_1b.0.analog-stereo channels=1 master_channel_map=front-left channel_map=mono
+
+Bloggings
+ Back
+
+ Modified dwm-bar battery script
+2025-04-23
+adding battery charging nerdfont icons
+
+#!/bin/sh
+
+# A dwm_bar function to read the battery level and status
+# GNU GPLv3
+
+dwm_battery () {
+ # Change BAT1 to whatever your battery is identified as. Typically BAT0 or BAT1
+ CHARGE=$(cat /sys/class/power_supply/BAT0/capacity)
+ STATUS=$(cat /sys/class/power_supply/BAT0/status)
+
+ #printf "%s" "$SEP1"
+ printf " %s"
+ if [ "$IDENTIFIER" = "unicode" ]; then
+ if [ "$STATUS" = "Charging" ]; then
+ if [ "${CHARGE}" -lt 10 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 20 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 30 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 40 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 50 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 60 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 70 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 80 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 90 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 100 ]; then ICON=""
+ fi
+ else
+ if [ "${CHARGE}" -lt 10 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 20 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 30 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 40 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 50 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 60 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 70 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 80 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 90 ]; then ICON=""
+ elif [ "${CHARGE}" -lt 100 ]; then ICON=""
+ fi
+ fi
+ printf "%s %s%% " "$ICON" "$CHARGE"
+ else
+ printf "BAT %s%% %s" "$CHARGE" "$STATUS"
+ fi
+ #printf "%s\n" "$SEP2"
+}
+
+dwm_battery
+
+Bloggings
+ Back
+
+ My gopher site
+2025-09-26
+moving to saner tech
+
Bloggings
+ Back
+
+ Naked DWM
+2025-05-01
+Zero dwm patches...
+
+yay -S python-pywal16
+
+Modify dwm/config.h
+
+static const char col_gray1[] = "#222222";
+static const char col_gray2[] = "#444444";
+static const char col_gray3[] = "#bbbbbb";
+static const char col_gray4[] = "#eeeeee";
+static const char col_cyan[] = "#005577";
+static const char *colors[][3] = {
+ /* fg bg border */
+ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
+ [SchemeSel] = { col_gray4, col_cyan, col_cyan },
+};
+
+
+/* Pywal16 */
+#include "/home/philip/.cache/wal/colors-wal-dwm.h"
+
+xinitrc
+Chooser script
+
+#!/usr/bin/env bash
+# Choose a wallpaper
+# requires nsxiv, pywal16
+# ~/.local/bin is in PATH
+
+FOLDER=~/Pictures/wallpaper
+# thumbnail display of images
+CHOICE=$(nsxiv -otb $FOLDER/*)
+
+wal -i $CHOICE
+
+# Post process
+
+# DWM
+cd ~/.local/src/dwm
+make clean ; make
+rm -f ~/.local/bin/dwm
+cp dwm ~/.local/bin
+
+# DWMMENU
+rm -f ~/.local/dmenu*
+cd ~/.local/src/dmenu
+make clean ; make
+cp {dmenu,dmenu_run,dmenu_path} ~/.local/bin
+
+Bloggings
+ Back
+
+ Neomutt as default in XFCE4
+2025-03-21
+I've always loved Mutt and now Neomutt on XFCE4
+Create desktop entry
+
+~/.local/share/applications/neomutt.desktop
+
+[Desktop Entry]
+Categories=Office;Network;Email;
+Comment=Simple text-based Mail User Agent
+Exec=xfce4-terminal -x bash -c '"rbw unblock" ; neomutt' %u
+Icon=neomutt
+Name=neomutt
+MimeType=x-scheme-handler/mailto;
+NoDisplay=false
+Terminal=false
+Type=Application
+
+Add xdg mime type
+xdg-mime default neomutt.desktop x-scheme-handler/mailto
+Bloggings
+ Back
+
+ New builds of dwm, dmenu, and st
+2025-05-21
+new builds with patches
+Bloggings
+ Back
+
+ Newsboat and gopher RSS feeds
+2025-09-24
+How to read gopher RSS feeds in newsboat
+Bloggings
+ Back
+ Oddly useful Linux tools
+ 2025-05-08
+ Bread on Penguins with some interesting tools
+ Bloggings
+ Back
+
+ Pipewire
+2025-04-28
+Fixing Thinkpad X220 microphone woes
+
+sudo pacman -Rdd pulseaudio
+sudo pacman -S pipewire-{jack,alsa,pulse}
+systemctl --user enable --now pipewire pipewire-pulse pipewire-media-session
+
+Noise suppression
+
+git clone https://github.com/werman/noise-suppression-for-voice.git
+
+
+pactl list sources short
+pactl set-default-source rnnoise_source
+systemctl --user restart pipewire.service
+
+Bluetooth Autoconnect
+Bloggings
+ Back
+
+ Power notifications
+2025-04-26
+Searching how to get a notification for power source changes or USB drives
+Bloggings
+ Back
+
+ Powerline Bash
+2025-03-24
+Make your bash prompt look real pretty
+
Bloggings
+ Back
+
+ RSS feeds that don't suck on terminals
+2025-04-05
+RSS news in the terminal
+
+
+The list so far:
+
+---Linux---
+https://old.reddit.com/r/commandline/.rss
+https://old.reddit.com/r/Ghostty/.rss
+https://old.reddit.com/r/xfce/.rss
+https://old.reddit.com/r/neomutt/.rss
+https://old.reddit.com/.rss
+https://itsfoss.com/rss/
+https://archlinux.org/feeds/news
+https://www.linuxjournal.com/node/feed
+https://www.cyberciti.biz/feed/
+https://terminaltrove.com/blog.xml
+https://terminaltrove.com/new.xml
+https://terminaltrove.com/totw.xml
+
+---News-English---
+https://www.theatlantic.com/feed/all/
+
+---News-French---
+https://www.thelocal.fr/feeds/rss.php
+https://www.diplomatie.gouv.fr/spip.php?page=backend-fd
+https://mondediplo.com/backend
+https://frenchdailynews.com/feed
+https://www.euronews.com/rss
+https://tempsreel.nouvelobs.com/rss.xml
+https://www.lepoint.fr/rss.xml
+
+---Science---
+https://www.science.org/rss/news_current.xml
+http://rss.sciam.com/ScientificAmerican-Global
+https://www.lemonde.fr/sciences/rss_full.xml
+https://www.newscientist.com/feed/home/?cmpid=RSS%7CNSNS-Home
+http://feeds.feedburner.com/sciencealert-latestnews
+http://awesci.com/feed/
+https://blogs.esa.int/rocketscience/feed/
+
+---Tech---
+https://feeds.feedburner.com/TheHackersNews?format=xml
+
+---Divertissement---
+https://xkcd.com/rss.xml
+
+---Other---
+
+Bloggings
+ Back
+
+ Reducing web font size
+2025-04-06
+I stumbled on a marvellous post
+pipx install fonttools
+pyftsubset JetbrainsMono-Regular.ttf --output-file=JetbrainsMono-Regular-reduced.ttf --unicodes=U+0020-007E
+.rw-r--r-- 66k philip 6 avril 23:04 JetBrainsMono-reduced.ttf
+.rw-r--r-- 18k philip 6 avril 23:20 JetBrainsMonoNerd-reduced.ttf
+
+Update
+Bloggings
+ Back
+
+ Replace sudo with doas on Artix
+2025-06-18
+More efficient, less complicated
+sudo pacman -S opendoas
+sudo usermod -aG wheel philip
+permit setenv {PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin} :wheel
+doas chown -c root:root /etc/doas.conf
+doas chmod -c 0400 /etc/doas.conf
+
+doas pacman -Rdd sudo
+ln -s $(which doas) /usr/bin/sudo
+#!/usr/bin/env bash
+
+DOASDIR="/tmp/doas-$(date +%s)"
+mkdir $DOASDIR
+chmod 700 $DOASDIR
+DOASFILE="$DOASDIR/doas.conf"
+
+cp /etc/doas.conf $DOASFILE
+chmod 600 $DOASFILE
+
+micro $DOASFILE
+sync
+
+doas -C $DOASFILE && echo "valid config" && cp $DOASFILE /etc/doas.conf && chmod 400 /etc/doas.conf || echo "invalid config"
+sync
+
+rm -rf $DOASDIR
+
+
+#!/usr/bin/env bash
+if [ "$(id -u)" != 0 ]; then
+ doas /root/script/doasedit
+else
+ /root/script/doasedit
+fi
+
+
+doas chmod 700 /root/script/doasedit
+doas chmod 755 /usr/local/bin/doasedit
+
+
+doasedit
+permit nopass philip as root cmd pacman
+valid config
+
+
+
+ Bloggings
+ Back
+
+ Rsync backup to Synology Diskstation
+2025-03-25
+This could change but it works for me.
+Note: I set the rsync options on the diskstation but had to chmod 755 my
+diskstation's home folder before passwordless ssh worked
+#!/bin/sh
+
+ rsync -r --no-D --no-t --no-o --no-g --no-p \
+ --size-only \
+ --delete \
+ --update \
+ --exclude .cache/ \
+ --exclude Downloads/ \
+ --exclude tmp/ \
+ --exclude .local/share/Trash/ \
+ --exclude .wine \
+ --info=progress2 \
+ --stats \
+ /home/philip philip@dsm:backup-X220
+
+
+Bloggings
+ Back
+
+ Screen scaling with xrandr
+2025-03-30
+Changing screen scaling on my X220
+xrandr --output LVDS1 --panning 1920x1080 --scale 1.406x1.406
+xrandr --output LVDS1 --panning 1600x900 --scale 1.171x1.172
+xrandr --output LVDS1 --panning 1366x768 --scale 1x1
+
(which might well be the case when I receive the new 1920x1080 IPS screen for my 14" T430)xrandr --output LVDS1 --panning 1600x900 --scale 0.8333x0.8333
+
+Settings->Appearance->Settings->Window Scalingxfconf-query -c xsettings -p /Gdk/WindowScalingFactor -s SCALE
+Bloggings
+ Back
+
+ Shellcheck your bash scripts
+ 2025-05-14
+ Shellcheck is a handy online and command line tool
+ yay -Ss shellcheck
+ Bloggings
+ Back
+
+ Simplex a decentralised private messenger
+2025-04-04
+A messenger app without user IDs
+Bloggings
+ Back
+
+ Slim-fork login manager
+2025-04-26
+Slim has been ressurected
+
Bloggings
+ Back
+
+ Slstatus date with alternative locale
+2025-04-26
+Modifying slstatus to display French date
+
slstatus/components/datetime.c
+/* See LICENSE file for copyright and license details. */
+#include <stdio.h>
+#include <time.h>
+#include <locale.h>
+
+#include "../slstatus.h"
+#include "../util.h"
+
+
+const char *
+datetime(const char *fmt)
+{
+ setlocale(LC_ALL,"fr_FR.utf8");
+ time_t t;
+
+ t = time(NULL);
+
+ if (!strftime(buf, sizeof(buf), fmt, localtime(&t))) {
+ warn("strftime: Result string exceeds buffer size");
+ return NULL;
+ }
+
+ return buf;
+}
+
+Bloggings
+ Back
+
+ Starship prompt
+2025-04-26
+Making the terminal pretty with Starship
+
Bloggings
+ Back
+
+ Artix: Stick it to the man
+2025-06-29
+Artix is the resistance: Xlibre
+
Bloggings
+ Back
+
+ TLP recalibration error on Thinkpad X220
+2025-04-08
+Error: cannot read charge level of battery BAT0
+yay -S tlp-git tlp-rdw-git
+Bloggings
+ Back
+
+ Taking the leap to Artix
+2025-06-14
+systemd no more
+Bloggings
+ Back
+
+ Terminal Trove
+2025-04-02
+Terminal Trove curates and showcases all things in the terminal
+Bloggings
+ Back
+
+ The Mote in God's eye
+2025-04-06
+Science fiction by Larry Niven and Jerry Pournelle
+Bloggings
+ Back
+
+ The last thing the EU needs ...
+2025-04-09
+Clickbait title for some serious points
+Bloggings
+ Back
+ The universe is spinning
+ 2025-04-13
+ What goes around, comes around
+ Bloggings
+ Back
+
+ Thinkpad T430 screen upgrade
+2025-03-21
+My T430's current screen is 1368x768, a bit crappy
+Oh poo.
+
Bloggings
+ Back
+
+ Thinkpad X220 Fan control
+2025-03-21
+Blowing out the heat from my laptop
+sudo pacman -S thinkfan
+journalctl -p 3 -xb was showing an error concerning thinkfan, and I worked out that the thinkfan_acpi module wasn't being loaded on boot./etc/modules-load.d/thinkpad.conf didn't work/etc/default/grub and adding thinkpad_acpi.fan_control=1 to GRUB_CMDLINE_LINUX_DEFAULTsudo grub-mkconfig -o /boot/grub/grub.cfgBloggings
+ Back
+
+ Thinkvantage button in DWM
+2025-04-27
+Putting the Thinkvantage button to use
+
+...
+{ 0, XF86XK_Launch1, spawn, SHCMD("rofi -show power-menu -modi power-menu:rofi-power-menu") },
+...
+
+
Bloggings
+ Back
+
+ Thoughts on suckless
+2025-06-12
+Note: opinions can change
+Bloggings
+ Back
+
+ Thoughts on zsh
+2025-06-22
+do I need it?
+alias mc="mc --nosubshell"
+Bloggings
+ Back
+
+ Toggle screen resolution in DWM
+2025-06-28
+using X220 keys
+Bloggings
+ Back
+
+ Touchpad deactivation
+2025-06-09
+When you have big hands and a little keyboard
+
+ $ xinput list
+ ⎡ Virtual core pointer id=2 [master pointer (3)]
+ ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
+ ⎜ ↳ Logitech Wireless Mouse id=9 [slave pointer (2)]
+ ⎜ ↳ TPPS/2 IBM TrackPoint id=12 [slave pointer (2)]
+ ⎣ Virtual core keyboard id=3 [master keyboard (2)]
+ ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
+ ↳ Power Button id=6 [slave keyboard (3)]
+ ↳ Video Bus id=7 [slave keyboard (3)]
+ ↳ Sleep Button id=8 [slave keyboard (3)]
+ ↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
+ ↳ ThinkPad Extra Buttons id=13 [slave keyboard (3)]
+ ↳ Logitech Wireless Mouse id=14 [slave keyboard (3)]
+ ∼ SynPS/2 Synaptics TouchPad id=11 [floating slave]
+
+$ xinput -list-props 11
+Device 'SynPS/2 Synaptics TouchPad':
+ Device Enabled (172): 1
+ ...
+
+$ xinput set-prop 11 172 0
+
+ Bloggings
+ Back
+
+ Traditional screenshot of my X220
+2025-04-08
+Thinkpad X22O running Arch Linux
+
+My name is Ozymandias, King of Kings: Look on my works, ye Mighty, and despair!
+Bloggings
+ Back
+
+ Try different distributions of Linux online
+2025-07-14
+Distrosea
+Bloggings
+ Back
+
+ Updated cgit server
+2025-05-28
+dwm, dmenu, st repositories updated
+git clone https://git.wittamore.fr/dwm
+Bloggings
+ Back
+
+ Upload modified blog files with scp
+2025-03-29
+A simple bash script to update this blog using scp
+Note
+
so the remote folder is web:/folder#!/bin/sh
+
+# blogsend : scp blog files to web server
+# usage : blogsend hours (if not set default is 1 hour)
+# example : blogsend 72 sends files modified over the past 3 days
+
+# folders
+rf= #add your remote ssh folder here
+mf= #add your local folder here
+cd $mf
+
+# test if option is sent
+if [[ -z "$1" ]]; then
+ HOURS=1;
+else
+ # test if option is a number
+ if [[ "$1" =~ ^[0-9]+$ ]]; then
+ HOURS=$1;
+ else
+ HOURS=1;
+ fi
+fi
+
+MINUTES=$(($HOURS*60))
+
+echo "Sending files modified in the past $HOURS hour(s)..."
+
+files=$(find * -path .tmp -prune -o -mmin -$MINUTES -type f)
+for file in $files
+do
+ echo -ne "-> ";
+ scp -r "$file" "$rf/$file";
+done
+
+echo "Done."
+
+exit 0
+
+Bloggings
+ Back
+
+ Using Goaccess to view web stats
+2025-04-03
+Using Goaccess locally
+sudo pacman -S goaccess
+ssh USER@SERVER 'zcat -f /var/log/nginx/access.log*' | goaccess -a --log-format=COMBINED
+alias stats="ssh USER@SERVER 'zcat -f /var/log/nginx/access.log*' | goaccess -a --log-format=COMBINED"
+Bloggings
+ Back
+
+ VPS management
+2025-04-18
+Reducing things
+Bloggings
+ Back
+
+ What do you do with an unused Kindle
+2025-04-17
+Early in the morning...
+Bloggings
+ Back
+ Why does everything feel so boring now?
+ 2025-06-07
+ Food for thought on blandness
+ Bloggings
+ Back
+
+ Wifi region
+2025-03-26
+If like me you reside in France, you may have wifi problems with the default frequency settings.
+iw reg get
+sudo iw reg set FR
+REGDOMAIN=FR
+
+Source
Listening to Youtube "influencers" I learned that I was a dummy because I don't use tiling window managers.
+I tried i3 in Manjaro before but just didn't connect with it. Perhaps it was me? +Trying again I spent the past couple of days messing with the configuration files of i3, i3blocks, polybar, etc. +again, just to see if maybe I missed out on something.
+Turns out I didn't.
+My Thinkpad X220 is my daily drive, it has a 13" screen, 1366x768, and a French keyboard.
+Splitting the screen is a daft idea on such a small laptop, it doesn't add any productivity improvement +even when you cast aside the problems remembering was it Super+~ or was it Super+Shift+F2 ?, +and the resulting digital gymnastics (although possibly good for my carpal tunnels, who knows?)
+It's understandable when you have a nice large desktop screen and a decently sized keyboard, but here no way.
+Anyway, a stacking windowmanager, Xfce4, appears to be the best bang for my buck teeth on this laptop.
+I have set the keystroke Super+right & left to flip through windows that I mostly have maximised +(I'll eventually use devilspie to make this automatic), +that are all simply stacked on top of each other in the same workspace. +I use tabs in Ghostty to have for example Neomutt, btop, and a command line. In Librefox I have tabs too, +and I'll probably have Libreoffice Calc or Writer open, Gimp, galculator too.
+Simple and effective, while keeping a bottom panel and application menu available.
+
+I've cancelled the plan to build a workshop. It's expensive, and increases my local taxes.
+So I'm adapting the shared garage. The first step is an air cleaner, I settled for the Record Power AC400
+I chained it to the rafters, and first results are good.
+The Thinkpad X220 has an internal Bluetooth controller, but +I installed the AC7260 wifi/bluetooth card.
+Unfortunately the default card remains the internal one, so autoconnect of my headset doesn't work.
+In order to block the internal device, I made a UDEV rule in /etc/udev/rules.d/91-bluetooth-hci.rules
+After obtaining the id with lsusb:
+SUBSYSTEM=="usb", ATTRS{idVendor}=="8087", ATTRS{idProduct}=="07dc", ATTR{authorized}="0"
+Reboot, and the AC7260 Bluetooth card is now the default.
+ +Not much to post about recently as I've been busy building myself a new shed to store my recuperated hardwood collection.
+However, I just installed Xlibre, a fork of Xorg. It's now available in the Artix Galaxy repo, and it went without a hitch.
+pacman -S xlibre
+Allow xlibre to replace all the xorg packages, then install the video driver package you need.
+pacman -S xlibre-xf86-video-intel
+For more info on Xlibre, check out the site https://x11libre.net
+It struck me that using DWM with Monocle layout would be just what I've been looking for on my X220
+I cloned the st, dmenu, and dwm from suckless.org and followed the instructions to compile them.
+Right now I have Xfce4 installed, so to try out DWM I've added an entry to select it in lightdm
+sudo micro /usr/share/xsessions/dwm.desktop
+[Desktop Entry]
+Encoding=UTF-8
+Name=dwm
+Comment=Dynamic window manager
+Exec=dwm
+Icon=dwm
+Type=XSession
+
+In dwm's config.h I set the monocle layout as default and recompiled dwm.
+At first glance this looks much better than the i3 window manager, small, neat and fast.
+More to come...
+Mucking around with DWM proves the old adge that less is more. +So far I haven't needed to add any of the myriad of patches available for DWM, it works as it is for me.
+I've tried dwm-blocks but right now I'm using dwm-bar as I like the battery icon to update along with the charge.
+I have edited config.h though and changed the keybindings to work better with a French keyboard and launch a few apps.
+
+Editing config.h is an ongoing job, but you can see a snapshot here
+ST is the default terminal emulator for DWM but I rather like Ghostty even if it consumes a bit more
+memory. Adding window-decoration = none to .config/ghostty/config makes it look better in DWM.
I also added gtk-single-instance = true to make ghostty's startup faster.
Being able to swap between display layouts on the fly is cool. I mostly use monocle layout, +but flipping to tiling or floating comes in handy.
+I removed the lightdm display manager and installed Slim. Here is my .xinitrc
++#!/bin/sh + +# Source global X session scripts. +if [ -d /etc/X11/xinit/xinitrc.d ]; then + for f in /etc/X11/xinit/xinitrc.d/*; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +bluetooth off +clipmenud & +xscreensaver --no-splash & +ghostty & +feh --bg-scale --randomize ~/Pictures/wallpaper/* & +~/.local/src/dwm-bar/dwm_bar.sh & +# if dwm exits 0, restart -- this allows hot reloading of config.h +while type dwm >/dev/null ; do dwm && continue || break ; done ++
And here is my DWM configuration file (it probably isn't the latest version)
+config.h
Just a pic of my simple dwmblocks status bar
+
The calendar app is Orage, opened and closed by clicking on the date which launches a dwmblocks script
+
+static const Rule rules[] = {
+ /* xprop(1):
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+ /* class instance title tags mask iscentered isfloating isterminal noswallow monitor */
+ { "Gimp", NULL, NULL, 0, 0, 1, 0, 0, -1 },
+ { "Firefox", NULL, NULL, 1 << 8, 0, 0, 0, -1, -1 },
+ { "Ghostty", NULL, NULL, 0, 0, 0, 1, 0, -1 },
+ { "Orage", NULL, NULL, 0, 0, 1, 0, 1, -1 },
+ { "Galculator", NULL, NULL, 0, 1, 1, 0, 1, -1 },
+ { NULL, NULL, "Event Tester", 0, 0, 0, 0, 1, -1 }, /* xev */
+};
+
+
+