Conky: Option for $user_names to return unique entries only

Created on 8 Mar 2017  ·  3Comments  ·  Source: brndnmtthws/conky

When a user is logged in to many terminals, the output of $user_names is very noisy. It would be nice to add a ${user_names uniq} option that returns an output similar to:

${execi 60 who | awk '{print $1}' | sort -u | tr '\n' ',' | sed -e 's/,$//' -e 's/,/, /g'}

...which is what I'm currently doing.

enhancement

Most helpful comment

It is better to {execi 60} a script instead of implementing this feature request.

I made you a Python command just in case you need a script. Don't put this inside a shell script. ;-)

python -c "from subprocess import check_output;print(', '.join(set([x.split()[0] for x in check_output('who').decode().splitlines()])))"

Thanks for understanding. @su8, we're down to 3 pages now. \o/

All 3 comments

Note: This may be an issue with tmux windows, as I'm logged into a single tty with many pts from tmux windows.

1 year 5 months passed. Are you still using this command today? Thank you.

It is better to {execi 60} a script instead of implementing this feature request.

I made you a Python command just in case you need a script. Don't put this inside a shell script. ;-)

python -c "from subprocess import check_output;print(', '.join(set([x.split()[0] for x in check_output('who').decode().splitlines()])))"

Thanks for understanding. @su8, we're down to 3 pages now. \o/

Was this page helpful?
0 / 5 - 0 ratings