You are not logged in.
cow-notify, fork from dwmstatus
Notification daemon that runs on background and executes configured command (If there isn't any executes xsetroot -name)
parses following tags:
[summary] - Replace with summary
[body] - Replace with body
[expire] - Replace with expiritation time (milliseconds)
By default there is no config file, if you want to execute custom command, then create this file :
$XDG_CONFIG_HOME/cow-notify/config and type command eg. "xcowsay --image myimage.png '[summary]' '[body]'"
I suggest making the config file read only for everyone expect you, so other users can't go and change it to something more dangerous.
!IMPORTANT! Execution
if(!(sh = getenv("SHELL"))) sh = "/bin/sh";
execlp(sh, sh, "-c", parsed, (char*)NULL);
Since it exectues shell, all shell rules also apply.
So make sure your [body] and [summary] are enclosed with single quotes, otherwise notify events can execute commands.
cow-notify escapes all single quote characters inside [body] and [summary], so you don't have to worry about those. However if you have shell that does not use single quotes for strong quoting then you might want to edit the source.
Issues :
* Fails to reply on some python programs (?)
https://github.com/Cloudef/cow-notify # Github
https://aur.archlinux.org/packages.php?ID=52751 # AUR, thanks synorgy
Last edited by Cloudef (2011-11-29 19:00:31)
Offline
nice
Archlinux x86_64 | post-engineering | last.fm
Offline
Added some string formatting, nothing big.
Using it nowadays with my macopix fork, which has some animation control (mascot dances when I'm listening music from deadbeef)
Might drop the xcowsay default and use some system generic stuff instead.
Example notify file using macopix
macopix --message '<[summary]> [body]' --message-expire [expire]
E: Make sure to use single quotes, to prevent code execution
Last edited by Cloudef (2011-07-30 10:52:29)
Offline
Added some string formatting, nothing big.
Using it nowadays with my macopix fork, which has some animation control (mascot dances when I'm listening music from deadbeef)
Might drop the xcowsay default and use some system generic stuff instead.Example notify file using macopix
macopix --message "<[summary]> [body]" --message-expire [expire]
That's really cute. ^______^
How do I proceed to enable the mascot?
OT: I like your avatar.
Offline
That's really cute. ^______^
How do I proceed to enable the mascot?
OT: I like your avatar.
You can either grab the original macopix
Or fork I've made here with few bugs fixed and animation signaling added.
Then setup your macopix run at startup with --sockmsg option, and set cow-notify send messages to it like in my example.
cow-notify might fail on system startup sometimes for some reason, and this can be fixed with delay (sleep 50 && cow-notify) &
You can grab the dancing miku mascot from here
Also I suggest setting slight startup delay for macopix too if you autostart it. (sleep 20 && macopix) & is fine.
Some references which might help you further:
My openbox autostart.sh # See the cow-notify and macopix lines.
https://github.com/Cloudef/dotFiles/blo … tostart.sh
Cow-notify config:
https://github.com/Cloudef/dotFiles/blo … ify/config
Deadbeef conky script that also makes the miku dance :
https://github.com/Cloudef/dotFiles/blo … b-cover.sh
Offline
...
Thank you.
Offline
With this config
sudo -u $( who | egrep ' (tty|pts)' | egrep ' \(:(pts/)?0' | head -n 1 | cut -d ' ' -f 1 ) notify-send -t [expire] '[summary]' '[body]'
cow-notify could act as some kind of notify proxy. Great for deamons, cron jobs or stuff. The script just tries to find the "human" user, sudo's to this user and send the notification again.
Ceterum autem censeo Systemdinem esse delendam
Offline
With this config
sudo -u $( who | egrep ' (tty|pts)' | egrep ' \(:(pts/)?0' | head -n 1 | cut -d ' ' -f 1 ) notify-send -t [expire] '[summary]' '[body]'
cow-notify could act as some kind of notify proxy. Great for deamons, cron jobs or stuff. The script just tries to find the "human" user, sudo's to this user and send the notification again.
Heh, that's clever. Never thought about throwing whole scripts to the config file.
Offline
Updated it to strip some stuff such as ` and $ letters since you could remote execute these and cause bad stuff happen.
There might be more ways since the code just uses system(); call which can be quite dangerous.
E: bleh, I just read about single quotes.. They make this useless. I'll add warning about this on readme however
Last edited by Cloudef (2011-07-30 10:53:12)
Offline
Cloudef - As discussed a few days ago, I created and uploaded a PKGBUILD for cow-notify. Sorry it took so long. Real life intrudes on the fun stuff yet again. If you'll give it a read over (and maybe try installing...since I've only tested it on this machine). Let me know if you want any changes made. You can find it here: https://aur.archlinux.org/packages.php?ID=52751
"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)
Offline
Cloudef - As discussed a few days ago, I created and uploaded a PKGBUILD for cow-notify. Sorry it took so long. Real life intrudes on the fun stuff yet again. If you'll give it a read over (and maybe try installing...since I've only tested it on this machine). Let me know if you want any changes made. You can find it here: https://aur.archlinux.org/packages.php?ID=52751
Hey,
I just checked the PKGBUILD and tested it, works great. Also the post message is nice.
Thank you.
Last edited by Cloudef (2011-09-28 15:17:41)
Offline