Changes in Cinnamon 6.4

Manjaro Cinnamon

Official image picture of Manjaro Cinnamon

Around the beginning of last December, Manjaro’s Cinnamon was updated to the 6.4 series, and a lot has changed.

Personally, I was concerned about the fact that the volume steps are now fixed at by 5% each. This 5% value is hard-coded into the source code and cannot be changed.

So I decided to modify the package and re-install it. The environment is Manjaro Cinnamon, but I think the procedure is applicable to all Arch distributions.

Procedure

The procedure is as follows:

  1. Obtain and modify source files

  2. Obtain and modify the PKGBUILD

  3. Modify the checksum of the package

  4. Build and install

Since Cinnamon is a desktop environment developed by Linux Mint, almost all of the information found is for Mint and cannot be applied directly to Arch. However, the procedure remains the same: modify the source code of the package, build it, and reinstall it.

When building Arch packages, a bash script called PKGBUILD is used, which contains information necessary for installation, such as the location of source files and dependency information, and all the packages can be managed by pacman if only the PKGBUILD is ready. I think this is one of the good points of Arch.

Obtain source files and modify

You can easily find upstream repository from package detail page

Git clone in an empty directory, since there will be more miscellaneous files later on.

mkdir csd
cd csd
git clone https://github.com/linuxmint/cinnamon-settings-daemon

The file to be modified is csd-media-keys-manager.c in cinnamon-settings-daemon > plugins > media-keys.

Change VOLUME_STEP from 5 to any value. This time, I set it to 1, which was the default before. You can also use sed -i -e "s/VOLUME_STEP 5/VOLUME_STEP 1/" cinnamon-settings-daemon/plugins/media-keys/csd-media-keys-manager.c for this kind of change.

#define VOLUME_STEP 1

Save and exit.

Now compress the directory into tar.gz format.

tar -czvf cinnamon-settings-daemon.tar.gz cinnamon-settings-daemon

Obtain PKGBUILD and modify

PKGBUILDs can also be found through the link Source Files on the package detail page.

Open Raw
wget "https://gitlab.archlinux.org/archlinux/packaging/packages/cinnamon-settings-daemon/-/raw/main/PKGBUILD"

After downloading with wget, rewrite the directory names of source and build() as follows.

optdepends=('cinnamon-translations: i18n')
makedepends=(meson samurai xf86-input-wacom glib2-devel)
options=(!emptydirs)
# source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
source=(${pkgname}.tar.gz)
sha512sums=('d21d8e1fa80f54b7bc5bde9e42c939e99247df6cb1c1f00ec0de46f938c476bf3633647fa8a1d9962498d62aecd7a624826f97c145d9bd05aaf3f82180a95a5a')
b2sums=('1cb9b49c04f03f3c9d8357e3f9570aecd41bfc4abe5c9fa84410d33566906e4ee8ba44947a98958633ca423b394efc07c0dd670206b332f0efcaf3839e682830')

build() {
# arch-meson --libexecdir=lib/${pkgname} ${pkgname}-${pkgver} build
arch-meson --libexecdir=lib/${pkgname} ${pkgname} build
samu -C build
}

Now save changes.

Change checksums

Generate new chacksum of the package by makepkg -g

makepkg -g
# ==> Retrieving sources...
#   -> Found cinnamon-settings-daemon.tar.gz
# ==> Generating checksums for source files...
# sha512sums=('3f1e746292ff3e566df47ed06920fc46391e0ec845c936b140ece26d45b1c72f30cf9996d3598928fe7ce760d789d8156bc3d02e2a4c72706cf4de6a819e4734')
# b2sums=('88acc19c413989ded1f02d214080156ed24ebde118078be60f1e911067799f973338eca6eb31ac9be0cb36c2ed85fdb85ba2ea2a07e19c9e0c37c44dfd0d414a')

Now copy and paste this sha512sums and b2sums value to PKGBUILD from terminal.

Or, although it takes time and effort, there is a way to make a patch and apply it. Generate new checksums as makepkg -g >> checksums.new and make a diff with old checksums extracted by grep “sha512sums=” PKGBUILD >> checksums.old && grep “b2sums=” PKGBUILD >> checksums.old. Now you can also make a patch by diff --unified checksums.old checksums.new > PKGBUILD.patch and apply it to the PKGBUILD as patch < PKGBUILD.patch. (If you know of a more sane way, please let me know.)

ArchWiki guides you to use updpkgsums, a useful tool included in pacman-contrib to update checksums, but I got an error if the package contains CR+LF as follows.

updpkgsums cinnamon-settings-daemon.tar.gz
# /usr/bin/makepkg: line 1255: warning: command substitution: ignored null byte in input
# ==> ERROR: cinnamon-settings-daemon.tar.gz contains CRLF characters and cannot be sourced.
# ==> ERROR: Failed to generate new checksums

I found out it does indeed contain CR+LF by grep.

grep -lzUP '\r\n' ./*
# => cinnamon-settings-daemon.tar.gz

However, I can’t find it in the source files, and I can’t build it by removing it with sed, so I gave up dealing with it this time.

I will investigate the cause of this error when I have free time. The road to becoming a beginner Linuxer is a far long one.

Build and install

After applying the new checksum to the PKGBUILD, it can be built and installed with makepkg -si.

makepkg -si

If you get the following error, the directory name of build() is still ${pkgname}-${pkgver}, which is different from the directory name of the git clone, so modify the PKGBUILD to be only ${pkgname}.

ERROR: Neither source directory 'cinnamon-settings-daemon-6.4.3' nor build directory 'build' contain a build file meson.build.
==> ERROR: A failure occurred in build().
    Aborting...

Fix OSD window to display volume percentage.

In the new Cinnamon, the OSD window in front of the window no longer displays the volume percentage. Let’s fix it as well.

sudo cp /usr/share/cinnamon/js/ui/osdWindow.js /usr/share/cinnamon/js/ui/osdWindow.orig
sudo nano /usr/share/cinnamon/js/ui/osdWindow.js

Put this.setLabel(value.toString() + ' %'); in the line next to if (this._level.visible) {

    setLevel(value) {
        this._level.visible = value != null;
        if (this._level.visible) {
            /* ↓Put this */
            this.setLabel(value.toString() + ' %');
            /* ↑Put this */
            value = value / 100;
            if (this.visible)
                this._level.ease_property('value', value, {
                    mode: Clutter.AnimationMode.EASE_OUT_QUAD,
                    duration: LEVEL_ANIMATION_TIME,
                });
            else
                this._level.value = value;
        }
    }

Then restart cinnamon.

cinnamon-dbus-command RestartCinnamon 1

Now it’s done.

Websites I reffered