Created
September 25, 2016 02:52
-
-
Save sach1t/b1f9cc96f503ad69d6702b58de243c07 to your computer and use it in GitHub Desktop.
Kuler Color Background for Gnome
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
COLOR_FILE='/tmp/colors' | |
if [ ! -e "$COLOR_FILE" ]; then | |
tmp_file=$(mktemp) | |
wget -q -O "$tmp_file" --header='Accept: text/html' --user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0' 'https://kuler-api.adobe.com/feeds/rss/get.cfm?itemsPerPage=100&listType=popular' | |
grep -F "kuler:swatchHexColor" "$tmp_file" | sed 's/<[\/]*kuler:swatchHexColor>//g' | sed 's/ //g' > "$COLOR_FILE" | |
rm "$tmp_file" | |
fi | |
total_colors=$(wc -l "$COLOR_FILE" | cut -d' ' -f1) | |
random_line=$(((RANDOM % total_colors) + 1)) | |
color=$(sed -n "${random_line}p" "$COLOR_FILE") | |
gsettings set org.gnome.desktop.background primary-color "#${color}" | |
gsettings set org.gnome.desktop.background secondary-color "#${color}" | |
gsettings set org.gnome.desktop.background color-shading-type "solid" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gets a random color from the top 100 most popular color schemes on Kuler, and sets that as the background.