You are not logged in.

#1 2015-07-04 05:08:49

BlueYoshi
Member
Registered: 2015-03-14
Posts: 62

[SOLVED] xmobar execute commands/scripts and output to bar

I've been trying to switch from xmobar since the conky update, and I'm trying to get some of the things I had in conky to work in xmobar.

I've been consulting the xmobar page on haskell.org, but for this particular issue, not having any luck.
http://projects.haskell.org/xmobar/#exe … l-commands

First thing I tried to do was use the pacman "checkupdates" command to output the # available on a recurring basis of 3600 seconds.

Run Com "checkupdates" ["| wc -l"] "checkupdates" 3600

I was hoping the above would work, but it either outputs 'conky' or 'pacman v4.x.x' in xmobar. I'm not too sure why.

This is what I had in conky:

${execpi 3600 checkupdates | wc -l} update(s) available

What am I doing wrong?

Last edited by BlueYoshi (2015-07-05 23:20:39)

Offline

#2 2015-07-04 10:53:39

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] xmobar execute commands/scripts and output to bar

You're passing "| wc -l" as an argument to checkupdates:

$ checkupdates "|wc -l"
checkupdates (pacman) v4.2.1

Safely print a list of pending updates

Usage: checkupdates

Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.

What you want is to run a shell with a pipeline combining checkupdates and wc, something like (untested)

Run Com "sh" ["-c", "checkupdates | wc -l"] "checkupdates" 3600

Offline

Board footer

Powered by FluxBB