You are not logged in.
Hey
I'm trying to execute a function (rather than a program), when I click an icon in dzen2, using ^ca() - but to no avail.
I do rougly this:
!#/bin/sh
test() {
echo "Yay.."
}
echo "^ca(test)^i(/path/to/icon/icon.xbm)click me^ca()"
It tells me test, no such command.. because it's trying to execute a binary called "test", rathern than my function inside the script. Is it even possible to execute script functions, in ^ca()?
Thanks :-)
- m
Last edited by valvet (2010-11-08 14:49:46)
Offline
If you are trying to call the test function, then don't you need the parenthesis and call it with:
^ca(test())
??
Knute
Offline
If you are trying to call the test function, then don't you need the parenthesis and call it with:
^ca(test())
??
I would expect so, but then again no.. if you call $(test) from like: echo "$(test)" it works fine (no parenthesis).. if I put parenthesis in the ^ca() function, it errors. It might not be possible, I'm hoping someone knows :-).
Thanks for replying.
Offline
So what exactly are you trying to have execute when you click the link anyway?
Another option that you would have is to just make a script that gets called when you click the link.
However, if you are trying to use a haskell function to say.... Oh, I don't know, change workspaces by clicking, then that would be a horse of a different color.
Last edited by Knute (2010-08-12 22:56:37)
Knute
Offline
So what exactly are you trying to have execute when you click the link anyway?
Another option that you would have is to just make a script that gets called when you click the link.
However, if you are trying to use a haskell function to say.... Oh, I don't know, change workspaces by clicking, then that would be a horse of a different color.
I'm trying to call a function that checks for mail on my gmail account - because it only updates every 10 minutes, and if I've read my mail it ontinues to say "You've got new mail.." for 10 minutes obviously - when I click the mail icon, it should call the function that checks mail so it'll update as it would normally :-)
- m
Offline
So this is an external script that you are trying to have run it's checkmail function?
If so, then you may need to call that script with the appropriate option to check mail, assuming, of course that it has such an option.
Knute
Offline
So this is an external script that you are trying to have run it's checkmail function?
If so, then you may need to call that script with the appropriate option to check mail, assuming, of course that it has such an option.
Hey
No, it's not an external script.. it's the "test" function my first post, just called something else :-)
- m
Offline
Still working on this one. Anyone care to give their 8 cents? :-)
Offline
valvet: You need to export the function before it can be called with dzen2. Place the test function in your .bashrc or somewhere you find appropiate, source it and try again. The function you're trying run with dzen2 only exists locally in your script.
You could also store the command in a variable instead of a function like so:
#!/bin/bash
mycom="echo 'Arch er fanme KISS'|dzen2 -p 10 -y 600"
echo "^ca(1,$mycom)^i(/path/to/icon/icon.xbm)click me^ca()"|dzen2 -p -y 50
Either this or create script that does what you want and place it in your path and use that instead of a function.
Offline
Oh that's awsome. I was actually wondering about that, if I needed to export something.. after my exporting ~/bin folder, so scratchpad could use it, was fixed. Thanks alot.
Offline