Update indicator in Polybar bar not updated


#1

After I have installed updates, the update indicator still shows available updates, though there are no more updates.


#2

Is that before or after reboot ! Might do something.


#3

That’s before reboot. I find it somehow strange that I still see the indicator “5 Updates” just after I did the update. Not a major bug of course.


#4

Well , on my Tint2 I don t see updates at all, pimped it a bit , I look @ the terminal instead.


#5

I use the standard Archlabs Tint2 config. Therefore I consider that as a bug. But again: Not a major one.


#6

Cool , but wonder why it does so. Tried to search for it but had to go.


#7

You may want to use kexec, if you are too lazy for bios reboot or need to stay inside your session.


#8

try
sudo pacman -Syu
or
#pacman -Syu


#9

To add to @ector , I would try this before his command in terminal ;

Pacman -Scc

also. & see what it does.


#10

My system just told me that there are 6 new updates. I execute:

sudo pacman -Scc

Followed by

sudo pacman -Syu

The updates are applied. After that, the Tint2 update indicator still shows “6 Updates”. That’s no surprise IMO since I always do updates via

sudo pacman -Syu


#11

Sorry, I mixed it up. The update indicator is not shown in/by Tint2 but by Polybar. Just figured that out by looking into the polybar config. Seems, that a script update.sh is used to retrieve the update information.


#12

Wow, anyways that it s Polybar or Tint2 it should not be like that after updates.


#13

It’s a one time only command that runs when the polybar module is run with polybar. It doesn’t auto update after pacman is run; that would require some more elaborate scripting.

You can check the polybar module or script to see if there is a refresh rate and decrease it if you want.

Or restart polybar with something like:

pkill -x -SIGUSR1 polybar

after updating.


#14

We don’t have an update indicator for tint2 in our configs so this can’t be right.

Regarding the updates in polybar however, it’s a small script ~/bin/updates.sh (won’t be included with future releases) and it loops on two timers, one 30 min when no updates and the other 10 sec when updates. This is to avoid constantly hitting the server with requests and user cpu/network contantly, it’s unrealistic to do it more often and may still be too often. If you want it faster you can just decrease the sleep times.


#15

True @natemaia , the op corrected it in an above post stating it was in Polybar.


#16

That’s not quite right, it loops over a couple timers based on if there’s updates or not, worst case would be 30 min before the module would be updated, best case would be between 1-10 sec. See above.


#17

My mistake.


#18

No problem @natemaia , no biggie here . lol You might have went over it without knowing it, it happens .


#19

@natemaia: In my case that doesn’t work. Even 2 hours after I have updated the system, the update indicator still shows that there are updates (which is not the case). And as I have written, I did not change the standard config in this regard.


#20

Ok, I just did a fresh install to see a few things.

Polybar has changed something and tail modules no longer work.

Replace the script with something like this and it should be ok

#!/bin/bash

BAR_ICON=""
UPDATES=$(checkupdates 2>/dev/null | wc -l)

if (( UPDATES == 1 )); then
	echo "$UPDATES Update"
elif (( UPDATES > 1 )); then
	echo "$UPDATES Updates"
else
	echo $BAR_ICON
fi

and change the module to be

[module/pkg]
type = custom/script
exec = updates.sh
exec-if = "ping -q -w 2 -c 1 176.34.135.167 > /dev/null"
label-padding = 1
label = %output%

Same goes for the network script and module

#!/bin/bash

dc1='/' dc2='\' wl='' eth=''

if { ping -c 1 archlabslinux.com || ping -c 1 archlinux.org; } >/dev/null 2>&1; then
	if ip link | awk '/state UP/ {print $2}' | grep -q 'e*'; then
		echo "$eth"
	else
		echo "$wl"
	fi
	sleep 25
else
	echo "$dc1" && sleep 0.6 && echo "$dc2" && sleep 0.6
fi

module

[module/network]
type = custom/script
exec = check-network
click-left = networkmanager_dmenu &
click-right = networkmanager_dmenu &
label-padding = 1

Lemme know if that works for you.