
Custom Tuxedo Control Center tray icon workaround
I switch profiles very often, so I need that icon to be quickly accessible. However, the default color tray icon does not fit there well, so I wanted to change it with monochrome one. And finally it worked.
I'm fully aware this is a bit of a dirty hack, but after trying everything else on every possible layer with no luck, this is the only way. Hopefully, the Tuxedo team will implement an icon selection option eventually so this workaround won't be needed anymore.
Since TCC is an Electron app, its assets are baked inside an app.asar archive. If you manually extract it and swap the icon, it will get overwritten every single time APT updates the package. So we need to patch it every time after the update.
The script itself:
# /usr/local/bin/patch-tuxedo-icon.sh
#!/bin/bash
ASAR_FILE="/opt/tuxedo-control-center/resources/app.asar"
MARKER_FILE="/opt/tuxedo-control-center/resources/.icon_patched"
MY_ICON="/path/to/your/icon/tuxedo-control-center_256.png"
TEMP_DIR="/tmp/tcc_asar_patch"
USER_NAME="john-doe" # Your system username
# If invoked by APT, only run if app.asar is newer than our last patch marker.
if [ "$1" = "--apt" ]; then
if [ -f "$MARKER_FILE" ] && [ ! "$ASAR_FILE" -nt "$MARKER_FILE" ]; then
echo "TCC icon is already patched. Skipping."
exit 0
fi
fi
# Check if the required files exist
if [ ! -f "$ASAR_FILE" ] || [ ! -f "$MY_ICON" ]; then
echo "TCC asar or custom icon not found. Skipping."
exit 0
fi
echo "Starting to patch Tuxedo Control Center tray icon..."
# Dynamically fetch the real PATH and active NPX path from your user's ZSH config.
# If you are not using ZSH, you need to change that part accordingly to your preferred shell.
USER_PATH=$(su "$USER_NAME" -c "zsh -ic 'echo \$PATH'")
NPX_BINARY=$(su "$USER_NAME" -c "zsh -ic 'which npx'")
if [ -z "$NPX_BINARY" ]; then
echo "Error: Could not dynamically find npx for user $USER_NAME. Skipping."
exit 1
fi
# Clean up old temporary files
rm -rf "$TEMP_DIR"
mkdir -p "$TEMP_DIR"
# Run extraction with your user's environment variables to prevent stream drops
env PATH="$USER_PATH" "$NPX_BINARY" --yes /asar extract "$ASAR_FILE" "$TEMP_DIR"
# Patch icons in all discovered paths
find "$TEMP_DIR" -type f -name "tuxedo-control-center_256.png" | while read -r target_icon; do
cp -f "$MY_ICON" "$target_icon"
echo "Replaced: $target_icon"
done
# Pack everything back safely using the same verified environment
env PATH="$USER_PATH" "$NPX_BINARY" --yes u/electron/asar pack "$TEMP_DIR" "$ASAR_FILE"
# Clean up temporary directory
rm -rf "$TEMP_DIR"
# Create or update the marker timestamp
touch "$MARKER_FILE"
echo "TCC icon patch completed successfully!"
Don't forget to make that script executable:
sudo chmod +x /usr/local/bin/patch-tuxedo-icon.sh
If you run it manually with sudo /usr/local/bin/patch-tuxedo-icon.shand it works for you, then you can create a hook for APT so it will patch the TCC assets every time after a package update:
# /etc/apt/apt.conf.d/99tuxedo-icon-patcher
DPkg::Post-Invoke { "/usr/local/bin/patch-tuxedo-icon.sh --apt"; };
This part actually needs further refining, because, as you might notice, it will trigger after every single APT process (even unrelated to TCC), so it would be much better to make sure it runs only if tuxedo-control-center package is updated. I tried different approaches but no one is 100% bulletproof so far. That's why I put a "hack in the hack" - the marker file check in the script above. It prevents it from wasting CPU cycles and constantly unpacking the archive for no reason.
You can download the monochrome icon I used here: https://i.imgur.com/Jcv00ys.png
Let me know if you run into any issues.