Command Line Usage

Synopsis

python -m mybar [--help] [--template 'TEMPLATE' | --fields FIELDNAME1 [FIELDNAME2 ...]]
                [--separator 'FIELD_SEPARATOR'] [--join-empty]
                [--options FIELD1.OPTION='VAL' [FIELD2.OPTION='VAL' ...]]
                [--refresh REFRESH] [--count TIMES] [--break-lines]
                [--icons FIELDNAME1='ICON1' [FIELDNAME2='ICON2' ...]]
                [--from-icons FIELDNAME1='ICON1' [FIELDNAME2='ICON2' ...]]
                [--unicode] [--no-unicode] [--config FILE] [--dump] [--debug]
                [--version]

Options

-h, --help

show this help message and exit

--template 'TEMPLATE', -t 'TEMPLATE'

A curly-brace-delimited format string. Not valid with --fields options.

--fields FIELDNAME1 [FIELDNAME2 ...], -f FIELDNAME1 [FIELDNAME2 ...]

A list of fields to be displayed. Not valid with --template.

--options FIELD1.OPTION='VAL' [FIELD2.OPTION='VAL' ...], -o FIELD1.OPTION='VAL' [FIELD2.OPTION='VAL' ...]

Set arbitrary options for discrete Fields using dot-attribute syntax.

--refresh REFRESH, -r REFRESH

The bar’s refresh rate in seconds per cycle.

--count TIMES, -n TIMES

Print the bar this many times, then exit.

--break-lines, -b

Use a newline character at the end of every bar line.

--icons FIELDNAME1='ICON1' [FIELDNAME2='ICON2' ...], -i FIELDNAME1='ICON1' [FIELDNAME2='ICON2' ...]

A mapping of field names to icons.

--from-icons FIELDNAME1='ICON1' [FIELDNAME2='ICON2' ...]

A mapping of Field names to icons. Use for the Field order as well.

--unicode, -u

Prefer Unicode versions of Field icons, if provided.

--no-unicode, -U

Prefer ASCII versions of Field icons, if provided.

--config FILE, -c FILE

The config file to use for default settings.

--dump, -d

Instead of running mybar, print a config file using options specified in the command.

--debug

Use debug mode. (Not implemented)

--version, -v

show program’s version number and exit

Options for --fields

These options are not valid when using --template:

--separator 'FIELD_SEPARATOR', -s 'FIELD_SEPARATOR'

The character used for joining fields. Only valid with --fields.

--join-empty, -j

Include empty field contents instead of hiding them. Only valid with --fields.

Examples

Run mybar using your default config file:

$ python -m mybar
mymachine|Up 4d:14h:22m|CPU 05%|34C|Mem 8.6G|/:80.7G|Bat 100CHG|wifi|2023-11-10 16:34:18

--fields/-f Specify which fields to show:

$ python -m mybar -f hostname disk_usage cpu_temp datetime
mymachine|/:88.3G|43C|2023-08-01 23:18:22

--icons/-i Set new icons for each field:

$ python -m mybar -i uptime='⏱️' cpu_temp='🔥' mem_usage='🧠' battery='🔋'
mymachine|⏱️4d:15h:7m|CPU 00%|🔥50C|🧠8.7G|/:80.7G|🔋100CHG|wifi|2023-11-10 17:19:20

--template/-t Use a custom format template:

$ python -m mybar -t '@{hostname}: ({uptime} | {cpu_usage}, {cpu_temp})  [{datetime}]'
@mymachine: (Up 1d:12h:17m | CPU 02%, 44C)  [2023-08-01 23:31:26]

--separator/-s Change the field separator:

$ python -m mybar -f hostname uptime cpu_usage -s ' ][ '
mymachine ][ Up 1d:12h:11m ][ CPU 00%

--count/-n Run the bar a specific number of times:

$ python -m mybar -f hostname cpu_usage datetime -n 3 --break-lines
mymachine|CPU 00%|2023-08-01 23:40:26
mymachine|CPU 00%|2023-08-01 23:40:27
mymachine|CPU 00%|2023-08-01 23:40:28
$

--refresh/-r Set the bar’s refresh rate:

$ python -m mybar -f hostname cpu_usage datetime -n 3 -r 10 --break-lines
mymachine|CPU 00%|2023-11-24 04:25:31
mymachine|CPU 00%|2023-11-24 04:25:41
mymachine|CPU 00%|2023-11-24 04:25:51
$

--options/-o Set arbitrary options for the bar or any field:

$ python -m mybar -t 'Time: {datetime}' -o datetime.kwargs.fmt='%H:%M:%S.%f'
Time: 01:19:55.000229

--config/-c Use a specific config file:

$ python -m mybar -c ~/.config/mybar/my_other_config_file.conf

See also

The Config Files page shows more comprehensive customization options through the use of config files.