mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-09 14:19:43 +00:00
Add condition to prevent module being run multiple times.
Parallelisation means that some modules are going to be slower than the delay time, and therefore will pile up.
This commit is contained in:
parent
26d3628594
commit
b6c66204fd
1 changed files with 3 additions and 3 deletions
6
bar.sh
6
bar.sh
|
@ -15,7 +15,6 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
MODULES_DIR="/usr/share/dwmbar/modules/"
|
MODULES_DIR="/usr/share/dwmbar/modules/"
|
||||||
|
|
||||||
OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/"
|
OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/"
|
||||||
|
@ -67,8 +66,9 @@ run()
|
||||||
{
|
{
|
||||||
get_internet
|
get_internet
|
||||||
for module in $MODULES; do
|
for module in $MODULES; do
|
||||||
if [[ $INTERNET -eq 0 ]]; then
|
pgrep $module &> /dev/null
|
||||||
run_module $module
|
if [[ $INTERNET -eq 0 ]] && [[ $? -eq 1 ]]; then
|
||||||
|
run_module $module &
|
||||||
else
|
else
|
||||||
[[ $ONLINE_MODULES != *"$module"* ]] && run_module $module
|
[[ $ONLINE_MODULES != *"$module"* ]] && run_module $module
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue