1
0
Fork 0

some cleanup

This commit is contained in:
Von Random 2015-06-27 18:12:44 +03:00
parent 233ba33ec7
commit 5e70c95984
12 changed files with 0 additions and 41 deletions

53
bspwm-fbt/panel/panel_status Executable file
View file

@ -0,0 +1,53 @@
#!/usr/bin/env bash
source "$HOME/.config/bspwm/common"
status::date() {
while true; do
printf 'date::%%{T2}%s%%{T}\n' "$(date '+%a %d %H:%M')"
sleep 1
done
}
status::updates() {
declare pkgs
while true; do
pkgs=( $(pacman -Qqu) )
pkgs_n=${#pkgs[@]}
if (( pkgs_n )); then
printf 'updates::[ Updates: %s ]\n' "${#pkgs[@]}"
else
printf 'updates::[ No updates ]\n'
fi
sleep 5
done
}
cleanup() {
kill $(jobs -p)
}
rexec() {
kill $(jobs -p)
exec "$0"
}
main() {
declare msg date
trap cleanup EXIT TERM INT
trap rexec HUP
modules=( date )
for i in "${modules[@]}"; do
"status::${i}" > "$panel_fifo" &
done
wait
}
main