diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/fix_private-bin.py | 10 | ||||
-rwxr-xr-x | contrib/fjclip.py | 6 | ||||
-rwxr-xr-x | contrib/fjdisplay.py | 4 | ||||
-rwxr-xr-x | contrib/fjresize.py | 4 | ||||
-rwxr-xr-x | contrib/update_deb.sh | 4 |
5 files changed, 14 insertions, 14 deletions
diff --git a/contrib/fix_private-bin.py b/contrib/fix_private-bin.py index 270c758a2..86fd3d16b 100755 --- a/contrib/fix_private-bin.py +++ b/contrib/fix_private-bin.py | |||
@@ -36,18 +36,18 @@ def fixSymlinkedBins(files, replMap): | |||
36 | Used to add filenames to private-bin directives of files if the ones present are mentioned in replMap | 36 | Used to add filenames to private-bin directives of files if the ones present are mentioned in replMap |
37 | replMap is a dict where key is the marker filename and value is the filename to add | 37 | replMap is a dict where key is the marker filename and value is the filename to add |
38 | """ | 38 | """ |
39 | 39 | ||
40 | rxs=dict() | 40 | rxs=dict() |
41 | for (old,new) in replMap.items(): | 41 | for (old,new) in replMap.items(): |
42 | rxs[old]=re.compile("\\b"+old+"\\b") | 42 | rxs[old]=re.compile("\\b"+old+"\\b") |
43 | rxs[new]=re.compile("\\b"+new+"\\b") | 43 | rxs[new]=re.compile("\\b"+new+"\\b") |
44 | #print(rxs) | 44 | #print(rxs) |
45 | 45 | ||
46 | for filename in files: | 46 | for filename in files: |
47 | lines=None | 47 | lines=None |
48 | with open(filename,"r") as file: | 48 | with open(filename,"r") as file: |
49 | lines=file.readlines() | 49 | lines=file.readlines() |
50 | 50 | ||
51 | shouldUpdate=False | 51 | shouldUpdate=False |
52 | for (i,line) in enumerate(lines): | 52 | for (i,line) in enumerate(lines): |
53 | if privRx.search(line): | 53 | if privRx.search(line): |
@@ -56,7 +56,7 @@ def fixSymlinkedBins(files, replMap): | |||
56 | lines[i]=rxs[old].sub(old+","+new, line) | 56 | lines[i]=rxs[old].sub(old+","+new, line) |
57 | shouldUpdate=True | 57 | shouldUpdate=True |
58 | print(lines[i]) | 58 | print(lines[i]) |
59 | 59 | ||
60 | if shouldUpdate: | 60 | if shouldUpdate: |
61 | with open(filename,"w") as file: | 61 | with open(filename,"w") as file: |
62 | file.writelines(lines) | 62 | file.writelines(lines) |
@@ -132,7 +132,7 @@ def main(): | |||
132 | if len(sys.argv)>2 or (len(sys.argv)==2 and (sys.argv[1] == '-h' or sys.argv[1] == '--help') ): | 132 | if len(sys.argv)>2 or (len(sys.argv)==2 and (sys.argv[1] == '-h' or sys.argv[1] == '--help') ): |
133 | printHelp() | 133 | printHelp() |
134 | exit(1) | 134 | exit(1) |
135 | 135 | ||
136 | profilesPath=None | 136 | profilesPath=None |
137 | if len(sys.argv)==2: | 137 | if len(sys.argv)==2: |
138 | if os.path.isdir(sys.argv[1]): | 138 | if os.path.isdir(sys.argv[1]): |
diff --git a/contrib/fjclip.py b/contrib/fjclip.py index cd12cd289..b45959841 100755 --- a/contrib/fjclip.py +++ b/contrib/fjclip.py | |||
@@ -10,10 +10,10 @@ firemon --x11 to see available running x11 firejails. firejail names can be shor | |||
10 | to least ambiguous. for example 'work-libreoffice' can be shortened to 'work' if no | 10 | to least ambiguous. for example 'work-libreoffice' can be shortened to 'work' if no |
11 | other firejails name starts with 'work'. | 11 | other firejails name starts with 'work'. |
12 | warning: browsers are dangerous. clipboards from browsers are dangerous. see | 12 | warning: browsers are dangerous. clipboards from browsers are dangerous. see |
13 | https://github.com/dxa4481/Pastejacking | 13 | https://github.com/dxa4481/Pastejacking |
14 | fjclip.py strips whitespace from both | 14 | fjclip.py strips whitespace from both |
15 | ends, but does nothing else to protect you. use a simple gui text editor like | 15 | ends, but does nothing else to protect you. use a simple gui text editor like |
16 | gedit if you want to see what your pasting.""" | 16 | gedit if you want to see what your pasting.""" |
17 | 17 | ||
18 | if len(sys.argv) != 3 or sys.argv == '-h' or sys.argv == '--help': | 18 | if len(sys.argv) != 3 or sys.argv == '-h' or sys.argv == '--help': |
19 | print(usage) | 19 | print(usage) |
@@ -32,4 +32,4 @@ if sys.argv[2] == '-': | |||
32 | else: | 32 | else: |
33 | display = fjdisplay.getdisplay(sys.argv[2]) | 33 | display = fjdisplay.getdisplay(sys.argv[2]) |
34 | clipout = subprocess.Popen(['xsel','-b','-i','--display',display],stdin=subprocess.PIPE) | 34 | clipout = subprocess.Popen(['xsel','-b','-i','--display',display],stdin=subprocess.PIPE) |
35 | clipout.communicate(clipin) \ No newline at end of file | 35 | clipout.communicate(clipin) |
diff --git a/contrib/fjdisplay.py b/contrib/fjdisplay.py index 0e0ef01ec..3f409545f 100755 --- a/contrib/fjdisplay.py +++ b/contrib/fjdisplay.py | |||
@@ -16,7 +16,7 @@ def getfirejails(): | |||
16 | namematch = re.search('--name=(\w+\S*)',line) | 16 | namematch = re.search('--name=(\w+\S*)',line) |
17 | if namematch: | 17 | if namematch: |
18 | name = namematch.group(1) | 18 | name = namematch.group(1) |
19 | displaymatch = re.search('DISPLAY (:\d+)',line) | 19 | displaymatch = re.search('DISPLAY (:\d+)',line) |
20 | if displaymatch: | 20 | if displaymatch: |
21 | firejails[name] = displaymatch.group(1) | 21 | firejails[name] = displaymatch.group(1) |
22 | return firejails | 22 | return firejails |
@@ -40,4 +40,4 @@ if __name__ == '__main__': | |||
40 | if len(sys.argv) == 1: | 40 | if len(sys.argv) == 1: |
41 | print(getfirejails()) | 41 | print(getfirejails()) |
42 | if len(sys.argv) == 2: | 42 | if len(sys.argv) == 2: |
43 | print (getdisplay(sys.argv[1])) \ No newline at end of file | 43 | print (getdisplay(sys.argv[1])) |
diff --git a/contrib/fjresize.py b/contrib/fjresize.py index 52b289159..3997cf280 100755 --- a/contrib/fjresize.py +++ b/contrib/fjresize.py | |||
@@ -18,8 +18,8 @@ example: | |||
18 | if len(sys.argv) == 2: | 18 | if len(sys.argv) == 2: |
19 | out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1])]) | 19 | out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1])]) |
20 | print(out) | 20 | print(out) |
21 | elif len(sys.argv) == 3: | 21 | elif len(sys.argv) == 3: |
22 | out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1]),'--output','default','--mode',sys.argv[2]]) | 22 | out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1]),'--output','default','--mode',sys.argv[2]]) |
23 | print(out) | 23 | print(out) |
24 | else: | 24 | else: |
25 | print(usage) \ No newline at end of file | 25 | print(usage) |
diff --git a/contrib/update_deb.sh b/contrib/update_deb.sh index c2adffaf8..9d1567c0e 100755 --- a/contrib/update_deb.sh +++ b/contrib/update_deb.sh | |||
@@ -1,7 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # Purpose: Fetch, compile, and install firejail from GitHub source. For | 2 | # Purpose: Fetch, compile, and install firejail from GitHub source. For |
3 | # Debian-based distros only (Ubuntu, Mint, etc). | 3 | # Debian-based distros only (Ubuntu, Mint, etc). |
4 | set -e | 4 | set -e |
5 | git clone --depth=1 https://www.github.com/netblue30/firejail.git | 5 | git clone --depth=1 https://www.github.com/netblue30/firejail.git |
6 | cd firejail | 6 | cd firejail |
7 | ./configure --prefix=/usr | 7 | ./configure --prefix=/usr |