You are not logged in.
NOTE: If you came here by clicking on the link in my signature and expected to find desktop notifications, please have a look at post #3
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)
Run the script 'updatenotif.sh' at startup of your graphical environment. 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) inside '~/.local/bin/' and don't forget to make them 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
#
#[v3.3.1]
#
# 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.sh
sed_pc() {
sed -i -e "6s/percentage=[0-9\"]*/percentage=\"$1\"/" \
-e "11s/percentage=[0-9\"]*/percentage=\"$2\"/" ${UBR}
}
sed_cl() {
sed -i "17s/class=.*\ #/class=\"$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}
}
rm -fr /tmp/upd ; mkdir /tmp/upd ; : > ${UPN}
sleep 5 && echo 0 > ${UPD}
while [ -f ${UPD} ]
do
checkupdates -n > ${UPO}
echo "refreshing" > ${UPV} && pkill -x -SIGRTMIN+9 waybar
if ping -n -c 1 -W 9 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
sed_cl updates ; sed_nw
else
comm -23 ${UPV} ${UPO} 2>/dev/null | cut -d' ' -f 1,2 > ${UPN}
sed_cl new-updates ; sed_nw
# If you want to add an acoustic notification, this would be the place
# (needs logging out/in to take effect):
#sleep 9 && aplay -q /path/to/sound.file &
fi
sleep 15 && sed_cl updates
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}
sleep 3m # Interval in which to retry ('updates' state)
else
sed_pc 30 30 ; : > ${UPV}
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 (NOTE: in case you are on 'hyprland', swap the 'on-click' commands):
"custom/updates": {
"format": "{icon}{}",
"format-icons": ["", "", "", "", ""],
"interval": 10,
"return-type":"json",
"exec-if": "[ -f /tmp/upd/versions ]",
"exec": "~/.local/bin/updbar.sh",
"on-click": "~/.local/bin/chckpds.sh",
// "on-click": "sleep 0.15 && ~/.local/bin/chckpds.sh", // workaround for 'hyprland'
"on-click-right": "~/.local/bin/updbar_rst.sh",
"signal": 9,
"tooltip": true
},
updbar.sh:
#!/bin/bash
UPD=/tmp/upd/updates
UPV=/tmp/upd/versions
UPN=/tmp/upd/versions.new
percentage="100" # don't move [6]
tooltip="<span color='#1793D1'>$(< ${UPD})</span>" # 'total' color
if [ ! -s ${UPV} ]
then
percentage="0" # don't move [11]
class="up-to-date"
else
if [[ "$(cat ${UPV})" != "refreshing" ]]
then
percentage="100"
class="updates" # don't move [17]
else
percentage="50"
class="refreshing"
tooltip="${class} db..."
fi
fi
[ ! -x /usr/bin/fuzzel ] &&
menu="[on click: *please install 'fuzzel'*]\n[right-click: refresh db]" ||
menu="[on click: view updates]\n[right-click: refresh db]"
synced=" @$(date -r ${UPV} +'%H:%M %d %b')"
synced_n=" @$(date -r ${UPN} +'%H:%M %d %b')"
new="New updates: <span color='#4CDD85'>$(cat ${UPN} | wc -l)</span>" # 'new' color
if [[ "${percentage}" != "30" ]] && [[ "${percentage}" != "70" ]]
then
if [[ "${class}" = "refreshing" ]]
then
printf '%s\n' "{\"class\":\"$class\",\"percentage\": $percentage,\"tooltip\":\
\"$tooltip\"}"
else
printf '%s\n' "{\"class\":\"$class\",\"percentage\": $percentage,\"tooltip\":\
\"Updates total: $tooltip$synced\n$new$synced_n\n\n$menu\"}"
# Alternatively, if you want the number of updates to be shown on the bar,
# comment the command above and uncomment the one below:
#printf '%s\n' "{\"class\":\"$class\",\"percentage\": $percentage,\"tooltip\":\
# \"Updates total: $tooltip$synced\n$new$synced_n\n\n$menu\",\"text\":\"$tooltip\"}"
fi
else
class="offline"
printf '%s\n' "{\"class\":\"$class\",\"percentage\": $percentage,\"tooltip\":\"$class\"}"
fi
# 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.sh
sed_pc() {
sed -i -e "6s/percentage=[0-9\"]*/percentage=\"$1\"/" \
-e "11s/percentage=[0-9\"]*/percentage=\"$2\"/" ${UBR}
}
sed_cl() {
sed -i "17s/class=.*\ #/class=\"$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}
}
checkupdates -n > ${UPO}
echo "refreshing" > ${UPV} && pkill -x -SIGRTMIN+9 waybar
if ping -n -c 1 -W 9 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
sed_cl updates ; sed_nw
else
comm -23 ${UPV} ${UPO} 2>/dev/null | cut -d' ' -f 1,2 > ${UPN}
sed_cl new-updates ; sed_nw
fi
sleep 15 && sed_cl updates
else
if checkupdates -n >/dev/null 2>&1
then
sed_pc 70 70 ; : > ${UPV}
else
sed_pc 30 30 ; : > ${UPV}
fi
fi
# Source code: "https://bbs.archlinux.org/viewtopic.php?id=279522"
style (change to your liking except 'animation-duration: 10s' and 'animation-duration' x 'animation-iteration-count' = 10s respectively):
@keyframes new-updates {
to {color:#4CDD85;}
}
@keyframes refreshing {
0% {color:#555555;}
20% {color:#1793D1;}
40% {color:#555555;}
60% {color:#1793D1;}
80% {color:#555555;}
95% {color:#1793D1;}
100% {color:transparent;}
}
#custom-updates {
color: #555555;
}
#custom-updates.up-to-date {
/* color: #555555;*/
}
#custom-updates.updates {
color: #00CF52;
}
#custom-updates.new-updates {
color: transparent;
animation-name: new-updates;
animation-iteration-count: 20;
animation-direction: alternate;
animation-duration: 0.5s;
}
#custom-updates.refreshing {
animation-name: refreshing;
animation-timing-function: linear;
animation-duration: 10s;
}
#custom-updates.offline {
/* color: #E2426C;*/
}
chckpds.sh (menu feature):
#!/bin/bash
#
#
# This script depends on 'fuzzel'
set -e
UPV=/tmp/upd/versions
UPN=/tmp/upd/versions.new
[[ "$(cat ${UPV})" = "refreshing" ]] && exit 1
fzz() {
fuzzel -d -w 80 -R --font=monospace:size=9 --background=111111EE \
--border-color=111111FF --selection-color=111111EE --text-color=999999FF \
--selection-text-color=FFFFFFBB --log-level=none --log-no-syslog "$1"
}
pcl() {
[[ $(ps -ef | grep '[f]ootclient') ]] &&
footclient -w 1800x1000 ~/.local/bin/pclinf.sh &
}
if [ -s ${UPV} ]
then
fzz --prompt="[Total: $(cat ${UPV} | wc -l) |New: $(cat ${UPN} | wc -l) ] " < ${UPV} > /dev/null
pcl
else
checkupdates -n | fzz --prompt="[offline] " > /dev/null
pcl
fi
###
# Of course you could use any dmenu implementation - here's an example using 'wofi':
# (please comment out lines 25 and 26 inside 'updbar.sh' first:
#
# #[ ! -x /usr/bin/fuzzel ] &&
# # menu="[on click: *please install 'fuzzel'*]\n[right-click: refresh db]" ||
# )
#
### 'wofi'- example:
#
#
#UPV=/tmp/upd/versions
#UPN=/tmp/upd/versions.new
#
#[[ "$(cat ${UPV})" = "refreshing" ]] && exit 1
#[ $(pidof wofi) ] && pkill -x wofi && exit
#
#if [ -s ${UPV} ]
#then
# wofi -d -O alphabetical \
# --prompt="[Total: $(cat ${UPV} | wc -l) |New: $(cat ${UPN} | wc -l) ] " < ${UPV} > /dev/null
#else
# if checkupdates -n >/dev/null 2>&1
# then
# checkupdates -n | wofi -d -O alphabetical \
# --prompt="[offline] " > /dev/null
# 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
Screenshots (depicted icons differ from those used in the module - see "NOTE" below):
Animated notifications (10s):
Tooltip: Total count is followed by the timestamp of the last sync, new updates count is followed by the timestamp of their notification - in case you missed it (if there are no updates, the latter reflects the date of the first sync since login):
(The total count can also be shown on the bar - see comment inside 'updbar.sh'. If you would like this to be the default, just leave a comment and I'll be happy to change it - if there won't be any veto within a reasonable period of time, that is...)
Menu feature (using 'fuzzel' by default - this can be changed easily, see 'chckpds.sh'):
NOTE: The update of 'ttf-nerd-fonts-symbols' to v3 messed up the codepoints of the old icons used (and the new codepoints cannot be pasted here on bbs, apparently), hence I replaced them with the more generic "(smiley) face" ones. The "package" ones including their old and new codepoints can be found here (search terms: "package", "hexagon").
Inside the module, their order is:
Placeholders used in the module:
In case some icons are missing/aren't rendered correctly, you may want to install a 'nerd-font'...
The module has no immediate way of telling whether you issued 'pacman -Syu' (out-of-scope*), so you will have to let it know. This can either be achieved by simply right-clicking the icon, or by doing the update like this (I recommend the former - but, oh well - it's your system ):
# pacman -Syu && ~/.local/bin/updbar_rst.sh
*(Personally, I usually do the update while not being logged into a graphical environment, BUT if you must emulate the behavior of similar modules out there, I'll give you an inch: "on-click-middle" is unallocated by default... - please don't ask for a mile )
Additional links:
https://gitlab.archlinux.org/pacman/pacman-contrib
https://codeberg.org/dnkl/fuzzel
Developement/Experimental (a.k.a "know what you're doing" ):
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}")
echo
w3m "${URL}/$(wl-paste)/-/commits/main"
echo
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"
Script that checks for updates of this module (if you're using this, make sure to bump the version number found at the top of 'updatenotif.sh' after you updated in order for this to work - basically do the update according to the changelog...):
#!/bin/bash
#
#
# If you intend to integrate this script in the module,
# name it e.g. 'updatenotif_upd.sh', place it inside
# '~/.local/bin/' and add:
#
# "on-click-middle": "~/.local/bin/updatenotif_upd.sh",
#
# to the 'on-click-*' arrays inside the module.
# The method above requires working desktop notifications
# and 'libnotify'.
# Otherwise just run the script from your terminal.
SCR=~/.local/bin/updatenotif.sh
#SCR=$(find ~ -name "updatenotif.sh")
URL=https://bbs.archlinux.org/viewtopic.php?id=279522
nsd() {
[ -x /usr/bin/notify-send ] &&
notify-send -t 3000 "$@"
}
ping -n -c 1 archlinux.org >/dev/null 2>&1 || exit 2
#[ ! -f "${SCR}" ] && echo "${SCR} not found... " && exit 1
if grep $(curl -s "${URL}" | head -n 6 | grep "MODULE" |
cut -d' ' -f 4) ${SCR} >/dev/null 2>&1
then
echo "Up-to-date"
nsd "MODULE" "Up-to-date" --urgency=low
else
echo "Update available:"
echo "(${URL})"
nsd "MODULE" "Update available"
fi
CHANGELOG: ' ### Desktop notifications have been moved to post #3 - this is now waybar-only. ### ; #updbar.sh: code clean-up; #updbar_rst.sh: skip 'cat'; #updatenotif.sh: skip 'cat', bump version to 'v3.2.1'; style: keep it simple and provide only one template, '.new-updates': blink rather than pulse (higher contrast will draw one's attention - which is the point of a notification)'; #updatenotif.sh: bump version to 'v3.2.2'; #updbar.sh #updbar_rst.sh #updatenotif.sh: small improvements, bump version to 'v3.2.4' ! Please make sure to update all three scripts ! '; #updbar.sh: if we want to add an acoustic notification, we use '#updatenotif.sh' instead; #updatenotif.sh: added commented array for acoustic notifications, bump version to 'v3.2.5'; #chckpds.sh: adjusted wofi example; #style #updbar_rst.sh: small improvements; #updatenotif.sh: small improvements, bump version to 'v3.2.6'; #NEW: Highlight most recent updates, including "mere" version bumps (fuzzy searchable from the menu, as well); 'offline' mode: show both states (up-to-date/updates); bump version to 'v3.3.0'; The latest changes required a little bit of refactoring, so please make sure to update all parts (temp files have their own directory now, please refrain from patching your old scripts), and log out/in for the changes to take effect... - Please report bugs if you find any, since something may have been lost in copy-pasting ; #chckpds.sh: 'pclinf.sh'-ready ;#updatenotif.sh: bump version to 'v3.3.1''
Last edited by dogknowsnx (Today 10:21:39)
Notifications for Arch Linux package updates
Wayland.
"We are eternal, all this pain is an illusion" - Maynard James Keenan
Offline
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
### 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 (2023-09-16 08:39:03)
Notifications for Arch Linux package updates
Wayland.
"We are eternal, all this pain is an illusion" - Maynard James Keenan
Offline
@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
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
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)
Notifications for Arch Linux package updates
Wayland.
"We are eternal, all this pain is an illusion" - Maynard James Keenan
Offline
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
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
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)
Notifications for Arch Linux package updates
Wayland.
"We are eternal, all this pain is an illusion" - Maynard James Keenan
Offline
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
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)
Notifications for Arch Linux package updates
Wayland.
"We are eternal, all this pain is an illusion" - Maynard James Keenan
Offline
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 change2) 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
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,
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)
Notifications for Arch Linux package updates
Wayland.
"We are eternal, all this pain is an illusion" - Maynard James Keenan
Offline
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
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)
Notifications for Arch Linux package updates
Wayland.
"We are eternal, all this pain is an illusion" - Maynard James Keenan
Offline
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
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)
Notifications for Arch Linux package updates
Wayland.
"We are eternal, all this pain is an illusion" - Maynard James Keenan
Offline