Last active
July 6, 2021 16:50
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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