Use gtk3-classic on Devuan Ceres for type-to-navigate in file dialog

Gtk3-classic-build-deb is builder utility for gtk3-classic for Devuan Ceres. Check out the final assets at my OBS sub-project.

Overview

Notable improvements over stock gtk3 include

  • Regular type-to-navigate-to-filename in the file dialog instead of the “typeahead” behavior
  • CSDs are removed, which actually could deprecate gtk3-nocsd (official upstream Debian package)

Notable weaknesses include:

Using

The gtk3-classic-build-deb.sh script and Makefile can be used to generate the build assets that can be used to build the binary dpkgs of gtk3 with the gtk3-classic patches.

The shell script finds the available gtk3 versions in debian, and gtk3-classic releases, and then finds the highest version that matches between the two. This highest version then gets downloaded, given the patches in debian/patches/series, and then the .dsc and .debian.tar.xz file are generated!

Upstreams

Build script

The build script is loosely inspired by luigifab/deb.sh (gist.github.com), but is maintained separately.

gtk3-classic

The gtk3-classic patch set is one of the main inputs to this process.

gtk3

The debian orig tarball is used for the build process.

Alternatives

gtk3-stackrpms suite which suits my needs almost exactly, minus the file dialog type-to-find functionality.

Dependencies

To run the build script you need:

  • rmadison
  • git
  • tar

To build gtk3, you need the standard set which is available in the debian/control file.

References

Package for Devuan: xpipe

I came across a great little tool, xpipe, recently. Very few distros provide xpipe, so I have bundled it into a dpkg for Devuan GNU+Linux and similar distros. It’s available on my OBS space.

To quote directly from the project readme:

The xpipe command reads input from stdin and splits it by the given number of bytes, lines, or if matching the given pattern. It then invokes the given utility repeatedly, feeding it the generated data chunks as input.

You can think of it as a Unix love-child of the split(1), tee(1), and xargs(1) commands.

It’s usefulness might best be illustrated by an example. Suppose you have a file ‘certs.pem’ containing a number of x509 certificates in PEM format, and you wish to extract e.g., the subject and validity dates from each.

The openssl x509(1) utility can only accept a single certificate at a time, so you’ll have to first split the input into individual files containing exactly one cert, then repeatedly run the x509(1) command against each file.

Coincidentally, parsing a large .pem file was exactly what I was trying to do! It was not my very first case where xpipe would have been useful (splitting paragraphs) but is definitely my most prominent use case.

Package for Devuan: gtk3-automnemonics

I have packaged up another nifty little thing that can improve the desktop experience for GTK3-based desktops and applications.

Gtk3-automnemonics allows GTK3 themes to set the old “gtk-auto-mnemonics = true” or false, where false means that the underscores that highlight the accelerator keys are always visible. An accelerator key is the F in “File” where pressing ALT+F will open that File menu.

You can go install gtk3-automnemonics from my OBS now. Its sources are also visible on the OBS. The upstream project is written by Gord Squash.

How to use gtk3-automnemonics, once installed, is to modify the gtk-3.0/settings.ini file of a theme directory (probably under /usr/share/themes or ~/.local/share/themes) to include:

[Settings]
gtk-auto-mnemonics = 0
gtk-modules = sgm-flexible-mnemonics

The gtk-modules line is optional, because the gtk3-automnemonics package already adds an Xsession.d snippet that adds to/defines environment variable GTK3_MODULES value “sgm-flexible-mnemonics”.

Backstory

GTK 3.10 removed the ability to configure the ability to always show the underscores. It is now hardcoded to 300ms after pressing the ALT key. Some people may prefer to hide the underscores until asked for, by the use of the ALT key. Some of us prefer always showing the underscores. But we all lose when it is no longer configurable.

References

Weblinks

  1. GTK 3.10 Drops Menu Icons and Mnemonics « IgnorantGuru’s Blog
  2. gtk – How to enable mnemonics in 12.04 and/or 14.04 GTK3? – Ask Ubuntu
  3. Deprecate and ignore gtk-enable-mnemonics and gtk-auto-mnemonics” pro… · GNOME/gtk@7e3a494

Package for Devuan: dragon-drag-and-drop

I recently came across a great little project, dragon, which is a simple drag-and-drop source/sink for X11.
This project follows the Unix concept of do one thing and do it well. The program was designed for users who do not use a graphical file manager, but want to be able to drag and drop files (into a web browser, for example). It has minimal dependencies, and is a breeze to compile and install and use.
My contributions to the project include the packaging recipes for dpkg and rpm.
You can go get dragon-drag-and-drop from my OBS repository.

Package for Devuan: myautomount

Introduction

When I read DistroWatch a few weeks ago about Project Trident making it easier to access removable media, I was intrigued. And when I clicked through and read the announcement from Project Trident directly, it was even more fascinating! In the past, on the Devuan mailing lists and irc channels, I have seen references to some community members’ projects for auto-mounting removable media. I had never investigated them though. But this news article from a fascinating distro inspired me to dig around to find their implementation. I finally found it.

Discussion about trident-automount

The utility is written in Go. I have nothing specifically against Go, but I don’t feel like trying to find a compiler and learning how to package up Go applications. But the utility is simple enough that I was able to read it. Additionally, I felt that due to its wrapping around udevadm monitor, that it wasn’t doing anything that could not be done in shell. So I wrote my own version! But more on that in a minute.
The trident-automount utility creates xdg-style .desktop file for each “added” (discovered) attached block device. These .desktop files are placed presumably somewhere the Lumina desktop environment reads some of its menu entries.

Translating to my own implementation

I started off with an almost line-for-line translation to shell+coreutils. Watch the output of udevadm monitor, and generate .desktop files.

Adding extra bits

I decided that it wasn’t enough to add .desktop files; I wanted to re-implement the old-school non-free-OS removable media tray icon. I want to see a little icon appear when a flash drive is plugged in, and that icon provides a menu. Now, due to how autofs works especially with the short time-out as established by the trident-automount example, I don’t need dedicated buttons to umount anything. So my myautomount-trayicon menu entries will execute the xdg “Exec=” field, which is normally going to be the “xdg-open /browse/sdb2.” So yes, it relies on you having definitions for xdg-open to open your preferred file manager. I use xfe and sometimes Thunar (from Xfce).
And then I decided that I didn’t want to depend on GtkStatusIcon which has been “deprecated” for probably a decade by now. So I added to the trayicon python program the ability to use the XApp library! I added a boolean to the script which the admin can set. I did not yet make this a tunable in the makefile. I need to work on that.

Putting it all together

So now, my OBS space has a package you can install in Debian-family distros, including Devuan GNU+Linux! Myautomount does not depend on dbus or systemd. It relies on python3, autofs, and sudo. Go check it out! Or you can use the source code for whatever you want.

Apt show repositories for currently installed packages

Apt makes some things very difficult. If I want to see what repository a package comes from, I need this crazy oneliner.

apt-cache policy $( dpkg -l | awk '$1 ~ /^ii/ {print $2}' ) | awk '/^[^ ]+:$/{gsub(":$","",$0);a=$0;b="";c=""} /\*\*\*/ {b=$2} $1 > "100" {c=$2"/"$3} $1 == "100" {print a,b,c}'
xfonts-encodings 1:1.0.4-2 http://deb.devuan.org/merged/beowulf/main
xfonts-utils 1:7.7+6 http://deb.devuan.org/merged/beowulf/main
xml-core 0.18+nmu1 http://deb.devuan.org/merged/beowulf/main
xmlto 0.0.28-2.1 http://deb.devuan.org/merged/beowulf/main
xorg-sgml-doctools 1:1.11-1 http://deb.devuan.org/merged/beowulf/main
yad 0.40.0-1 http://deb.devuan.org/merged/beowulf/main
yasm 1.3.0-2+b1 http://deb.devuan.org/merged/beowulf/main
zip 3.0-11+b1 http://deb.devuan.org/merged/beowulf/main

This would have been a little easier with yum/dnf, but that’s not the point of today’s article.

Bonus

And a quick count of packages for each repository:

apt-cache policy $( dpkg -l | awk '$1 ~ /^ii/ {print $2}' ) | awk '/^[^ ]+:$/{gsub(":$","",$0);a=$0;b="";c=""} /\*\*\*/ {b=$2} $1 > "100" {c=$2"/"$3} $1 == "100" {print a,b,c}' | \
{
   if test -n "${SUMMARIZE}" ;
   then
      awk '$NF ~ /:\/\// {x[$NF]++} END {for(i in x) print i": "x[i]}'
   else
      cat
   fi
}
$ SUMMARIZE=1 ~/bin/apt-summary.sh 
http://deb.devuan.org/merged/beowulf/main: 377
http://deb.devuan.org/merged/ceres/main: 1979
http://deb.devuan.org/merged/ceres/non-free: 2

Ignore the different releases mixed in there together. Let’s pretend I know what I’m doing!

LibreOffice 7 and the Tango Icon set

LibreOffice 7.0.0 has removed the Tango icon set, i.e., the default icon set for the toolbars in the past. Tango icons were from a project with an interesting history. These icons are still available as an extension (referense 2) you can go install.

I really wanted these icons back, so I adapted the deprecated Debian packaging (reference 4) information to build a package for myself. It is now hosted in my OBS repository for Devuan Ceres: https://build.opensuse.org/package/show/home:bgstack15/libreoffice-tango-iconset
With current default icons:
LibreOffice 7.0.0 Writer with Colibre (default) icons
With the classic icons:
LibreOffice 7.0.0 Writer with Tango icons

To choose which icon style to use, select menu Tools -> Options…. Navigate in the tree to LibreOffice -> View. Select “Icon Style” drop-down and select the value you want.

References

Weblinks

  1. https://salsa.debian.org/libreoffice-team/libreoffice/libreoffice/-/blob/master/changelog
  2. https://extensions.libreoffice.org/en/extensions/show/tango-icon-theme-for-libreoffice
  3. https://wiki.documentfoundation.org/Documentation/HowTo/install_extension
  4. https://salsa.debian.org/libreoffice-team/libreoffice/libreoffice/-/blob/libreoffice_6.4.5-1/control
  5. https://snapshot.debian.org/archive/debian/20200627T204538Z/pool/main/libr/libreoffice/libreoffice-style-tango_6.4.5%7Erc1-2%7Ebpo10%2B1_all.deb

Package for devuan: powerkit

Powerkit is a neat FLOSS package for monitoring your battery status, and configuring actions associated with batteries and laptop lids.
And now it is available for Devuan ceres in my third-party repository! That first link is the build artifacts. Select this link for the nice download page.

Overview

Powerkit is a desktop-independent power manager. You can change settings for how long to wait before locking or suspending or hibernating, and control screen brightness.

Screenshots

I learned with this utility that my one laptop battery is actually treated as two separate batteries! My model uses a 3 cell+3 cell arrangement. I was shocked when I learned that my one invocation of cbatticon was dutifully monitoring just the first-reported battery, the one that drains first when off mains power. But there’s a second battery, as seen by GNU/Linux!
Powerkit status tab
Powerkit settings tab

Story

I have been using cbatticon in my minimal Fluxbox window manager for a while now. I came across this nifty Powerkit utility and skipped it over at first because it requires QT 4.8+. With the recent removal of QT4 packages from Debian (the upstream for Devuan), and my ongoing efforts to maintain some binary packages from Debian’s past for QT4, just so I can install Puddletag, I did not feel like trying to actually build something that depends on QT4. I found, however, that the Arch community builds powerkit with QT5.
Armed with this information, I began my effort to build Powerkit for Devuan. While some of the Devuan target audience may not care about upower or dbus, I am willing to make a few compromises.

Package for CentOS 7: gnupg2-2.2.18-2.el7

I have previously written about how I use debmirror on CentOS 7 to keep a local copy of the Devuan Ceres package pools.

A recent problem I discovered, is that the recent update of debmirror in CentOS 7 changed the way it uses gpgv to validate the Release and associated files that define an apt repo. The version of gnupg2 in el7 is not sufficient for how debmirror-2.33-1.el7 invokes gpgv, so debmirror always chokes out in the proper apt fashion, because it cannot trust the origin repository.

I took it upon myself to fork the Fedora sources for gnupg2 and related packages. With very minor changes, the packages compiled on el7 just fine! You can go connect to my COmmunity PRoject (copr) and upgrade these packages.

gnupg2.x86_64              2.2.18-2.el7   @copr:copr.fedorainfracloud.org:bgstack15:el7-gnupg2-debmirror
libassuan.x86_64           2.5.2-2.el7    @copr:copr.fedorainfracloud.org:bgstack15:el7-gnupg2-debmirror
libgcrypt-stackrpms.x86_64 1.8.5-1.el7    @copr:copr.fedorainfracloud.org:bgstack15:el7-gnupg2-debmirror
libgpg-error.x86_64        1.33-2.el7     @copr:copr.fedorainfracloud.org:bgstack15:el7-gnupg2-debmirror
libksba.x86_64             1.3.5-9.el7    @copr:copr.fedorainfracloud.org:bgstack15:el7-gnupg2-debmirror
npth.x86_64                1.6-2.el7      @copr:copr.fedorainfracloud.org:bgstack15:el7-gnupg2-debmirror

Using this version of gnupg2 will let debmirror operate correctly on CentOS 7. I seriously doubt many people in the world are running this kind of setup, but in case you are, here you go.

Package for devuan: waterfox

In my Internet searching I have not found a Devuan-centric Waterfox classic package. So I decided to bundle it myself!
You can see the build info for it in OBS, as well as use the nice download page to get it for yourself. This build is for Devuan Ceres.

It excludes pulseaudio and dbus, which is why I call it “Devuan centric.” While the Open Build Service only offers Debian builds, the package will install just fine on Devuan ceres. If you are the more paranoid type, you can examine my sources and even build the package yourself on Devuan!

Shoutouts

I follow a number of people on the Internet to learn packing tricks for dpkgs, or for how to build Waterfox. I know basically nothing about real software development, but I can build scripts pretty well, especially when I can follow good examples.