foxygit / sxbar Log in
commits tags

/default_sxbarc · 17.46 KB

raw
# sxbar configuration
# Format: key : value
# Colours accept hex (#rrggbb) or X colour names

# Global settings
show_version         : true
version_text         : sxbar ver. 1.1

# Appearance
height              : 20
bottom_bar          : false
# secondary_bar: adds a second, modules-only bar on the edge opposite
# `bottom_bar` (no workspace switcher, no version text). Tag which modules
# go on it further down with `bar : module_name : secondary` -- everything
# else stays on the primary bar. See that section below for details.
secondary_bar       : false
vertical_padding    : 0
horizontal_padding  : 0
text_padding        : 5
border              : false
border_width        : 1
# Note: unlike the per-module `colour` directive and most other keys
# below, these three don't support a trailing "# comment" on the same
# line -- put comments on their own line instead.
background_colour   : #000000
foreground_colour   : #7abccd
border_colour       : #005577
# Xft font name format: "FamilyName:size=N[:style=Bold]"
# For Nerd Font symbols use your Nerd Font family name, e.g.:
#   font : JetBrainsMonoNerdFont:size=10
#   font : Hack Nerd Font:size=10
font                : monospace:size=8

# Workspace icons -- replaces a workspace's displayed label (its
# _NET_DESKTOP_NAMES string, as reported by your WM -- typically plain
# numbers like "1", "2", "3") with different text instead, e.g. a Nerd
# Font glyph. Needs a Nerd Font set via `font` above to render glyphs.
# Purely cosmetic -- the underlying workspace name/number your WM uses
# for switching is unaffected, only what's drawn on the pill changes.
# workspace_icon : name : "icon text"
#
# Example (only meaningful with a Nerd Font -- pick glyphs from your
# font's cheat sheet, e.g. https://www.nerdfonts.com/cheat-sheet):
# workspace_icon : 1 : ""   # globe
# workspace_icon : 2 : ""   # terminal
# workspace_icon : 3 : ""   # code

# Modules -- any name works here, not just the ones listed below. A
# module's command is resolved by name: your own script at
# ~/.config/sxbar/scripts/<name>.sh wins if it exists, else the reference
# copy `make install` places at $(PREFIX)/share/sxbar/scripts/<name>.sh,
# else the module is a silent no-op. There's no separate "custom module"
# directive -- a module you write yourself is exactly as first-class as
# one sxbar ships a script for; both are just a script in scripts/,
# referenced the same way:
#
# module : name : enabled : refresh_interval_seconds
#
# The modules below are the ones sxbar ships a script for out of the box
# (scripts/clock.sh, scripts/date.sh, ...; see "Reference scripts" in the
# wiki for the full list). Each also self-declares its own popup (if it
# has one) straight from its script -- see the `menu` subcommand note
# under "Floating popups" further down.
# clock/date: hover over either to reveal an "Open calendar" shortcut (needs gsimplecal)
module : clock      : true  : 1
module : date       : true  : 60
# battery: hover over it for detailed status + a power-saver toggle (needs upower, power-profiles-daemon)
module : battery    : false : 30
# volume: hover over it to reveal a slider (needs wpctl)
module : volume     : true  : 5
# cpu: hover over it to see more detail (cpu, memory, per-core load) in a popup
module : cpu        : false : 3
# brightness: hover over it to reveal a slider (needs brightnessctl)
module : brightness : false : 5
# bluetooth: hover over it to reveal a floating menu (needs bluetoothctl)
module : bluetooth  : false : 10
# usermenu: hover over it to reveal a floating sleep/log out/shut down menu
module : usermenu   : true  : 300
# network: hover over it to reveal a floating menu showing WiFi/Ethernet + IPs (needs ip)
module : network    : false : 10
# media: hover over it to reveal album art + Previous/Play-Pause/Next (needs playerctl; curl for remote art)
module : media      : false : 2
# taskbar: NOT like other modules -- renders one clickable segment per
# window on the current workspace directly in the bar (see "Taskbar"
# further down), instead of a single line of text. Needs wmctrl, and a
# window manager that acts on _NET_ACTIVE_WINDOW client messages to
# actually focus what you click.
module : taskbar    : false : 1

# Your own modules -- write a script, drop it in ~/.config/sxbar/scripts/
# as <name>.sh (executable), then enable it exactly like any module above:
#
# module : temp : true : 5
#
# ...with ~/.config/sxbar/scripts/temp.sh being e.g.:
#   #!/bin/sh
#   sensors | grep 'Package' | awk '{print $4}'
#
# Two ready-made examples ship in scripts/ to copy from:
#
# module : startmenu : true : 3600   # your favorites as popup buttons --
#                                     # edit the popup_item lines in
#                                     # startmenu.sh itself to customize
# module : demo_menu : true : 999    # one of every popup row type, see
#                                     # "Floating popups" further down

# Prefix / icon — text prepended to a module's output (works for any
# module, by name). Needs a Nerd Font set via `font` above to render icon
# glyphs correctly.
# prefix : module_name : "icon text"
# (icon : ... is accepted as an alias for prefix)
#
# Examples:
# prefix : clock      : " "
# prefix : date       : " "
# prefix : battery    : " "
# prefix : volume     : " "
# prefix : cpu        : " "
# prefix : brightness : " "
# prefix : bluetooth  : " "
# prefix : usermenu   : " "
# prefix : network    : " "

# Prefix command -- like `prefix`, but the icon comes from an external
# script instead of fixed text, so it can change with module state (e.g.
# battery charging vs discharging, volume muted vs not). The script's own
# stdout (trailing newline stripped) becomes the prefix; it is re-run on
# the module's normal refresh_interval, and it must include its own
# trailing space/separator if you want one before the value.
# The module's current output (e.g. "83%") is passed in as $1, since the
# built-in module commands don't expose state like charging/muted beyond
# that string -- scripts that need it re-check the system themselves.
# prefix_cmd : module_name : "command or script path"
# (icon_cmd : ... is accepted as an alias for prefix_cmd)
#
# Examples:
# prefix_cmd : battery : "~/.config/sxbar/scripts/battery_icon.sh"
# prefix_cmd : volume  : "~/.config/sxbar/scripts/volume_icon.sh"
#
# Reference copies of these two scripts ship in this repo's scripts/ dir
# and are installed to $(PREFIX)/share/sxbar/scripts/ -- copy them to
# ~/.config/sxbar/scripts/ (the path above) and edit from there.
#
# Any module's script is also self-contained about its own popup menu:
# running it as `<script> menu` (which sxbar does once at startup, for
# every module -- see "Modules"/"Your own modules" above) prints that
# module's popup/popup_item/popup_info/popup_set lines -- the exact same
# directives as below, just without the module-name field, since a script
# only ever describes itself. This is what usermenu.sh's Sleep/Log out/
# Shut down rows are, for instance -- add, remove or edit rows there to
# customize your user menu, no sxbarc editing needed. sxbarc's own
# popup_item/popup_info/popup_set lines further down still work exactly as
# before, and still replace a module's rows on the first line for that
# module regardless of where those rows came from. See "Floating popups"
# below for the full directive reference.

# Icon only -- hides a module's own text, showing just its prefix/icon.
# Needs a prefix/prefix_cmd set (see above) or there's nothing left to show.
# The module's command/refresh_interval/popup all still run as normal --
# only the bar's rendered text changes.
# icon_only : module_name : true|false
#
# Example (network's bar text becomes just its icon; "Online"/"Offline"
# is still computed underneath, it's just not drawn -- click the icon for
# the WiFi/Ethernet popup as usual):
# prefix     : network : " "
# icon_only  : network : true

# Width -- reserves a minimum pixel width for a module's slot, so the rest
# of the bar doesn't shift when its text width changes (e.g. cpu going
# from one digit to two, or three, wide). The module's own text is never
# truncated; if it's wider than this it just uses its natural width.
# width : module_name : min_pixels
#
# Examples (picking a value wide enough for the largest expected reading,
# e.g. the width of "100%" plus its icon in your font/size):
# width : battery : 48
# width : volume  : 48
# width : cpu     : 48

# Max width -- the opposite of width above: caps a module's slot at this
# many pixels. Text that fits stays put; text wider than the cap scrolls
# left (a marquee/ticker) within that fixed width instead of stretching
# the bar -- handy for anything with unpredictable-length text, like
# media's "Artist - Title". sxbar only redraws faster than its usual
# once-a-second cadence while something is actually scrolling, so this
# doesn't cost anything when nothing's overflowing.
# max_width : module_name : max_pixels
#
# Example:
# max_width : media : 220

# Bar assignment -- which bar a module is drawn on when secondary_bar is
# enabled above. Defaults to primary; only needs setting for modules you
# want to move to the secondary bar. The secondary bar has no workspace
# switcher and never shows version_text, regardless of show_version --
# it only ever draws the modules tagged secondary here.
# bar : module_name : primary|secondary
#
# Example (secondary_bar : true, bottom_bar : false puts battery/volume/cpu
# on their own bar at the bottom, clock/date/workspaces stay on top):
# bar : battery : secondary
# bar : volume  : secondary
# bar : cpu     : secondary

# Taskbar -- one clickable, equal-width segment per window on the current
# workspace, so you can switch focus between them (e.g. while a window
# manager's monocle/fullscreen-stack mode only shows one window at a
# time). Unlike every other module, it doesn't have a single line of bar
# text: it renders directly in the bar itself, filling whatever space is
# left over between the left- and right-aligned modules on whichever bar
# it's assigned to (its own `align` is ignored -- it's a fill module, not
# anchored to one side). The currently-focused window's segment is
# highlighted the same way the active workspace pill is.
#
# Needs:
#   - wmctrl, for both listing windows and requesting focus
#   - a window manager that actually acts on a _NET_ACTIVE_WINDOW client
#     message (that's what wmctrl sends to request focus) -- sxwm as of
#     this writing does not out of the box; see
#     patches/net-active-window-mrjensk.patch in the sxwm repo, or your
#     WM's own docs if you're not on sxwm
#
# Typical setup: its own row on the secondary bar, so it reads like an
# actual taskbar underneath the primary status bar.
# secondary_bar : true
# module        : taskbar : true : 1
# bar           : taskbar : secondary

# Alignment -- which side of the bar a module is anchored to. Defaults to
# right, so existing configs (which never set this) are unaffected. Each
# group (left/center/right) is laid out independently -- left continues on
# from the workspace switcher, center is centered in the bar, right is
# anchored before version_text, same as today's default cluster.
# align : module_name : left|center|right
#
# Example (workspaces+clock on the left, date centered, the rest on the
# right where they already are by default):
# align : clock : left
# align : date  : center

# Per-module text colour (overrides global foreground_colour for that module)
# colour : module_name : #rrggbb
#
# Examples:
# colour : clock      : #50fa7b
# colour : volume     : #ff79c6
# colour : battery    : #ffb86c
# colour : date       : #8be9fd
# colour : cpu        : #bd93f9
# colour : brightness : #f1fa8c
# colour : bluetooth  : #4a9eff
# colour : usermenu   : #ff5555
# colour : network    : #2ee6d6

# Click commands — run a command when a module is left-clicked
# Works for any module, by name
# click : module_name : "command"
#
# Examples:
# click : volume  : "pavucontrol"
# click : clock   : "xclock"
# click : battery : "xterm -e 'upower -i /org/freedesktop/UPower/devices/battery_BAT0; read'"
# click : network : "xterm -e nmtui"     # or use the built-in `network` module's own popup instead
#
# Scroll wheel — scroll up/down over a module to run a command
# scroll_up   : module_name : "command"
# scroll_down : module_name : "command"
#
# Examples:
# scroll_up   : volume : "wpctl set-volume --limit 1.0 @DEFAULT_AUDIO_SINK@ 5%+"
# scroll_down : volume : "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"

# Floating popups -- a module can open a small floating window instead of
# (or as well as) running a plain click_command. A popup is just a list of
# rows, and text/button/slider/image rows can all be freely mixed in the
# same popup (see scripts/demo_menu.sh, further down, for an example
# combining all five). Either trigger works with any row -- every shipped
# module's popup defaults to `hover` for a consistent feel, but `click`
# remains available if you'd rather a menu only appear on a deliberate click:
#   text    -- purely informational, not clickable at all (popup_info)
#   button  -- runs its own command on click; the popup stays open (popup_item)
#   slider  -- a draggable 0-100% track; dragging doesn't close the popup (popup_set)
#   image   -- renders an image file, e.g. album art; not clickable (popup_image)
#   buttons -- one row split into N equal-width button segments side by
#              side, e.g. media transport controls, instead of N stacked
#              full-width button rows (popup_buttons)
#
# popup : module_name : hover|click : buttons|slider
#   hover opens the popup while the pointer is over the module (and closes
#   it when the pointer leaves both the module and the popup); click opens
#   it on left-click and closes it again on a second click, or on clicking
#   anywhere else (like an ordinary dropdown menu). The third field only
#   decides "does this module have a popup at all" these days --
#   popup_item/popup_info/popup_image/popup_buttons/
#   popup_set decide what's in it, in any combination, regardless of which
#   of `buttons`/`slider` you put here, so either word works.
#
# popup_item : module_name : "Label" : "command"   -- one button row.
#   Repeat for more rows. The first popup_item/popup_info/popup_image/
#   popup_buttons line for a module replaces its built-in default rows (if
#   any, including a popup_set slider row); later lines append to it. Add
#   popup_set again afterwards if you cleared a built-in slider this way
#   and still want it back.
#
# popup_info : module_name : "shell command"   -- one plain text row. Its
#   label is this command's output, re-run fresh every time the popup
#   opens (e.g. current IP address). Not clickable at all -- clicking it
#   does nothing and the popup stays open.
#
# popup_image : module_name : "shell command"   -- one image row. The
#   command's stdout is a path to a local image file, re-run fresh every
#   time the popup opens (e.g. current track's album art); scaled to fit a
#   160px box (see popup_image_size below to change that), preserving
#   aspect ratio. Empty/failed output just means no image that time -- the
#   row stays, it renders blank. Not clickable.
#   No extra build dependency -- image decoding is a vendored, compiled-in
#   library (see README). An image (or slider, or buttons) row anchors
#   the popup's width -- any popup_info/popup_item text in the same popup
#   is then capped to that width and scrolls (marquee) if it's longer,
#   instead of stretching the popup past the image.
#
# popup_image_size : module_name : pixels   -- changes the square box a
#   module's popup_image row(s) scale their art into (default: 160).
#   Example: popup_image_size : media : 220
#
# popup_buttons : module_name : "Label1" : "cmd1" : "Label2" : "cmd2" ...
#   one row split into N equal-width button segments, each running its own
#   command on click; the popup stays open -- same behaviour as popup_item
#   but laid out side by side instead of stacked. Needs an even number of
#   quoted label/command pairs; glyphs work well as labels here (see
#   scripts/media.sh's own popup) so you get an icon row instead of
#   stacked text.
#
# popup_set : module_name : "command"   -- adds (or updates) one slider row
#   for this module. Run when the value changes; receives the new value as
#   $1, e.g. "45%" (same convention as prefix_cmd's $1). The slider's
#   starting position comes from the module's own command output, so no
#   separate "get" command is needed. Can coexist with popup_item/popup_info/
#   popup_image/popup_buttons rows on the same module.
#
# Every module listed under "Modules" above already comes with sensible
# popup defaults built into its own script (see the `menu` subcommand note
# above) -- these directives are for overriding them, or adding this
# behaviour to a module of your own. Want click instead of hover for one
# of them? Just override its trigger, e.g. `popup : usermenu : click :
# buttons`. For the full reference of what each shipped module's default
# popup looks like (as the equivalent sxbarc directives, for copy-paste
# starting points), see "Built-in popups" in the wiki -- not duplicated
# here since it's identical to each script's own `menu` output.
#
# scripts/demo_menu.sh (enabled via `module : demo_menu : true : 999`
# above) is a runnable example combining one of every row type: plain text
# (not clickable), an image, a button, a slider, and a row of segmented
# buttons. Its button/slider rows fire a desktop notification via
# scripts/demo_popup.sh so you can test hover/click/drag mechanics safely
# before pointing your own module's popup at anything real -- both ship in
# scripts/ and install to $(PREFIX)/share/sxbar/scripts/.