示例#1
0
#!/usr/bin/env python

import sys
import fjdisplay
import subprocess

usage = """usage: fjresize.py firejail-name displaysize
resize firejail xephyr windows.
fjdisplay.py with no other arguments will list running named firejails with displays.
fjresize.py with only a firejail name will list valid resolutions.
names can be shortend as long its unambiguous.
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:
    out = subprocess.check_output(
        ['xrandr', '--display',
         fjdisplay.getdisplay(sys.argv[1])])
    print(out)
elif len(sys.argv) == 3:
    out = subprocess.check_output([
        'xrandr', '--display',
        fjdisplay.getdisplay(sys.argv[1]), '--output', 'default', '--mode',
        sys.argv[2]
    ])
    print(out)
else:
    print(usage)
示例#2
0
import subprocess
import fjdisplay

usage = """fjclip.py src dest. src or dest can be named firejails or - for stdin or stdout.
firemon --x11 to see available running x11 firejails. firejail names can be shortened
to least ambiguous. for example 'work-libreoffice' can be shortened to 'work' if no
other firejails name starts with 'work'.
warning: browsers are dangerous. clipboards from browsers are dangerous.  see
https://github.com/dxa4481/Pastejacking 
fjclip.py strips whitespace from both
ends, but does nothing else to protect you.  use a simple gui text editor like
gedit if you want to see what your pasting.""" 

if len(sys.argv) != 3 or sys.argv == '-h' or sys.argv == '--help':
    print(usage)
    exit(1)

if sys.argv[1] == '-':
    clipin_raw = sys.stdin.read()
else:
    display = fjdisplay.getdisplay(sys.argv[1])
    clipin_raw = subprocess.check_output(['xsel','-b','--display',display])

clipin = clipin_raw.strip()

if sys.argv[2] == '-':
    print(clipin)
else:
    display = fjdisplay.getdisplay(sys.argv[2])
    clipout = subprocess.Popen(['xsel','-b','-i','--display',display],stdin=subprocess.PIPE)
    clipout.communicate(clipin)
示例#3
0
usage = """fjclip.py src dest. src or dest can be named firejails or - for stdin or stdout.
firemon --x11 to see available running x11 firejails. firejail names can be shortened
to least ambiguous. for example 'work-libreoffice' can be shortened to 'work' if no
other firejails name starts with 'work'.
warning: browsers are dangerous. clipboards from browsers are dangerous.  see
https://github.com/dxa4481/Pastejacking
fjclip.py strips whitespace from both
ends, but does nothing else to protect you.  use a simple gui text editor like
gedit if you want to see what your pasting."""

if len(sys.argv) != 3 or sys.argv == '-h' or sys.argv == '--help':
    print(usage)
    exit(1)

if sys.argv[1] == '-':
    clipin_raw = sys.stdin.read()
else:
    display = fjdisplay.getdisplay(sys.argv[1])
    clipin_raw = subprocess.check_output(['xsel', '-b', '--display', display])

clipin = clipin_raw.strip()

if sys.argv[2] == '-':
    print(clipin)
else:
    display = fjdisplay.getdisplay(sys.argv[2])
    clipout = subprocess.Popen(['xsel', '-b', '-i', '--display', display],
                               stdin=subprocess.PIPE)
    clipout.communicate(clipin)
示例#4
0
#!/usr/bin/env python

import sys
import fjdisplay
import subprocess

usage = """usage: fjresize.py firejail-name displaysize
resize firejail xephyr windows.
fjdisplay.py with no other arguments will list running named firejails with displays.
fjresize.py with only a firejail name will list valid resolutions.
names can be shortend as long its unambiguous.
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:
    out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1])])
    print(out)
elif len(sys.argv) == 3:
    out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1]),'--output','default','--mode',sys.argv[2]])
    print(out)
else:
    print(usage)