SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2009-05-20 18:34:11

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Bash at your fingertips: nifty notify-send

#!/bin/bash

info=$(eval "$*" 2>/dev/null)
notify-send -t $((1000+300*`echo -n $info | wc -w`)) -u low -i gtk-dialog-info "$*" "$info" || exit 2

Last edited by karthik (2009-05-21 10:13:34)

Offline

Help fund CrunchBang, donate to the project!

#2 2009-05-20 18:54:06

Savonlinna
Member
From: Sweden
Registered: 2009-05-19
Posts: 35

Re: Bash at your fingertips: nifty notify-send

Now this I've got to try as soon as I have time!
And for an improvement, how 'bout rethinking it so it can be added into the obmenu? You'll have to put it there initially, ofc, but then it'll only ever be a menu away smile


"History is the fiction we invent to persuade ourselves that events are knowable and that life has order and direction."

Offline

#3 2009-05-20 18:59:46

iggykoopa
Script Master
Registered: 2008-12-13
Posts: 1,486

Re: Bash at your fingertips: nifty notify-send

I'll give this a try in a few minutes with the new notifications...I'm pretty sure they don't let you specify a timeout though, and I don't know how they handle overflow since I don't think they resize....let you know in a little....Oh btw awesome work

edit: do you mind posting your scripts to the pastebin also? they sound usefull

Last edited by iggykoopa (2009-05-20 19:00:20)


I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.

Offline

#4 2009-05-20 19:00:48

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Re: Bash at your fingertips: nifty notify-send

Offline

#5 2009-05-20 19:02:31

kBang
#! Die Hard
From: Calera, AL, USA
Registered: 2009-01-06
Posts: 774

Re: Bash at your fingertips: nifty notify-send

Very nerdy l33t and ub3r c00l.  I may have some uses for this type O' thang.


I view KDE like I view snow. It looks fun and marvelous, it's fun to play in, but after a while I just want someone to take it all away.

Offline

#6 2009-05-20 19:22:09

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Re: Bash at your fingertips: nifty notify-send

Offline

#7 2009-05-20 19:25:52

iggykoopa
Script Master
Registered: 2008-12-13
Posts: 1,486

Re: Bash at your fingertips: nifty notify-send

after a little bit of testing it still seems to be working pretty well with the new notifications...I'm pretty sure it doesn't honor the time you give it though.


I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.

Offline

#8 2009-05-20 19:42:44

iggykoopa
Script Master
Registered: 2008-12-13
Posts: 1,486

Re: Bash at your fingertips: nifty notify-send

gcalc and define are both working good here, the text from define tends to get cut off after about a paragraph though...but it may be my small screen. Also both of the scripts had a bad character after the #!/usr/bin/python line
bash: /home/eric/bin/gcalc: /usr/bin/python^M: bad interpreter: No such file or directory

but it was easy to fix. For hosting the files you could try dropbox or something like that, I've used it in the past for sharing files. If anyone has ideas for other plugins/scripts I'd be happy to work on them as I need the practice too.

edit: forgot to say how I fixed it for anoyone else...just go to the end of python and delete both newlines until the comments, then just hit enter twice to put them back and save it...must be something the pastebin did to it.

Last edited by iggykoopa (2009-05-20 19:44:39)


I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.

Offline

#9 2009-05-21 17:00:54

Savonlinna
Member
From: Sweden
Registered: 2009-05-19
Posts: 35

Re: Bash at your fingertips: nifty notify-send


"History is the fiction we invent to persuade ourselves that events are knowable and that life has order and direction."

Offline

#10 2009-05-22 19:53:13

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Re: Bash at your fingertips: nifty notify-send

Offline

#11 2009-05-22 19:58:39

iggykoopa
Script Master
Registered: 2008-12-13
Posts: 1,486

Re: Bash at your fingertips: nifty notify-send

from what I have read there currently isn't anyway to change the timeout on the new updates. They did it that way purposely, not sure why though.


I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.

Offline

#12 2009-05-29 02:27:05

avb
Member
Registered: 2008-12-09
Posts: 10

Re: Bash at your fingertips: nifty notify-send

I just wanted to point this out because it makes me feel witty

Run this in a terminal or Alt+F2

send send send send send send send ls

Offline

#13 2009-06-17 15:54:12

michael.h4lios
Member
Registered: 2009-05-24
Posts: 23

Re: Bash at your fingertips: nifty notify-send

send "ls * | grep '\.sh$' "

Last edited by michael.h4lios (2009-06-17 15:54:42)

Offline

#14 2009-10-30 19:59:10

FND
Member
Registered: 2009-01-01
Posts: 16

Re: Bash at your fingertips: nifty notify-send

This is great - I'd been looking for something useful to do with notify-send, and this is exactly it.
Thanks for sharing!

Offline

#15 2010-07-13 01:58:51

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Re: Bash at your fingertips: nifty notify-send

 ls * | send grep '\.sh$'

Offline

#16 2012-03-28 12:52:46

Kino
#! CrunchBanger
Registered: 2010-07-29
Posts: 130

Re: Bash at your fingertips: nifty notify-send

Hi,

I realise this is quite an old thread but I've only just come across notify-send and it looks very useful!

However, I'm having problems running it from a cron job - the send command is not being interpreted.

For example, if I want notification every 10 minutes:

*/10 * * * * /home/scripts/send message

will not work.

I've tried several options and searched extensively but I cannot find a solution.

Any ideas would be most appreciated.

Last edited by Kino (2012-03-29 06:34:44)

Offline

#17 2012-03-28 19:18:12

mahatman2
#! Die Hard
From: Chattanooga TN
Registered: 2009-09-13
Posts: 551

Re: Bash at your fingertips: nifty notify-send

I'm not sure, Kino, but I think that's */10 in the first field there. Other than that I don't know if I could help.


Punch all your friends.

Offline

#18 2012-03-29 06:35:16

Kino
#! CrunchBanger
Registered: 2010-07-29
Posts: 130

Re: Bash at your fingertips: nifty notify-send

Yeah, that was a typo.

Offline

#19 2013-01-24 16:33:51

mlevin
New Member
Registered: 2013-01-24
Posts: 1

Re: Bash at your fingertips: nifty notify-send

mlevin@H016342:~$ define rambunctious
RAMBUNCTIOUS:  No definitions found for RAMBUNCTIOUS

mlevin@H016342:~$ gcalc "24500 INR in USD"
Google Calculator did not understand : 24500 INR in USD
mlevin@H016342:~$ 

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo