Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove startup delay #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions sbar
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,19 @@ trap "update_bat;display" "RTMIN+2"

while true
do
sleep 1 & wait && {
# to update item ever n seconds with a offset of m
## [ $((sec % n)) -eq m ] && udpate_item
[ $((sec % 5 )) -eq 0 ] && update_time # update time every 5 seconds
[ $((sec % 15)) -eq 0 ] && update_cpu # update cpu every 15 seconds
[ $((sec % 15)) -eq 0 ] && update_memory
[ $((sec % 60)) -eq 0 ] && update_bat
[ $((sec % 3600)) -eq 2 ] && update_weather
#[ $((sec % 300)) -eq 1 ] && update_event

# how often the display updates ( 5 seconds )
[ $((sec % 5 )) -eq 0 ] && display
sec=$((sec + 1))
}
# to update item ever n seconds with a offset of m
## [ $((sec % n)) -eq m ] && udpate_item
[ $((sec % 5 )) -eq 0 ] && update_time # update time every 5 seconds
[ $((sec % 15)) -eq 0 ] && update_cpu # update cpu every 15 seconds
[ $((sec % 15)) -eq 0 ] && update_memory
[ $((sec % 60)) -eq 0 ] && update_bat
[ $((sec % 3600)) -eq 2 ] && update_weather
#[ $((sec % 300)) -eq 1 ] && update_event

# how often the display updates ( 5 seconds )
[ $((sec % 5 )) -eq 0 ] && display
sec=$((sec + 1))
sleep 1 & wait
done