U
    lh0                     @   s,   d dl Z dd Zdd Zdd Zdd	 ZdS )
    Nc                  C   s   zPt jddddgdd} | j }t|dk rNt jddddgdd} | j }W n tk
rf   Y d	S X |  dd
 }d| krdS d	S d S )N	gsettingsgetorg.gnome.desktop.interfacezcolor-schemeT)capture_output   	gtk-themeLight-darkDark)
subprocessrunstdoutdecodelen	Exceptionlowerstrip)outr   theme r   </tmp/pip-unpacked-wheel-lmp10r8o/darkdetect/_linux_detect.pyr   	   s$    


r   c                   C   s
   t  dkS )Nr   r   r   r   r   r   isDark   s    r   c                   C   s
   t  dkS )Nr   r   r   r   r   r   isLight"   s    r   c              	   C   sV   t jdt jdd:}|jD ],}| d| dd kr@dnd qW 5 Q R X d S )	N)r   Zmonitorr   r   T)r   universal_newlinesr
   zgtk-theme: ''r   r   )r   PopenPIPEr   r   ZremoveprefixZremovesuffixr   )callbackpliner   r   r   listener&   s    
r"   )r   r   r   r   r"   r   r   r   r   <module>   s   