You are not logged in.

#1 2022-09-07 14:17:51

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

[ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

DISCLAIMER: The module is unmaintained, since I've gone systemd-free

Scope/Features:

  • Notifications/Information only (no install shortcuts etc.)

  • Official packages only (I prefer handling the AUR separately)

  • Quick access to information about all available updates (waybar's tooltip is not meant for large amounts of info, imho)

  • Highlight most recent updates (fuzzy searchable)

  • Dynamic icon (5 different states, animated notifications)

  • Modularity (by using temporary files, which can be accessed by additional tools/scripts)

  • Simplicity (just a few lines of code, really)

Languages: Shell, Python, CSS

Run the script 'updatenotif.sh' at startup of your graphical environment (or you can use the systemd user service - see "Development" below). It will check for updates every ~30 minutes - you can manually refresh the database any time by right-clicking on the icon.
Please place script files (*.sh, *.py) inside '~/.local/bin/' and don't forget to make the shell scripts (*.sh) executable.
(It may be worth noting that I've appended comments to values that can be modified without breaking the module - given that the syntax is correct)

updatenotif.sh:

#!/bin/bash
#
#[EOL]
#
# This script depends on 'pacman-contrib'


[[ "${ULOCKER}" != "$0" ]] &&
	exec env ULOCKER="$0" flock -en "$0" "$0" "$@" || :

UPD=/tmp/upd/updates
UPV=/tmp/upd/versions
UPN=/tmp/upd/versions.new
UPO=/tmp/upd/versions.old
UBR=~/.local/bin/updbar.py

_sed_pc() {
	sed -i -e "10s/percentage\ =\ [0-9]*/percentage\ =\ $1/" \
		   -e "22s/percentage\ =\ [0-9]*/percentage\ =\ $2/" ${UBR}
}

_sed_cl() {
	sed -i "27s/clss =\ .*\ #/clss\ =\ \"$1\"\ #/" ${UBR}
}

_sed_nw() {
	local IFS=$'\n'
	for i in $(< ${UPN})
		do sed -i "s/$i.*/&\ \ \ NEW/" ${UPV}
		done

	sed -i "s/NEW.*/NEW/g" ${UPV}
}

_sig() {
	pkill -x -SIGRTMIN+9 waybar
}

mkdir -p /tmp/upd ; : > ${UPN} ; echo 0 > ${UPD}

echo "$$" > /tmp/upd/PID

while [[ -f ${UPD} ]]
	do
		echo "refreshing" > ${UPV} ; _sig

		checkupdates -n > ${UPO}

		if ping -n -c 1 -W 5 archlinux.org >/dev/null 2>&1
		then
			_sed_pc 100 0 ; checkupdates | tee ${UPV} | wc -l > ${UPD}

			if diff ${UPV} ${UPO} >/dev/null 2>&1
			then
				[[ -s ${UPV} ]] || : > ${UPN}

				_sed_cl updates ; _sed_nw ; _sig
			else
				comm -23 ${UPV} ${UPO} 2>/dev/null | cut -d' ' -f 1,2 > ${UPN}

				_sed_cl new-updates ; _sed_nw ; _sig

				# If you want to add an acoustic notification, this would be the place
				# (needs logging out/in to take effect):
				#paplay /path/to/sound.file &
			fi
			
			sleep 10 && _sed_cl updates ; _sig
			sleep 0.5h # Interval in which to check for updates
		else # 'offline' mode
			if checkupdates -n >/dev/null 2>&1
			then
				_sed_pc 70 70 ; : > ${UPV} ; _sig

				sleep 3m # Interval in which to retry ('updates' state)
			else
				_sed_pc 30 30 ; : > ${UPV} ; _sig

				sleep 3m # Interval in which to retry ('up-to-date' state)
			fi
		fi
	done

# Source code: "https://bbs.archlinux.org/viewtopic.php?id=279522"

module:

    "custom/updates": {
        "format": "{icon} {0}", // normal size, count appended
    //    "format": "<span size='large'>{icon}</span>", // large size, no count appended
        "format-icons": ["", "", "", "", ""],
        "return-type":"json",
        "exec-if": "[ -f /tmp/upd/updates ]",
        "exec": "python ~/.local/bin/updbar.py",
        "on-click": "~/.local/bin/chckpds.sh", // menu feature
        "on-click-right": "~/.local/bin/updbar_rst.sh", // refreshes the database
        "signal": 9,
        "tooltip": true
    },

updbar.py:

#!/usr/bin/python

from os import path, stat
from datetime import datetime as dt

upd = '/tmp/upd/updates'
upv = '/tmp/upd/versions'
upv_n = '/tmp/upd/versions.new'

percentage = 100 # don't move [10]
tooltip = open(upd, 'r').read().rstrip("\n")

with open(upv_n, 'r') as cn:
    new_c = sum(1 for _ in cn)

mod_tstamp_v = path.getmtime(upv)
mod_tstamp_n = path.getmtime(upv_n)
mod_datetime_v = dt.fromtimestamp(mod_tstamp_v).strftime("%H:%M %d %b")
mod_datetime_n = dt.fromtimestamp(mod_tstamp_n).strftime("%H:%M %d %b")

if stat(upv).st_size == 0:
    percentage = 0 # don't move [22]
    clss = "up-to-date"
else:
    if open(upv, 'r').read().rstrip("\n") != 'refreshing':
        percentage = 100
        clss = "updates" # don't move [27]
    else:
        percentage = 50
        clss = "refreshing"
        tooltip = "refreshing db..."

bttn = "<span color=\'#555555\'>On click: view updates\\nRight-click: refresh db</span>"

if percentage != 30 and percentage != 70:
    match clss:
        case 'refreshing':
            print(f'{{"class":"{clss}","percentage": {percentage},"tooltip": "{tooltip}"}}')
        case 'new-updates':
            print(f'{{"class":"{clss}","percentage": {percentage},"tooltip": "{new_c} '\
                  f'new update(s) found...","text":"<span color=\'#4CDD85\'>{new_c}</span>"}}')
        case _:
            print(f'{{"class":"{clss}","percentage": {percentage},"tooltip": "Total: '\
                  f'<span color=\'#1793D1\'>{tooltip}</span>  @{mod_datetime_v}\\nNew: '\
                  f'<span color=\'#4CDD85\'>{new_c}</span>  @{mod_datetime_n}\\n{bttn}",'\
                  f'"text":"<span color=\'#1793D1\'>{tooltip}</span>"}}')
else:
    clss = "offline"
    print(f'{{"class":"{clss}","percentage": {percentage},"tooltip": "{clss}"}}')

# Source code: "https://bbs.archlinux.org/viewtopic.php?id=279522"

updbar_rst.sh:

#!/bin/bash

UPD=/tmp/upd/updates
UPV=/tmp/upd/versions
UPN=/tmp/upd/versions.new
UPO=/tmp/upd/versions.old
UBR=~/.local/bin/updbar.py

_sed_pc() {
	sed -i -e "10s/percentage\ =\ [0-9]*/percentage\ =\ $1/" \
		   -e "22s/percentage\ =\ [0-9]*/percentage\ =\ $2/" ${UBR}
}

_sed_cl() {
	sed -i "27s/clss =\ .*\ #/clss\ =\ \"$1\"\ #/" ${UBR}
}

_sed_nw() {
	local IFS=$'\n'
	for i in $(< ${UPN})
		do sed -i "s/$i.*/&\ \ \ NEW/" ${UPV}
		done

	sed -i "s/NEW.*/NEW/g" ${UPV}
}

_sig() {
	pkill -x -SIGRTMIN+9 waybar
}

echo "refreshing" > ${UPV} ; _sig

checkupdates -n > ${UPO}

if ping -n -c 1 -W 5 archlinux.org >/dev/null 2>&1
then
	_sed_pc 100 0 ; checkupdates | tee ${UPV} | wc -l > ${UPD}

	if diff ${UPV} ${UPO} >/dev/null 2>&1
	then
		[[ -s ${UPV} ]] || : > ${UPN}

		_sed_cl updates ; _sed_nw ; _sig
	else
		comm -23 ${UPV} ${UPO} 2>/dev/null | cut -d' ' -f 1,2 > ${UPN}

		_sed_cl new-updates ; _sed_nw ; _sig
	fi

	if pidof waybar >/dev/null 2>&1
	then
		sleep 10 && _sed_cl updates ; _sig
	else
		_sed_cl updates
	fi
else
	if checkupdates -n >/dev/null 2>&1
	then
		_sed_pc 70 70 ; : > ${UPV} ; _sig
	else
		_sed_pc 30 30 ; : > ${UPV} ; _sig
	fi
fi

# Source code: "https://bbs.archlinux.org/viewtopic.php?id=279522"

style:

@keyframes new-updates {
  from {color:transparent;}
    to {color:#4CDD85;}
}

@keyframes refreshing {
  from {color:#555555;}
    to {color:#1793D1;}
}

#custom-updates {
    color: #555555;
}

#custom-updates.up-to-date {
    color: #555555;
}

#custom-updates.updates {
    color: #00CF52;
}

#custom-updates.new-updates {
    animation-name: new-updates;
    animation-duration: 0.5s;
    animation-direction: alternate;
    animation-iteration-count: infinite;
}

#custom-updates.refreshing {
    animation-name: refreshing;
    animation-duration: 1.5s;
    animation-direction: alternate;
    animation-iteration-count: infinite;
}

#custom-updates.offline {
    color: #E2426C;
}

# Menu

Two examples shown below - or simply create your own based on these scripts (NOTE: pick 'bemenu' if you consider/are using the 'RI module')

chckpds.sh ('fuzzel' version):

#!/bin/bash
#
#
# This script depends on 'fuzzel'

set -e

UPV=/tmp/upd/versions
UPN=/tmp/upd/versions.new

[[ "$(< ${UPV})" = "refreshing" ]] && exit
pidof fuzzel >/dev/null 2>&1 && pkill -x fuzzel && exit

ps -q $(< /tmp/upd/PID) >/dev/null 2>&1 &&
	STT="running" || STT="stopped"

_fzz() {
	fuzzel -d -w 80 --font=monospace:size=9 --background=111111EE \
		--border-color=111111FF --text-color=999999FF \
		--selection-text-color=FFFFFFBB --log-level=none \
		--log-no-syslog "$1"
}

_pcl() {
	[[ $(ps -ef | grep '[f]oot --server') ]] &&
		footclient -w 1800x900 ~/.local/bin/pclinf.sh &
}

if [[ -s ${UPV} ]]
then
	_fzz --prompt="[Total: $(cat ${UPV} | wc -l) |New: $(cat ${UPN} |
		wc -l) |${STT}] " < ${UPV} > /dev/null 

	_pcl
else
	if python ~/.local/bin/updbar.py | grep "up-to-date" >/dev/null 2>&1
	then
		echo " " | _fzz --prompt="[${STT}] " > /dev/null
	else
		checkupdates -n | _fzz --prompt="[offline|${STT}] " > /dev/null
	
		_pcl
	fi
fi

# Source code: "https://bbs.archlinux.org/viewtopic.php?id=279522"

chckpds.sh ('bemenu' version):

#!/bin/bash
#
#
# This script depends on 'bemenu-wayland'

set -e

UPV=/tmp/upd/versions
UPN=/tmp/upd/versions.new

[[ "$(< ${UPV})" = "refreshing" ]] && exit
pidof bemenu >/dev/null 2>&1 && pkill -x bemenu && exit

ps -q $(< /tmp/upd/PID) >/dev/null 2>&1 &&
	STT="running" || STT="stopped"

_bmn() {
	bemenu --fn 'monospace 12' -i -l 15 -n -s -w -W 0.5 \
		--cw 1 --cf \#555555 --nf \#999999 --hf \#FFFFFF \
		--tf \#999999 "$1"
}

_pcl() {
	footclient -w 1800x900 --title=pclinfo ~/.local/bin/pclinf.sh &
}

if [[ -s ${UPV} ]]
then
	_bmn --prompt="[Total: $(cat ${UPV} | wc -l) |New: $(cat ${UPN} |
		wc -l) |${STT}] " < ${UPV} > /dev/null 

	_pcl
else
	if python ~/.local/bin/updbar.py | grep "up-to-date" >/dev/null 2>&1
	then
		echo " " | _bmn --prompt="[${STT}] " > /dev/null
	else
		checkupdates -n | _bmn --prompt="[offline|${STT}] " > /dev/null

		_pcl
	fi
fi

# Source code: "https://bbs.archlinux.org/viewtopic.php?id=279522"

For more info on how to add the module to waybar, please consult:
https://github.com/Alexays/Waybar

Additional links:
https://gitlab.archlinux.org/pacman/pacman-contrib
https://codeberg.org/dnkl/fuzzel
https://github.com/Cloudef/bemenu


pclinf.sh (advanced menu, template/incentive - can be envoked from the default menu by pressing 'Enter'):

#!/bin/bash
#
#
cat <<MOS

──────────────────────────────────────────────────────────────────────────────

This script depends on:

'foot' (server)
'fzf'
'w3m'
'wl-clipboard'

If you intend to replace the "default" menu with this script,
then put it inside '~/.local/bin/', and edit the module like so:

		"on-click": "footclient -w 1800x1000 ~/.local/bin/pclinf.sh",
		
──────────────────────────────────────────────────────────────────────────────

MOS


_chg="Changelog ['q': return]"
_pct="pactree -r"
_pkk="pacman -Qkk"
_nqu="New query"

UPV=/tmp/upd/versions
URL=https://gitlab.archlinux.org/archlinux/packaging/packages/
PS3="q) Quit
───────────────────────────
: "

_pmn() {
	echo "Package '$(wl-paste)':"
	echo
	echo "1) ${_chg}"
	echo "2) ${_pct}"
	echo "3) ${_pkk}"
	echo "4) ${_nqu}"
}

_fzf_upd() {
	fzf --cycle --color=fg+:#1793D1 --preview='pacman -Qii {1}' \
		--preview-window=top,60% --bind 'right:toggle-preview-wrap' \
		--layout=reverse
}

_wlp() {
	cut -d' ' -f 1 | wl-copy
}

if [[ -s ${UPV} ]]
then
	_fzf_upd < ${UPV} | _wlp
else
	checkupdates -n | _fzf_upd | _wlp
fi

if [[ -z "$(wl-paste)" ]]
then
	echo
	echo "Exiting..."
	sleep 0.5
	exit
fi

echo
echo "Package '$(wl-paste)':"
echo

select cmd in "${_chg}" \
			  "${_pct}" \
			  "${_pkk}" \
			  "${_nqu}"
	do case $cmd in

		"${_chg}")
				if curl -s ${URL}/$(wl-paste | cut -d'-' -f 1,2)/-/commits/main |
					grep "You are being\|redirected" >/dev/null 2>&1
				then
					echo
					echo "Sorry, the URL cannot be resolved."
					echo "Please use the search function on 'https://gitlab.archlinux.org/archlinux/packaging/packages/'"
					echo
				else
					w3m "${URL}/$(wl-paste | cut -d'-' -f 1,2)/-/commits/main"
					echo
				fi
				_pmn
				;;
		"${_pct}")
				echo
				pactree -r $(wl-paste)
				echo
				_pmn
				;;
		"${_pkk}")
				echo
				pacman -Qkk $(wl-paste)
				echo
				_pmn
				;;
		"${_nqu}")
				[[ "$(< ${UPV})" = "refreshing" ]] && exit 1
													
				if [[ -s ${UPV} ]]
				then
					_fzf_upd < ${UPV} | _wlp
				else
					checkupdates -n | _fzf_upd | _wlp
				fi
				
				if [[ -z "$(wl-paste)" ]]
				then
					echo
					echo "Exiting..."
					sleep 0.5
					break
				fi

				echo
				_pmn
				;;
		*)
				break
				;;
		esac
	done

# Source code: "https://bbs.archlinux.org/viewtopic.php?id=279522"

Last edited (2023-12-03 09:02)

CHANGELOG: 'This module has reached EOL - it *should* keep working in the foreseeable future, unless 'checkupdates' introduces breaking changes...'

Last edited by dogknowsnx (2024-10-16 13:27:09)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#2 2022-09-07 15:27:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,262
Website

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

You shouldn't need to store an endless string of numbers in the temp file, just one would suffice (which simplifies all the head|tail work):

#!/bin/sh

UPD=/tmp/updates

cur=$(checkupdates | wc -l)
read prev 2>/dev/null <$UPD

[ $cur -le ${prev:-0} ] && exit
echo $cur >| $UPD

notify-send -t 10000 \
	--icon=/usr/share/icons/Papirus-Dark/48x48/apps/mx-updater.svg \
	"Updates:" "$cur"

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2022-09-07 15:42:07

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

### Desktop notifications ###

This script is not actively maintained, but I'm happy to address possible issues,
it *should* also still work with 'chckpds.sh' (menu script) from post #1...

updatenotif.sh:

#!/bin/bash
#
#
### Description:
#
# Run this script at startup of your graphical
# environment. It will check for updates every
# 30 minutes.
#
### Dependencies:
#
# 'libnotify'
# 'pacman-contrib'
# 'fnott' (or a notification daemon of your choice),
# please also see: "https://wiki.archlinux.org/title/Desktop_notifications"
# 'fuzzel' (optional, menu feature)
# 'papirus-icon-theme' (optional)


[[ "${ULOCKER}" != "$0" ]] &&
	exec env ULOCKER="$0" flock -en "$0" "$0" "$@" || :

UPV=/tmp/upd/versions
UPN=/tmp/upd/versions.new
UPO=/tmp/upd/versions.old

_nsd() {
	notify-send -t 10000 \
		"UPDATES" "$(cat ${UPV} | wc -l) |NEW: $(cat ${UPN} | wc -l) " \
			--icon=/usr/share/icons/Papirus-Dark/48x48/apps/mx-updater.svg "$@"
}

_sed_nw() {
	local IFS=$'\n'
	for i in $(< ${UPN})
		do sed -i "s/$i.*/&\ \ \ NEW/" ${UPV}
		done

	sed -i "s/NEW.*/NEW/g" ${UPV}
}

rm -fr /tmp/upd ; mkdir /tmp/upd ; : > ${UPN}

sleep 5

while [[ -d /tmp/upd ]]
	do
		checkupdates -n > ${UPO}
		
		if ping -n -c 1 -W 9 archlinux.org >/dev/null 2>&1
		then
			checkupdates > ${UPV}
			
			if [[ -s ${UPV} ]]
			then
				if diff ${UPV} ${UPO} >/dev/null 2>&1
				then
					_sed_nw
				else
					comm -23 ${UPV} ${UPO} 2>/dev/null | cut -d' ' -f 1,2 > ${UPN}

					_sed_nw ; _nsd #--urgency=low # uncomment for silent popups			
				fi
			fi

			sleep 0.5h # Interval in which to check for updates
		else
			sleep 5m # Interval in which to retry
		fi
	done

# Source code: "https://bbs.archlinux.org/viewtopic.php?id=279522"

Additional links:
https://gitlab.archlinux.org/pacman/pacman-contrib
https://gitlab.gnome.org/GNOME/libnotify

Last edited by dogknowsnx (2024-10-11 08:22:28)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#4 2023-05-01 16:00:46

arnavgr
Member
Registered: 2023-05-01
Posts: 6

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

@dogknowsnx this didnt work for me. When i try to run chckpds.sh i get:

cat: /tmp/upd_versions: No such file or directory
./chckpds.sh: line 8: /tmp/upd_versions: No such file or directory

do i have to create these directories or should they be present by default?

Offline

#5 2023-05-01 18:54:33

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

arnavgr wrote:

do i have to create these directories or should they be present by default?

If 'updatenotif.sh' is properly launched at startup of your graphical environment, both files will be created "by default" - '/tmp/upd_versions' won't be created unless there is a network connection - the script will retry fetching updates every 5 minutes.

Which DE/Window Manager are you running and how do you start 'updatenotif.sh'?

EDIT: If it's only 'chckpds.sh' that fails for you, there's a chance that you're running an older version of 'updatenotif.sh' and you would have updated partially - which is not supported on Arch tongue
Please also make sure to have read the notes at the bottom of post #1 before posting...

Last edited by dogknowsnx (2023-05-02 07:40:33)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#6 2023-05-02 12:42:34

arnavgr
Member
Registered: 2023-05-01
Posts: 6

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

dogknowsnx wrote:
arnavgr wrote:

do i have to create these directories or should they be present by default?

If 'updatenotif.sh' is properly launched at startup of your graphical environment, both files will be created "by default" - '/tmp/upd_versions' won't be created unless there is a network connection - the script will retry fetching updates every 5 minutes.

Which DE/Window Manager are you running and how do you start 'updatenotif.sh'?

EDIT: If it's only 'chckpds.sh' that fails for you, there's a chance that you're running an older version of 'updatenotif.sh' and you would have updated partially - which is not supported on Arch tongue
Please also make sure to have read the notes at the bottom of post #1 before posting...

Ok i use hyprland i have placed updatenotif.sh in ~/.bin ( which is added to $PATH)

i added the line exec-once = ~/bin/updatenotif.sh & in hyprland.conf

https://github.com/arnavgr/dotfiles/tre … fig/waybar is where i have it setup. If theres anything wrong that im doing please help me

Offline

#7 2023-05-02 12:58:26

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

arnavgr wrote:

Ok i use hyprland i have placed updatenotif.sh in ~/.bin ( which is added to $PATH)

i added the line exec-once = ~/bin/updatenotif.sh & in hyprland.conf

https://github.com/arnavgr/dotfiles/tre … fig/waybar is where i have it setup. If theres anything wrong that im doing please help me

Well, there are already a couple of problems. First, you are stating two paths ('~/bin' and '~/.bin'), which one is in your $PATH? And second, for convenience (and to prevent issues like you're describing) I picked '~/.local/bin/' as the location where additional scripts will be looked for - $PATH is irrelevant in this use case. If you want to use $PATH, you can grep -n the code above for '~/.local/bin/' and remove that part and only leave the script's name in place (untested on my part and possibly error-prone, but *should* work). Or you can simply place the scripts inside '~/.local/bin/' and your issue *should* be solved...

EDIT: Third, looking over the scripts in your .dotfiles I can tell you that you're running a partial update - please replace the scripts by the ones from post #1.

EDIT#2: You may want to also check your waybar config, since there appear to be a few too many open brackets...

Last edited by dogknowsnx (2023-05-02 13:44:28)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#8 2023-05-02 14:09:19

arnavgr
Member
Registered: 2023-05-01
Posts: 6

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

dogknowsnx wrote:
arnavgr wrote:

Ok i use hyprland i have placed updatenotif.sh in ~/.bin ( which is added to $PATH)

i added the line exec-once = ~/bin/updatenotif.sh & in hyprland.conf

https://github.com/arnavgr/dotfiles/tre … fig/waybar is where i have it setup. If theres anything wrong that im doing please help me

Well, there are already a couple of problems. First, you are stating two paths ('~/bin' and '~/.bin'), which one is in your $PATH? And second, for convenience (and to prevent issues like you're describing) I picked '~/.local/bin/' as the location where additional scripts will be looked for - $PATH is irrelevant in this use case. If you want to use $PATH, you can grep -n the code above for '~/.local/bin/' and remove that part and only leave the script's name in place (untested on my part and possibly error-prone, but *should* work). Or you can simply place the scripts inside '~/.local/bin/' and your issue *should* be solved...

EDIT: Third, looking over the scripts in your .dotfiles I can tell you that you're running a partial update - please replace the scripts by the ones from post #1.

EDIT#2: You may want to also check your waybar config, since there appear to be a few too many open brackets...

1) im sorry i accidentally wrote ~/.bin i meant ~/bin (~/bin has been added to $PATH using   PATH="$HOME/bin:$PATH")
2) does adding scripts to ~/.local/bin automatically adds the scripts to $PATH, if so that solves a lot of my problems
3)i see what you mean, i usually just add }, instead of } and then }, because it works. i will fix it and see if things change

Offline

#9 2023-05-02 14:20:34

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

arnavgr wrote:

1) im sorry i accidentally wrote ~/.bin i meant ~/bin (~/bin has been added to $PATH using   PATH="$HOME/bin:$PATH")
2) does adding scripts to ~/.local/bin automatically adds the scripts to $PATH, if so that solves a lot of my problems
3)i see what you mean, i usually just add }, instead of } and then }, because it works. i will fix it and see if things change

2) No, you would have to export it e.g. in your shell's rc file

export PATH=$PATH:$HOME/.local/bin/

but that's a different issue.

I'd suggest you try the whole thing as is (and as is intended) without editions/customizations first and see if it's working for you. Then It'll be easier to troubleshoot (for me, but also for you).

Last edited by dogknowsnx (2023-05-02 14:21:25)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#10 2023-05-02 14:49:52

arnavgr
Member
Registered: 2023-05-01
Posts: 6

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

dogknowsnx wrote:
arnavgr wrote:

1) im sorry i accidentally wrote ~/.bin i meant ~/bin (~/bin has been added to $PATH using   PATH="$HOME/bin:$PATH")
2) does adding scripts to ~/.local/bin automatically adds the scripts to $PATH, if so that solves a lot of my problems
3)i see what you mean, i usually just add }, instead of } and then }, because it works. i will fix it and see if things change

2) No, you would have to export it e.g. in your shell's rc file

export PATH=$PATH:$HOME/.local/bin/

but that's a different issue.

I'd suggest you try the whole thing as is (and as is intended) without editions/customizations first and see if it's working for you. Then It'll be easier to troubleshoot (for me, but also for you).

OK so here's what i changed:

1) created .~/.local/bin and added all three scripts (updbar.sh, chckpds.sh, updatenotif.sh)
2) changed config module in waybar. changed hyprland.conf to exec ~/.local/bin/updatenotif.sh
3) restarted hyprland

the module does not show on my waybar but:

1) chckpds.sh opens fuzzel and shows updates
2) htop shows ./updatenotif.sh running
3) updbar.sh appends {"class":"new-updates","percentage": 100,"tooltip":"Updates: 12\n\n(on click: view updates)\n(right-click: refresh db)"}

2 things i wanted to clarify:

1) im using waybar-hypland-git package from aur(to display workspaces)
2) i have symlinked waybar from my git repo to ~/.config does that affect anything?

Offline

#11 2023-05-02 14:59:39

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

As to the last two points: i honestly have no idea and currently won't be able to test this.

What does waybar report, if you start it from your terminal (wild guess: you are still using the wrong path(s) in your waybar config...)?

EDIT: Ok, I saw you've changed it to '~/.local/bin/' - what about those brackets, then? And did you try with a local config file for waybar?

Anyway,

dogknowsnx wrote:

I'd suggest you try the whole thing as is (and as is intended) without editions/customizations first and see if it's working for you. Then It'll be easier to troubleshoot (for me, but also for you).

Last edited by dogknowsnx (2023-05-03 20:07:38)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#12 2023-05-02 16:04:00

arnavgr
Member
Registered: 2023-05-01
Posts: 6

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

dogknowsnx wrote:

As to the second last points: i honestly have no idea and currently won't be able to test this.

What does waybar report, if you start it from your terminal (wild guess: you are still using the wrong path(s) in your waybar config...)?

EDIT: Ok, I saw you've changed it to '~/.local/bin/' - what about those brackets, then? And did you try with a local config file for waybar?

Anyway,

dogknowsnx wrote:

I'd suggest you try the whole thing as is (and as is intended) without editions/customizations first and see if it's working for you. Then It'll be easier to troubleshoot (for me, but also for you).


i dont know what you mean by those brackets, can u elabolarte. btw thank you for helping me

Offline

#13 2023-05-02 16:10:02

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

Please try this: copy the module from post #1 and add it on top of your other modules in your config - also did you try starting waybar from the terminal to see what it reports?

Edited...

Last edited by dogknowsnx (2023-05-02 16:10:43)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#14 2023-05-02 17:23:47

arnavgr
Member
Registered: 2023-05-01
Posts: 6

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

Yo PLACING THIS ON TOP OF ALL OTHER MODULES WORKED THANK YOU SO MUCH

Last edited by arnavgr (2023-05-02 17:39:10)

Offline

#15 2023-05-02 17:44:35

dogknowsnx
Member
Registered: 2021-04-12
Posts: 652

Re: [ WAYBAR MODULE *EOL* ] Notifications for Arch Linux package updates

arnavgr wrote:

Yo PLACING THIS ON TOP OF ALL OTHER MODULES WORKED THANK YOU SO MUCH

Great, enjoy!

Last edited by dogknowsnx (2023-05-02 17:45:22)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

Board footer

Powered by FluxBB