Skip to content

Instantly share code, notes, and snippets.

@cirrusUK
Last active Jul 6, 2021
Embed
What would you like to do?
Since ruby 3.0.0 teh hackersays gem has failed to work, so i cobbled this together, show hackersay.com quotes in dunst/libnotify desktop notifications.
#!/bin/bash
#export DISPLAY=":0"
export XDG_RUNTIME_DIR=/run/user/$(id -u)
#export XAUTHORITY=/home/cirrus/.Xauthority
icon="~/.icons/ui-icons_blue.png"
BOOT=$( wget hackersays.com -O - 2>/dev/null | sed -e '/<span>/b' -e d | head -n1 |cut -c7- | grep -Po '.*(?=.......$)' && wget hackersays.com -O - 2>/dev/null | sed -e '/<cite>/b' -e d | head -n1 |cut -c7- | grep -Po '.*(?=.......$)'
)
dunstify -i "$icon" -r 100 "Hackersays" "$BOOT"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment