Module: OmaGem::DSL::Bar
- Included in:
- Config
- Defined in:
- lib/omagem/dsl/bar.rb
Overview
The status bar: which bar and widget layout is used, plus widget layout.
Constant Summary collapse
- POSITIONS =
%w[top bottom left right].freeze
Instance Method Summary collapse
-
#bar(id) ⇒ Object
Switch to a bar layout by id, or
:defaults/:reset. -
#bar_move(id, placement = []) ⇒ Object
Move a widget; placement e.g.
- #bar_position(pos) ⇒ Object
-
#bar_put(id, placement = []) ⇒ Object
Put a widget somewhere; placement e.g.
-
#bar_set(id, key, value) ⇒ Object
Set a widget key/value; e.g.
- #bar_transparent(value = :toggle) ⇒ Object
Instance Method Details
#bar(id) ⇒ Object
Switch to a bar layout by id, or :defaults/:reset.
10 11 12 |
# File 'lib/omagem/dsl/bar.rb', line 10 def (id) run('bar', 'use', id) end |
#bar_move(id, placement = []) ⇒ Object
Move a widget; placement e.g. ["--section", "center", "--index", "0"].
29 30 31 |
# File 'lib/omagem/dsl/bar.rb', line 29 def (id, placement = []) run('bar', 'move', id, *placement) end |
#bar_position(pos) ⇒ Object
14 15 16 17 |
# File 'lib/omagem/dsl/bar.rb', line 14 def (pos) validate_in!(pos, POSITIONS, 'bar position') run('bar', 'position', pos) end |
#bar_put(id, placement = []) ⇒ Object
Put a widget somewhere; placement e.g. ["--after", "omarchy.clock"].
24 25 26 |
# File 'lib/omagem/dsl/bar.rb', line 24 def (id, placement = []) run('bar', 'put', id, *placement) end |
#bar_set(id, key, value) ⇒ Object
Set a widget key/value; e.g. bar_set("omarchy.clock", "format", "HH:mm").
34 35 36 |
# File 'lib/omagem/dsl/bar.rb', line 34 def (id, key, value) run('bar', 'set', id, key, value) end |
#bar_transparent(value = :toggle) ⇒ Object
19 20 21 |
# File 'lib/omagem/dsl/bar.rb', line 19 def (value = :toggle) run('bar', 'transparent', value.to_s) end |