Skip to content

Instantly share code, notes, and snippets.

@cirrusUK
Last active July 6, 2021 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirrusUK/c7f47c9a13642201713bf3dca766cd3c to your computer and use it in GitHub Desktop.
Save cirrusUK/c7f47c9a13642201713bf3dca766cd3c to your computer and use it in GitHub Desktop.
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