<s> from . import base <EOL> from . . import bar , hook <EOL> class CurrentLayout ( base . _TextBox ) : <EOL> """<STR_LIT>""" <EOL> orientations = base . ORIENTATION_HORIZONTAL <EOL> def __init__ ( self , width = bar . CALCULATED , ** config ) : <EOL> base . _TextBox . __init__ ( self , "<STR_LIT>" , width , ** config ) <EOL> def _configure ( self , qtile , bar ) : <EOL> base . _TextBox . _configure ( self , qtile , bar ) <EOL> self . text = self . bar . screen . group . layouts [ <NUM_LIT:0> ] . name <EOL> self . setup_hooks ( ) <EOL> def setup_hooks ( self ) : <EOL> def hook_response ( layout , group ) : <EOL> if group . screen is not None and group . screen == self . bar . screen : <EOL> self . text = layout . name <EOL> self . bar . draw ( ) <EOL> hook . subscribe . layout_change ( hook_response ) <EOL> def button_press ( self , x , y , button ) : <EOL> if button == <NUM_LIT:1> : <EOL> self . qtile . cmd_next_layout ( ) <EOL> elif button == <NUM_LIT:2> : <EOL> self . qtile . cmd_prev_layout ( ) </s>
