A custom Mastodon favicon while you wait

Admin-uploadable custom favicons are officially coming!

But until then, if you are running your own Mastodon instance, you can still do it. This is the easiest way that I've found to do it.

I'll lay it out here, so it's handy for future me, or someone else.

In /etc/nginx/sites-enabled/mastodon add something like this:

location ^~ "/packs/media/icons/" {
  return 301 https://yourdomain.org/favicon.ico;
}

Change yourdomain.org to whatever domain your Mastodon instance is running on.

Then just replace the favicon.ico file in your /home/mastodon/live/public/ directory with the favicon you want.

Restart the Mastodon services with:

# systemctl restart mastodon-*
# or a shell script:

#!/usr/bin/env bash
systemctl restart mastodon-sidekiq
systemctl reload mastodon-web
systemctl restart mastodon-streaming

Then hard-reload your browser. Requests for any favicons (Mastodon uses a few different ones) should now be redirected to your custom one.

This is good enough for me anyway, for now. Looking forward to having this all handled in the admin page soon anyway.

Bye for now!

Compiling the Zed code editor on Linux

Hello World! Coming to ya from my ThinkPad running Arch Linux with KDE Plasma 6. I'm typing this sentence into Zed right now, a new code editor from the devs who brought us Atom back in the day.

There are no binaries available for Linux yet, but don't worry, for extra fun we can compile the code ourselves!

Just clone the repo, then follow the instructions here. Basically it's a Rust app, so you just need clone the code, do a bit of setup, and then run cargo build --release and go make a cup of tea (it will take a while).

The Zed executable will be in target/release. Copy it to a directory in your homedir or something.

Add it as a desktop application with a .desktop file like this.

# ~/.local/share/applications/Zed.desktop
[Desktop Entry]
Type=Application
Name=Zed
Exec=WAYLAND_DISPLAY='' /home/phocks/Apps/Zed/Zed
Icon=/home/phocks/Apps/Zed/Zed.jpg
Terminal=false
Categories=Utility;TextEditor;Development;

Add it to your commandline with a bash script in a directory available to your executable PATH.

#!/usr/bin/env bash

# Run the Zed app and pass arguments
WAYLAND_DISPLAY='' /home/phocks/Apps/Zed/Zed "$@" &

# Wait for the Zed app to start
sleep 2

# Detach the process from the terminal
disown

We need WAYLAND_DISPLAY='' to run it in X11 mode so we can resize and move the window (there's no client side decoration on Wayland yet.)

Well, that's about it. To update it just run a git pull to fetch the latest code in main and do the compile again and re-copy the resulting binary.

Enjoy!

And remember Zed is still in early development. If you want a more fully featured code editor use Visual Studio Code.