Skip to content
Jake Stanger edited this page Aug 15, 2022 · 5 revisions

The below config shows a module of each type being used.

The Corn format makes heavy use of variables to show how module configs can be easily referenced to improve readability and reduce config length when using multiple bars.

JSON
{
  "left": [
    {
      "all_monitors": false,
      "name_map": {
        "1": "",
        "2": "",
        "3": "",
        "Code": "",
        "Games": ""
      },
      "type": "workspaces"
    },
    {
      "favorites": [
        "firefox",
        "discord",
        "Steam"
      ],
      "icon_theme": "Paper",
      "show_icons": true,
      "show_names": false,
      "type": "launcher"
    }
  ],
  "right": [
    {
      "music_dir": "/home/jake/Music",
      "type": "mpd"
    },
    {
      "host": "chloe:6600",
      "type": "mpd"
    },
    {
      "path": "/home/jake/bin/phone-battery",
      "type": "script"
    },
    {
      "format": [
        "{cpu-percent}% ",
        "{memory-percent}% "
      ],
      "type": "sys-info"
    },
    {
      "type": "clock"
    }
  ]
}
TOML
[[left]]
all_monitors = false
type = 'workspaces'

[left.name_map]
1 = ''
2 = ''
3 = ''
Code = ''
Games = ''

[[left]]
icon_theme = 'Paper'
show_icons = true
show_names = false
type = 'launcher'
favorites = [
    'firefox',
    'discord',
    'Steam',
]

[[right]]
music_dir = '/home/jake/Music'
type = 'mpd'

[[right]]
host = 'chloe:6600'
type = 'mpd'

[[right]]
path = '/home/jake/bin/phone-battery'
type = 'script'

[[right]]
type = 'sys-info'
format = [
    '{cpu-percent}% ',
    '{memory-percent}% ',
]

[[right]]
type = 'clock'
YAML
---
left:
  - all_monitors: false
    name_map:
      "1": 
      "2": 
      "3": 
      Code: 
      Games: 
    type: workspaces
  - favorites:
      - firefox
      - discord
      - Steam
    icon_theme: Paper
    show_icons: true
    show_names: false
    type: launcher
right:
  - music_dir: /home/jake/Music
    type: mpd
  - host: "chloe:6600"
    type: mpd
  - path: /home/jake/bin/phone-battery
    type: script
  - format:
      - "{cpu-percent}% "
      - "{memory-percent}% "
    type: sys-info
  - type: clock
Corn
let {
    $workspaces = {
        type = "workspaces"
        all_monitors = false
        name_map = {
            1 = "ﭮ"
            2 = ""
            3 = ""
            Games = ""
            Code = ""
        }
    }

    $launcher = {
        type = "launcher"
        favorites = ["firefox" "discord" "Steam"]
        show_names = false
        show_icons = true
        icon_theme = "Paper"
    }

    $mpd_local = { type = "mpd" music_dir = "/home/jake/Music" }
    $mpd_server = { type = "mpd" host = "chloe:6600" }

    $sys_info = {
        type = "sys-info"
        format = ["{cpu-percent}% " "{memory-percent}% "]
    }

    $tray = { type = "tray" }
    $clock = { type = "clock" }

    $phone_battery = {
        type = "script"
        path = "/home/jake/bin/phone-battery"
    }

    $left = [ $workspaces $launcher ]
    $right = [ $mpd_local $mpd_server $phone_battery $sys_info $clock ]
}
in {
    left = $left 
    right = $right
}
Clone this wiki locally