An Introduction to Programmable Completion in Bash

I am using the terminal a lot on Linux. For my project „pulseaudio-tcp“ (see here for more information) i wanted to have more comfortable command line completion in Bourne Again Shell („Bash“). After having typed in the command name pulseaudio-tcp, when pressing the Tabulator key, i would like to see a list of all possible arguments to that command.

In this article i demonstrate how to leverage the „Programmable Completion“ feature of Bash for such purposes. A reasonably recent version of Bash (4.2 or later) is assumed. You should have a basic understanding of control flow, variables, functions and arrays in Bash. In the article, we will make use of some advanced Bash features such as array expansion with pattern matching; these will be explained „on the go“ as required.

Lesen Sie mehr »

Release 1.0 of pulseaudio-tcp

pulseaudio-tcp now has its first official release. The initial release features the following changes:

  • GUI support with zenity for setup and other user interaction
  • Debian packaging
Gitea project pulseaudio-tcpLast 3 commits: by Tilman Kranz: 4fb3a469 Update README.md by Tilman Kranz: 02bed35e Update README.md by Tilman Kranz: b4a6c4c4 slight code cleanupLatest release: 1.0

Firefox userChrome Adjustments for Connected Browser Tabs

Using userChrome.css, based on the CSS generated by the „Firefox 89 Styling Proton UI“ assistant, i have made some adjustments to the Firefox UI that make browser tabs be more connected, i.e. not look like „floating buttons“. They also are much more compact. Screenshot:

Screenshot of Firefox with multiple browser tabs

Gitea project firefox-user-chrome-cssLast 3 commits: by Tilman Kranz: 879e17ca reformat license and copyright information by Tilman Kranz: 52011e7b Merge branch 'main' of ssh://tk-sls.de:2223/tilman/firefox-user-chrome-css by Tilman Kranz: 6680731d updateThis project has currently no releases.

 From Alpha To Beta

 A Different Beat

Some electronic beat music featuring vocal sample „Fiona & Maike (Root D)“, part of Ableton Live’s extension pack „Voice Box“:

Lesen Sie mehr »

A simple GUI for basic Package Management with Apt

The tool presented here, „Simple Apt Update“ (simple-apt-update) is nothing more than a front-end to the non-interactive execution of apt-get update|full-upgrade and apt list --upgradeable. It can look like this:

Lesen Sie mehr »

Utility to search for XDG Desktop Files

In my previous article Print XDG Desktop Definition for Application i described a way to search the various „applications“ sub-directories of the known XDG data directories for .desktop-files that match certain search criteria.

The short shell script from that article is now available as a commandline utility, including the usual bells and whistles such as option parsing and a manpage. Also, it now supports more exact control over which directives in the desktop files are searched and which are displayed in the search results.

Here is an example searching for any desktop files containing „firefox“ in their „Name“or „Exec“ directives, displaying the „Name“, „Comment“ and „Exec“ directories of each result:

xdg-desktop-search -v -s Exec -s Name -d Name -d Comment -d Exec firefox

The utility is available here:

Gitea project xdg-desktop-searchLast 3 commits: by tilman: aff332d5 change exit codes by Tilman Kranz: 0eb7823f fix some warnings if searchdirs are missing by tilman: f7f760cb Update xdg-desktop-search

Getting Alerted on Expiring GPG Keys

GnuPG is a powerful cryptographic tool that enjoys widespread support by F/LOSS mail user agents. However, due to a lack of conventional public key management it is plagued by key-related issues. One such issue is the expiry of GnuPG keys, which often goes unnoticed by affected messaging partners until such time when it actually disturbs messaging between them.

The way user agents handle key expiry situations can roughly be described as follows:

(i) If the GnuPG key of a sender of a message is expired, user agents can not regard it as valid, and the attempt to sign the message using the sender’s key will fail. Once the GnuPG key of a user has expired the user will realize this situation without an external alerting mechanism only when trying to sign a message.

(ii) If the GnuPG key of an intended recipient of a message is expired, user agents can not regard it as valid; the attempt to encrypt a message using an expired key of a recipient will fail. Also, the sending of an encrypted message to multiple recipients, where a subset of the recipients feature expired public keys, can be blocked. Other users will realize this situation once they try to send an encrypted message to the user in question.

In the proposed setup specific GnuPG keys (specified using a list of key IDs) stored in ~/.gnupg are scanned periodically. The scan is repeated daily, at 11 A.M. local time (which can be changed to whatever systemd timers support). The tolerated remaining validity will be set to „more than 30 days“ (this, too, can easily be set to a different value).

Lesen Sie mehr »