This file contains hidden or 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 | |
bat_low_threshold=$1 | |
poll_interval=60 # seconds | |
function bat_high { | |
local cap=$(cat /sys/class/power_supply/BAT0/capacity) | |
if [[ $cap -lt $bat_low_threshold ]]; then | |
return 1 | |
else |
This file contains hidden or 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
# 1. export bookmarks | |
# 2. awk -f cbdd.awk bookmarks_12_4_16.html > uniq.html | |
# 3. import uniq.html | |
BEGIN { FS = " " } | |
$2 ~ /^HREF/ { | |
if (!($2 in seen)) { | |
seen[$2] | |
print $0 |
This file contains hidden or 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) |