You are not logged in.
For the last few weeks I've happily been using the conkyEmail python script found here, and it works quite well and does what I want it to do. However, I'm wondering if I could stop this script from checking my mail if, for instance, I have Firefox open, since I have the Gmail Manager extension installed which also checks my mail. Therefore, I find it unnecessary for conky to check for new mail if the extension is going to do it for me. I want to keep the extension for a few other features, but I want to keep the conky script, too, since I'm actually away from the computer much of the time, and I don't always sit down to browse the web.
I don't know python and I don't really know anything about programming/scripting at all. But it shouldn't be too hard to get what I want, should it? The script can check to see if Firefox is running, and if it is it will exit before it checks my mail. Or at least that's what I think should be done.
In my very limited (self-taught) experience writing bash scripts I've never been able to figure out an elegant way to do this, either.
For example...
#!/bin/bash
if [ `ps aux | grep 'quodlibet' | awk '{print $12}' > /tmp/.quod && cat /tmp/.quod | grep /usr/bin/quodlibet` = '/usr/bin/quodlibet' ]; then
quodlibet --play-pause &&
rm /tmp/.quod &
else
audacious --play-pause &
fi
Yikes. What's the best way to test for whether or not a program is running?
Offline
if [ $(pidof firefox) ]
then
# do stuff
fi
Of course make sure firefox is the actual binary, I'm not sure if it is.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
Of course it's that easy...
I tried my way and it worked, too (substituting quodlibet for firefox, of course), but it's ugly and inefficient and stupid. Thanks.
Offline
No problem.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline