Module: OmaGem::DSL::Theme

Included in:
Config
Defined in:
lib/omagem/dsl/theme.rb

Overview

Theme management: apply, list, install, remove, refresh, backgrounds.

Instance Method Summary collapse

Instance Method Details

#background(path) ⇒ Object Also known as: set_background

Set the desktop background to the given image path.



43
44
45
# File 'lib/omagem/dsl/theme.rb', line 43

def background(path)
  run('theme', 'bg', 'set', path)
end

#background_next ⇒ Object

Cycle to the next background for the current theme.



49
50
51
# File 'lib/omagem/dsl/theme.rb', line 49

def background_next
  run('theme', 'bg', 'next')
end

#background_switcher ⇒ Object

Open the background switcher.



54
55
56
# File 'lib/omagem/dsl/theme.rb', line 54

def background_switcher
  run('theme', 'bg-switcher')
end

#install_theme(url) ⇒ Object

Install a theme from a git repository URL.



21
22
23
# File 'lib/omagem/dsl/theme.rb', line 21

def install_theme(url)
  run('theme', 'install', url)
end

#refresh_theme ⇒ Object

Re-apply the current theme from its templates.



31
32
33
# File 'lib/omagem/dsl/theme.rb', line 31

def refresh_theme
  run('theme', 'refresh')
end

#remove_theme(name) ⇒ Object

Remove a user-installed theme by name.



26
27
28
# File 'lib/omagem/dsl/theme.rb', line 26

def remove_theme(name)
  run('theme', 'remove', name)
end

#theme(name) ⇒ Object Also known as: apply_theme

Apply a theme by name. "Tokyo Night" and "tokyo-night" both work.



10
11
12
# File 'lib/omagem/dsl/theme.rb', line 10

def theme(name)
  run('theme', 'set', name)
end

#themes ⇒ Object

List themes Omarchy knows about.



16
17
18
# File 'lib/omagem/dsl/theme.rb', line 16

def themes
  run('theme', 'list').stdout.lines.map(&:strip).reject(&:empty?)
end

#update_themes ⇒ Object

Update user-installed git themes.



36
37
38
# File 'lib/omagem/dsl/theme.rb', line 36

def update_themes
  run('theme', 'update')
end