Skip to main content
17 events
when toggle format what by license comment
Jun 8, 2023 at 7:09 comment added hackerb9 @andy: you've inspired me to write my own solution which works on both X and Wayland. It also runs asynchronously which is important because notify-send can hang for a long time. While I was at it, I prefix any output from notify-send with the username so the --action option works. Please see my answer below.
Jun 8, 2023 at 0:51 comment added hackerb9 This does not work on the upcoming Debian 12 (bookworm), unless users log in using Xorg instead of Wayland.
Sep 4, 2022 at 0:39 comment added kavadias This actually worked, with a small modification. On bash v5.0.17 I had to set $NAME as NAME=(${XUSER/\(/ }) and $DISPLAY as DISPLAY=${NAME[1]/\)/} -- added '\' before '(' and before ')'. Thank you!
Aug 30, 2020 at 12:18 history edited fra-san CC BY-SA 4.0
Fixed array expansion - spotted by mx1up in a comment); more robust AWK script - pointed out by Shevchuk in a comment
Aug 9, 2020 at 15:04 comment added mx1up for the for loop to work over multiple users, I had to change it to: for XUSER in ${XUSERS[@]}; do
Aug 9, 2020 at 15:01 comment added mx1up had the same prob as @Shevchuk . I first prefixed LC_ALL=en_US to the who command but the awk fix is cleaner
Feb 11, 2020 at 0:09 comment added iheggie I bodged in some help text: if [ $# -eq 0 ] ; then echo "No summary specified"; notify-send --help | sed -e 's/notify-send/&-all/g' -e 's/create a notification/& to all users/g'; exit 0; fi
S Oct 18, 2018 at 8:44 history suggested serv-inc CC BY-SA 4.0
Ubuntu lacks egrep, has grep in /bin
Oct 18, 2018 at 8:14 comment added serv-inc Works splendidly on Ubuntu after using grep -E and adding /bin to the path (see the edit). Feel free to revert if you object
Oct 18, 2018 at 8:14 review Suggested edits
S Oct 18, 2018 at 8:44
Jun 3, 2017 at 19:11 comment added Shevchuk Instead of awk '{print $1$5}' it is better to use awk '{print $1$NF}', so that it doesn't break on some locales where date is formatted with spaces (e.g. Jun 3 instead of 2017-06-03). Here is also a version to notify specific user instead of all users: gist.github.com/shvchk/ba2f0da49bf2f571d6bf606d96f289d7
May 21, 2017 at 16:49 comment added rsuarez @Sw0ut, egrep is indeed a command. But in the man page of grep(1) says that egrep, fgrep and rgrep are deprecated, and the use of their equivalent forms "grep -E", "grep -F" and "grep -r" is recommended.
Apr 21, 2017 at 9:06 comment added Sw0ut |egrep ?? is egrep a command ?
Sep 1, 2016 at 0:04 history edited Andy CC BY-SA 3.0
added 1 character in body
Aug 31, 2016 at 23:58 review Late answers
Sep 1, 2016 at 0:02
Aug 31, 2016 at 23:36 review First posts
Aug 31, 2016 at 23:40
Aug 31, 2016 at 23:36 history answered Andy CC BY-SA 3.0