summaryrefslogtreecommitdiffstats
path: root/extra/arandr/arandr-0.1.3/arandr
blob: 82c701aea3700567927f0cdd9c758e7591382e42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
"""Run ARandR GUI"""

import sys
import gettext

# monkey patch gettext for local execution

if sys.argv[0].startswith('./'):
    old_find = gettext.find

    def find_wrapper(domain, localedir=None, languages=None, all=False):
        """Catch finds for arandr and redirect them to local files"""
        if domain == 'arandr':
            result = old_find(domain, './build/locale', languages, all)
            if result:
                return result
        return old_find(domain, localedir, languages, all)

    gettext.find = find_wrapper

# defer importing and thus loading locales until monkey patching is done

from screenlayout.gui import main
main()