fjresize.py 868 Bytes
Newer Older
1 2 3 4 5 6 7 8
#!/usr/bin/env python

import sys
import fjdisplay
import subprocess

usage = """usage: fjresize.py firejail-name displaysize
resize firejail xephyr windows.
9 10
fjdisplay.py with no other arguments will list running named firejails with
displays.
11
fjresize.py with only a firejail name will list valid resolutions.
12
names can be shortened as long as it's unambiguous.
13 14 15 16 17 18
note: you may need to move the xephyr window for the resize to take effect
example:
    fjresize.py browser 1280x800
"""

if len(sys.argv) == 2:
19 20 21
    out = subprocess.check_output(
        ['xrandr', '--display',
         fjdisplay.getdisplay(sys.argv[1])])
22
    print(out)
23
elif len(sys.argv) == 3:
24 25 26 27 28
    out = subprocess.check_output([
        'xrandr', '--display',
        fjdisplay.getdisplay(sys.argv[1]), '--output', 'default', '--mode',
        sys.argv[2]
    ])
29 30
    print(out)
else:
31
    print(usage)