�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`�#! /usr/bin/python3 # # config.py # Copyright (C) 2008 Canonical Ltd. # Copyright (C) 2008-2014 Dustin Kirkland # # Authors: Nick Barcet # Dustin Kirkland # # 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, version 3 of the License. # # 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 . # If you change any strings, please generate localization information with: # ./debian/rules get-po from __future__ import print_function import sys import os import os.path import time import string import subprocess import gettext import glob def error(msg): print("ERROR: %s" % msg) sys.exit(1) try: import snack from snack import * except Exception: error("Could not import the python snack module") PKG = "byobu" HOME = os.getenv("HOME") USER = os.getenv("USER") BYOBU_CONFIG_DIR = os.getenv("BYOBU_CONFIG_DIR", HOME + "/.byobu") BYOBU_RUN_DIR = os.getenv("BYOBU_RUN_DIR", HOME + "/.cache/byobu") BYOBU_BACKEND = os.getenv("BYOBU_BACKEND", "tmux") BYOBU_SOCKETDIR = os.getenv("SOCKETDIR", "/var/run/screen") BYOBU_PREFIX = os.getenv("BYOBU_PREFIX", "/usr") SHARE = BYOBU_PREFIX + '/share/' + PKG DOC = BYOBU_PREFIX + '/share/doc/' + PKG if not os.path.exists(SHARE): SHARE = BYOBU_CONFIG_DIR + "/" + SHARE if not os.path.exists(DOC): DOC = BYOBU_PREFIX + '/share/doc/packages/' + PKG if not os.path.exists(DOC): DOC = BYOBU_CONFIG_DIR + "/" + DOC DEF_ESC = "A" RELOAD = "If you are using the default set of keybindings, press\n or to activate these changes.\n\nOtherwise, exit this session and start a new one." RELOAD_FLAG = "%s/reload-required" % (BYOBU_RUN_DIR) ESC = '' snack.hotkeys[ESC] = ord(ESC) snack.hotkeys[ord(ESC)] = ESC gettext.bindtextdomain(PKG, SHARE + '/po') gettext.textdomain(PKG) _ = gettext.gettext def ioctl_GWINSZ(fd): # Discover terminal width try: import fcntl import termios import struct import os cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234')) except Exception: return None return cr def reload_required(): try: if not os.path.exists(BYOBU_CONFIG_DIR): # 493 (decimal) is 0755 (octal) # Use decimal for portability across all python versions os.makedirs(BYOBU_CONFIG_DIR, 493) f = open(RELOAD_FLAG, 'w') f.close() if BYOBU_BACKEND == "screen": subprocess.call([BYOBU_BACKEND, "-X", "at", "0", "source", "%s/profile" % BYOBU_CONFIG_DIR]) except Exception: True def terminal_size(): # decide on some terminal size cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2) # try open fds if not cr: # ...then ctty try: fd = os.open(os.ctermid(), os.O_RDONLY) cr = ioctl_GWINSZ(fd) os.close(fd) except Exception: pass if not cr: # env vars or finally defaults try: cr = (env['LINES'], env['COLUMNS']) except Exception: cr = (25, 80) # reverse rows, cols return int(cr[1] - 5), int(cr[0] - 5) def menu(snackScreen, size, isInstalled): if isInstalled: installtext = _("Byobu currently launches at login (toggle off)") else: installtext = _("Byobu currently does not launch at login (toggle on)") li = Listbox(height=6, width=60, returnExit=1) li.append(_("Help -- Quick Start Guide"), 1) li.append(_("Toggle status notifications"), 2) li.append(_("Change escape sequence"), 3) li.append(installtext, 4) bb = ButtonBar(snackScreen, (("Exit", "exit", ESC),), compact=1) g = GridForm(snackScreen, _(" Byobu Configuration Menu"), 1, 2) g.add(li, 0, 0, padding=(4, 2, 4, 2)) g.add(bb, 0, 1, padding=(1, 1, 0, 0)) if bb.buttonPressed(g.runOnce()) == "exit": return 0 else: return li.current() def messagebox(snackScreen, width, height, title, text, scroll=0, buttons=((_("Okay"), "okay"), (_("Cancel"), "cancel", ESC))): t = Textbox(width, height, text, scroll=scroll) bb = ButtonBar(snackScreen, buttons, compact=1) g = GridForm(snackScreen, title, 1, 2) g.add(t, 0, 0, padding=(0, 0, 0, 0)) g.add(bb, 0, 1, padding=(1, 1, 0, 0)) return bb.buttonPressed(g.runOnce()) def help(snackScreen, size): f = open(DOC + '/help.' + BYOBU_BACKEND + '.txt') text = f.read() f.close() text = text.replace("", getesckey(), 1) t = Textbox(67, 16, text, scroll=1, wrap=1) bb = ButtonBar(snackScreen, ((_("Menu"), "menu", ESC),), compact=1) g = GridForm(snackScreen, _("Byobu Help"), 2, 4) g.add(t, 1, 0) g.add(bb, 1, 1, padding=(1, 1, 0, 0)) button = bb.buttonPressed(g.runOnce()) return 100 def readstatus(): status = {} glo = {} loc = {} for f in [SHARE + '/status/status', BYOBU_CONFIG_DIR + '/status']: if os.path.exists(f): try: exec(open(f).read(), glo, loc) except Exception: error("Invalid configuration [%s]" % f) if BYOBU_BACKEND == "tmux": items = "%s %s" % (loc["tmux_left"], loc["tmux_right"]) else: items = "%s %s %s %s" % (loc["screen_upper_left"], loc["screen_upper_right"], loc["screen_lower_left"], loc["screen_lower_right"]) for i in items.split(): if i.startswith("#"): i = i.replace("#", "") status[i] = "0" else: status[i] = "1" li = [] keys = list(status.keys()) for i in sorted(keys): window = [int(status[i]), i] li.append(window) return li def genstatusstring(s, status): new = "" glo = {} loc = {} exec(open(SHARE + '/status/status').read(), glo, loc) for i in loc[s].split(): if i.startswith("#"): i = i.replace("#", "") if status[i] == 1: new += " " + i else: new += " #" + i return new def writestatus(items): status = {} path = BYOBU_CONFIG_DIR + '/status' for i in items: status[i[1]] = i[0] for key in ["tmux_left", "tmux_right", "screen_upper_left", "screen_upper_right", "screen_lower_left", "screen_lower_right"]: if key.startswith(BYOBU_BACKEND): try: f = open(path, "r") except Exception: f = open(SHARE + '/status/status', "r") lines = f.readlines() f.close() try: f = open(path, "w") except Exception: f = open(path, "a+") for l in lines: if l.startswith("%s=" % key): val = genstatusstring(key, status) f.write("%s=\"%s\"\n" % (key, val)) else: f.write(l) f.close def togglestatus(snackScreen, size): itemlist = readstatus() rl = Label("") r = CheckboxTree(12, scroll=1) count = 0 for item in itemlist: if item[0] != -1: r.append(item[1], count, selected=item[0]) count = count + 1 bb = ButtonBar(snackScreen, ((_("Apply"), "apply"), (_("Cancel"), "cancel", ESC)), compact=1) g = GridForm(snackScreen, _("Toggle status notifications"), 2, 4) g.add(rl, 0, 0, anchorLeft=1, anchorTop=1, padding=(4, 0, 0, 1)) g.add(r, 1, 0) g.add(bb, 1, 1, padding=(4, 1, 0, 0)) if bb.buttonPressed(g.runOnce()) != "cancel": count = 0 for item in itemlist: if item[0] != -1: item[0] = r.getEntryValue(count)[1] count = count + 1 writestatus(itemlist) reload_required() return 100 def install(snackScreen, size, isInstalled): out = "" if isInstalled: if subprocess.call(["byobu-launcher-uninstall"]) == 0: out = _("Byobu will not be launched next time you login.") button = messagebox(snackScreen, 60, 2, _("Message"), out, buttons=((_("Menu"), ))) return 101 else: if subprocess.call(["byobu-launcher-install"]) == 0: out = _("Byobu will be launched automatically next time you login.") button = messagebox(snackScreen, 60, 2, "Message", out, buttons=((_("Menu"), ))) return 100 def appendtofile(p, s): f = open(p, 'a') try: f.write(s) except IOError: f.close() return f.close() return def getesckey(): line = "" if BYOBU_BACKEND == "tmux": path = BYOBU_CONFIG_DIR + '/keybindings.tmux' if os.path.exists(path): for l in open(path): if l.startswith("set -g prefix "): line = l else: return DEF_ESC else: path = BYOBU_CONFIG_DIR + '/keybindings' if os.path.exists(path): for l in open(path): if l.startswith("escape "): line = l else: return DEF_ESC if line == "": return DEF_ESC esc = line[line.find('^') + 1] if esc == "`": esc = " " return esc def setesckey(key): if key.isalpha(): # throw away outputs in order that the view isn't broken nullf = open(os.devnull, "w") subprocess.call(["byobu-ctrl-a", "screen", key], stdout=nullf) nullf.close() def chgesc(snackScreen, size): esc = Entry(2, text=getesckey(), returnExit=1) escl = Label(_("Escape key: ctrl-")) bb = ButtonBar(snackScreen, ((_("Apply"), "apply"), (_("Cancel"), "cancel", ESC)), compact=1) g = GridForm(snackScreen, _("Change escape sequence"), 2, 4) g.add(escl, 0, 0, anchorLeft=1, padding=(1, 0, 0, 1)) g.add(esc, 1, 0, anchorLeft=1) g.add(bb, 1, 1) g.setTimer(100) loop = 1 while loop: which = g.run() if which == "TIMER": val = esc.value() if len(val) > 1: esc.set(val[1]) # Ensure that escape sequence is not \ or / if val == '/' or val == '\\': esc.set(DEF_ESC) # Ensure that the escape sequence is not set to a number try: dummy = int(esc.value()) esc.set(DEF_ESC) except Exception: # do nothing dummy = "foo" else: loop = 0 snackScreen.popWindow() button = bb.buttonPressed(which) if button != "cancel": setesckey(esc.value()) reload_required() if button == "exit": return 0 return 100 def autolaunch(): if os.path.exists(BYOBU_CONFIG_DIR + "/disable-autolaunch"): return 0 try: for line in open("%s/.profile" % HOME): if "byobu-launch" in line: return 1 except Exception: return 0 if os.path.exists("/etc/profile.d/Z97-%s.sh" % PKG): return 1 return 0 def main(): """This is the main loop of our utility""" size = terminal_size() snackScreen = SnackScreen() snackScreen.drawRootText(1, 0, _('Byobu Configuration Menu')) snackScreen.pushHelpLine(_(' between elements | selects | exits')) isInstalled = autolaunch() tag = 100 while tag > 0: tag = menu(snackScreen, size, isInstalled) if tag == 1: tag = help(snackScreen, size) elif tag == 2: tag = togglestatus(snackScreen, size) elif tag == 3: tag = chgesc(snackScreen, size) elif tag == 4: tag = install(snackScreen, size, isInstalled) isInstalled = autolaunch() snackScreen.finish() sys.exit(0) if __name__ == "__main__": main()