aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-24 20:33:19 +0100
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-24 20:33:19 +0100
commitb6c66204fd96231cea02fcf98dbb376a9e1bed07 (patch)
treec6a98ad8d29963bf05e5ace67eb0f083a6846cd0
parent26d3628594fd20313f19675851051c3bbbc91c44 (diff)
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.
-rwxr-xr-xbar.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/bar.sh b/bar.sh
index f9866f4..63bff6f 100755
--- a/bar.sh
+++ b/bar.sh
@@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-
MODULES_DIR="/usr/share/dwmbar/modules/"
OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/"
@@ -67,8 +66,9 @@ run()
{
get_internet
for module in $MODULES; do
- if [[ $INTERNET -eq 0 ]]; then
- run_module $module
+ pgrep $module &> /dev/null
+ if [[ $INTERNET -eq 0 ]] && [[ $? -eq 1 ]]; then
+ run_module $module &
else
[[ $ONLINE_MODULES != *"$module"* ]] && run_module $module
fi