Class: DesktopIcons

Inherits:
Object
  • Object
show all
Defined in:
macos_desktop_icons.rb

Overview

macos_desktop_icons.rb: Manage state of desktop icons on macOS.

Copyright © 2017 Todd A. Jacobs

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Defined Under Namespace

Classes: EX_OSERR_71

Constant Summary collapse

HIDE =
false
SHOW =
true

Instance Method Summary collapse

Constructor Details

#initializeDesktopIcons

Returns a new instance of DesktopIcons

Raises:


32
33
34
# File 'macos_desktop_icons.rb', line 32

def initialize
  raise EX_OSERR_71 unless macOS?
end

Instance Method Details

#hideObject

Hide desktop icons.


37
38
39
# File 'macos_desktop_icons.rb', line 37

def hide
  desktop_icons HIDE
end

#showObject

Show desktop icons.


42
43
44
# File 'macos_desktop_icons.rb', line 42

def show
  desktop_icons SHOW
end

#toggleObject

Toggle state of desktop icons.


47
48
49
50
51
# File 'macos_desktop_icons.rb', line 47

def toggle
  toggle_icon_display
  restart_finder
  icons_showing?
end