Class: Yast::DesktopFinishClient

Inherits:
Installation::FinishClient
  • Object
show all
Defined in:
src/lib/installation/clients/desktop_finish.rb

Instance Method Summary collapse

Constructor Details

#initializeDesktopFinishClient

Returns a new instance of DesktopFinishClient.


41
42
43
44
# File 'src/lib/installation/clients/desktop_finish.rb', line 41

def initialize
  super
  textdomain "installation"
end

Instance Method Details

#modesObject


50
51
52
# File 'src/lib/installation/clients/desktop_finish.rb', line 50

def modes
  [:installation, :autoinst]
end

#titleObject


46
47
48
# File 'src/lib/installation/clients/desktop_finish.rb', line 46

def title
  _("Initializing default window manager...")
end

#writeObject


54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'src/lib/installation/clients/desktop_finish.rb', line 54

def write
  selected_desktop = DefaultDesktop.Desktop
  log.info "Selected desktop: #{selected_desktop}"

  if selected_desktop.nil?
    log.info "no desktop set, skipping."
    return nil
  end

  desktop_map = DefaultDesktop.GetAllDesktopsMap[selected_desktop]
  raise "Selected desktop '#{selected_desktop}' missing in desktops map" unless desktop_map

  log.info "selected desktop #{desktop_map}"

  default_wm = desktop_map["desktop"] || ""
  default_cursor = desktop_map["cursor"] || ""

  SCR.Write(path(".sysconfig.windowmanager.DEFAULT_WM"), default_wm)
  SCR.Write(
    path(".sysconfig.windowmanager.X_MOUSE_CURSOR"),
    default_cursor
  )
  SCR.Write(path(".sysconfig.windowmanager"), nil)

  nil
end