Last active
August 29, 2015 14:21
-
-
Save lillesvin/c5bf7d4161be5ab6a739 to your computer and use it in GitHub Desktop.
Fixed broken Dropbox icons in i3 (and probably other WMs with a few adjustments).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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