File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/mac_desktop.cpython-310.pyc
Back
o ;j � @ sX d Z ddlZddlmZ dZdd� Zdd� Zd d � Zdd� Z d d� Z dd� Zdd� ZdS )zF macOS implementations of various commands in the "desktop" interface � N)�CommandExecutionErrorZdesktopc C s t jj�� rtS dS )z" Only load on Mac systems )Fz;Cannot load macOS desktop module: This is not a macOS host.)�salt�utils�platformZ is_darwin�__virtualname__� r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/mac_desktop.py�__virtual__ s r c C s( d} t d | ddd�}t|� |�d�S )z� Get the output volume (range 0 to 100) CLI Example: .. code-block:: bash salt '*' desktop.get_output_volume z9osascript -e "get output volume of (get volume settings)"�cmd.run_all�debugF�Zoutput_loglevelZpython_shell�stdout)�__salt__� _check_cmd�get��cmd�callr r r �get_output_volume s r c C s, d| � d�}t d |ddd�}t|� t� S )z� Set the volume of sound. volume The level of volume. Can range from 0 to 100. CLI Example: .. code-block:: bash salt '*' desktop.set_output_volume <volume> z'osascript -e "set volume output volume �"r r Fr )r r r )Zvolumer r r r r �set_output_volume&