summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2015-01-18 22:59:13 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2015-01-18 22:59:13 +0100
commit52b8096cabc7d512f586183266c5167d320b7719 (patch)
tree5c0f6a1af22d44a391dc0228afbdbd563618154f
parent5172ecf855078938b00e9ac7f8dee2c2676f6e53 (diff)
downloadPublic-52b8096cabc7d512f586183266c5167d320b7719.tar.gz
Public-52b8096cabc7d512f586183266c5167d320b7719.tar.zst
Public-52b8096cabc7d512f586183266c5167d320b7719.zip
wrapper_display + LICENSE
-rw-r--r--LICENSE21
-rwxr-xr-xwrapper_display33
2 files changed, 54 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..8f083c3
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
1# The MIT License (MIT)
2#
3# Copyright (c) 2011-2015 Ismaël Bouya http://www.normalesup.org/~bouya/
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to deal
7# in the Software without restriction, including without limitation the rights
8# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9# copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included in
13# all copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21# THE SOFTWARE.
diff --git a/wrapper_display b/wrapper_display
new file mode 100755
index 0000000..6b30447
--- /dev/null
+++ b/wrapper_display
@@ -0,0 +1,33 @@
1#!/usr/bin/env bash
2# The MIT License (MIT)
3#
4# Copyright (c) 2011-2015 Ismaël Bouya http://www.normalesup.org/~bouya/
5#
6# Permission is hereby granted, free of charge, to any person obtaining a copy
7# of this software and associated documentation files (the "Software"), to deal
8# in the Software without restriction, including without limitation the rights
9# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10# copies of the Software, and to permit persons to whom the Software is
11# furnished to do so, subject to the following conditions:
12#
13# The above copyright notice and this permission notice shall be included in
14# all copies or substantial portions of the Software.
15#
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22# THE SOFTWARE.
23
24eval `tmux show-env DISPLAY | grep -v "^-DISPLAY"`
25if `ss -o state established sport = :5901 | grep -q "^tcp"`; then
26 DISPLAY=:1
27fi
28
29if [ $# -lt 1 ]; then
30 echo DISPLAY=$DISPLAY
31else
32 exec "$@"
33fi