Module: OmaGem::DSL::System

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

Overview

System-level operations: updates, reboot/shutdown/lock, default apps, font, snapshots, and diagnostics.

Instance Method Summary collapse

Instance Method Details

#channel(name = nil) ⇒ Object



37
38
39
40
41
42
# File 'lib/omagem/dsl/system.rb', line 37

def channel(name = nil)
  return run('channel', 'current').stdout if name.nil?

  validate_in!(name, %w[stable rc edge dev], 'channel')
  run('channel', 'set', name)
end

#current_font ⇒ Object



65
66
67
# File 'lib/omagem/dsl/system.rb', line 65

def current_font
  run('font', 'current').stdout
end

#debug ⇒ Object



69
70
71
# File 'lib/omagem/dsl/system.rb', line 69

def debug
  run('debug', '--no-sudo', '--print').stdout
end

#default_browser(name) ⇒ Object



50
51
52
53
# File 'lib/omagem/dsl/system.rb', line 50

def default_browser(name)
  validate_in!(name, %w[chromium chrome brave brave-origin edge firefox zen], 'browser')
  run('default', 'browser', name)
end

#default_editor(name) ⇒ Object



55
56
57
58
# File 'lib/omagem/dsl/system.rb', line 55

def default_editor(name)
  validate_in!(name, %w[code cursor zed sublime_text helix vim emacs nvim], 'editor')
  run('default', 'editor', name)
end

#default_terminal(name) ⇒ Object

Set the default terminal used by xdg-terminal-exec.



45
46
47
48
# File 'lib/omagem/dsl/system.rb', line 45

def default_terminal(name)
  validate_in!(name, %w[alacritty foot ghostty kitty], 'terminal')
  run('default', 'terminal', name)
end

#font(name) ⇒ Object

Set the system monospace font.



61
62
63
# File 'lib/omagem/dsl/system.rb', line 61

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

#lock ⇒ Object



29
30
31
# File 'lib/omagem/dsl/system.rb', line 29

def lock
  run('system', 'lock')
end

#logout ⇒ Object



33
34
35
# File 'lib/omagem/dsl/system.rb', line 33

def logout
  run('system', 'logout')
end

#reboot ⇒ Object



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

def reboot
  run('system', 'reboot')
end

#shutdown ⇒ Object



25
26
27
# File 'lib/omagem/dsl/system.rb', line 25

def shutdown
  run('system', 'shutdown')
end

#update(yes: false) ⇒ Object

Perform a full system + Omarchy update. Pass yes: true to skip prompts.



9
10
11
12
13
# File 'lib/omagem/dsl/system.rb', line 9

def update(yes: false)
  args = ['update']
  args << '-y' if yes
  run(*args)
end

#version(channel: false) ⇒ Object



15
16
17
18
19
# File 'lib/omagem/dsl/system.rb', line 15

def version(channel: false)
  args = ['version']
  args << 'channel' if channel
  run(*args).stdout
end