Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fixed broken Dropbox icons in i3 (and probably other WMs with a few adjustments).
#!/bin/bash
WD="$HOME/.dropbox-dist/dropbox-lnx*/images/hicolor/16x16/status"
BGCOLOR=`ruby -e "puts File.read(ENV['HOME'] + '/.i3/config').gsub(/^.*bar\s\{.*colors\s\{.*background\s(#[0-9a-f]{6}).*$/m, '\1')"`
cd $WD
mkdir backup
cp ./*.png backup/
for i in ./*.png; do
echo -n "Adding background ($BGCOLOR) to $i ... "
convert $i -background "$BGCOLOR" -alpha remove $i
if [[ $? == 0 ]]; then
echo "OK"
else
echo "FAIL"
fi
done
echo -n "Restarting dropbox ..."
{ dropbox stop &> /dev/null && dropbox start &> /dev/null; } && echo "OK" || echo "FAIL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.