So I have a hack to get my emacs org-clock to display in polybar (a system panel utility). It involves a script that looks like this:
CLOCKSTRING=`emacsclient --eval "(if (org-clocking-p)(print (org-clock-get-clock-string))(print -1))))"`
if [[ $CLOCKSTRING = "-1" ]]
then
echo "Off-clock!"
else
echo $CLOCKSTRING | cut -d\" -f2
fi
The problem is that print
apparently prints to both the output of the commandline command (where I want it) and to a buffer in emacs (where I don't want it. When I'm working in emacs, I just see a window pop up that says the output of this command all the time, i.e. "-1 -1 -1 -1". How do I get print
to print only to the command line?
emacsclient --eval '(message "hi")'
, does it has the same issue?print
.print
tomessage
seemed to have done the trick.message
either.