Last active
May 24, 2018 14:47
-
-
Save lgaggini/51a35f363b7f1966971e869f3fbb5335 to your computer and use it in GitHub Desktop.
Simple wrapper bash script to create notification feeding naughty by awesome-client
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 | |
# Author: Lorenzo Gaggini | |
# Version: 0.2 | |
# | |
# Create a naughty awesome wm notification by title | |
# and message on secondary (big) screen | |
# init env for cron/at execution | |
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus | |
export DISPLAY=:0 | |
# check input | |
if [ "$#" -ne 2 ]; then | |
echo "usage: naughty-send title message" | |
exit 1 | |
fi | |
# parse input | |
TITLE=$1 | |
MSG=$2 | |
# init naughty | |
/usr/bin/echo "naughty = require(\"naughty\")" | /usr/bin/awesome-client | |
# feed awesome-client | |
/usr/bin/echo "naughty.notify({title = \"$TITLE\", text = \"$MSG\", screen = screens, timeout = 0})" | /usr/bin/awesome-client |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just in case someone is interested, two functions that can be used in conjunction to show and the hide a naughty notification from bash: