Skip to content

Instantly share code, notes, and snippets.

View artursapek's full-sized avatar
🫃
ate too much

Artur Sapek artursapek

🫃
ate too much
View GitHub Profile
# for tmux status bar
info = `pmset -g batt`.split("\n")
perc = info[1].split(" ")[1].gsub(";","")
charging = info[0].include? "AC Power"
as_f = perc.to_f
if as_f > 75
status = "green"
bars = 4
elsif as_f > 50
status = "yellow"
#!/bin/sh
CACHE_FILE="$HOME/.config/outside.json"
CACHE_DIR="$(dirname "$CACHE_FILE")"
CACHE_MAX_AGE=600 # 10 minutes in seconds
# Create cache directory if it doesn't exist
mkdir -p "$CACHE_DIR"
current_time=$(date +%s)