diff options
author | Boris Faure <billiob@gmail.com> | 2012-08-10 09:57:33 +0000 |
---|---|---|
committer | Boris Faure <billiob@gmail.com> | 2012-08-10 09:57:33 +0000 |
commit | 4f59520f88dcaa2342bfe0ef5efcfeabeac02c7b (patch) | |
tree | 8b23e6de1e838ba1cca7c2cdeac4d502dae201e6 /x-ui.sh | |
parent | ffac12a5e1a00c838dc28167a85bedb40709a849 (diff) |
e: add xinerama options to x-ui. Patch by Thanatermesis
Also switch to bash.
SVN revision: 75079
Diffstat (limited to 'x-ui.sh')
-rwxr-xr-x | x-ui.sh | 59 |
1 files changed, 57 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | #!/bin/sh | 1 | #!/usr/bin/env bash |
2 | 2 | ||
3 | DPI=${DPI:-142} | 3 | DPI=${DPI:-142} |
4 | SCREEN=${SCREEN:-640x480} | 4 | SCREEN=${SCREEN:-640x480} |
@@ -11,6 +11,52 @@ CALLGRIND=${CALLGRIND} | |||
11 | HOST_CURSOR=${HOST_CURSOR} | 11 | HOST_CURSOR=${HOST_CURSOR} |
12 | TEST_HOME=${TEST_HOME} | 12 | TEST_HOME=${TEST_HOME} |
13 | 13 | ||
14 | xinerama_auto_modes() | ||
15 | { | ||
16 | local x y screen_res screen_res_x screen_res_y div_x div_y single_res single_res_x single_res_y walker_x walker_y | ||
17 | |||
18 | div_x="${1%x*}" | ||
19 | div_y="${1#*x}" | ||
20 | |||
21 | |||
22 | # get your display resolution | ||
23 | screen_res="$( xdpyinfo | grep dimensions | awk '{print $2}' )" | ||
24 | screen_res_x="${screen_res%x*}" | ||
25 | screen_res_y="${screen_res#*x}" | ||
26 | |||
27 | # add some offset for your window-borders | ||
28 | screen_res_x="$(( ${screen_res_x} - 20 ))" | ||
29 | screen_res_y="$(( ${screen_res_y} - 40 ))" | ||
30 | |||
31 | # set size for xephir | ||
32 | SCREEN="${screen_res_x}x${screen_res_y}" | ||
33 | |||
34 | |||
35 | # which size per screen ? | ||
36 | single_res_x="$(( ${screen_res_x} / ${div_x} ))" | ||
37 | single_res_y="$(( ${screen_res_y} / ${div_y} ))" | ||
38 | single_res="${single_res_x}x${single_res_y}" | ||
39 | |||
40 | |||
41 | walker_x=0 | ||
42 | walker_y=0 | ||
43 | |||
44 | |||
45 | for (( y=0 ; $y < ${div_y} ; y++ )) ; do | ||
46 | for (( x=0 ; $x < ${div_x} ; x++ )) ; do | ||
47 | # add a new horizontal xinerama screen | ||
48 | xinerama_auto_args="${xinerama_auto_args} -fake-xinerama-screen ${single_res}+${walker_x}+${walker_y}" | ||
49 | walker_x="$(( ${walker_x} + ${single_res_x} ))" | ||
50 | done | ||
51 | # previous loop finished, set horizontal back to 0 | ||
52 | walker_x=0 | ||
53 | # add a new vertical xinerama screen | ||
54 | walker_y="$(( ${walker_y} + ${single_res_y} ))" | ||
55 | done | ||
56 | |||
57 | #echo "${xinerama_auto_args}" | ||
58 | } | ||
59 | |||
14 | show_help() | 60 | show_help() |
15 | { | 61 | { |
16 | cat <<HELP_EOF | 62 | cat <<HELP_EOF |
@@ -25,6 +71,8 @@ where options are: | |||
25 | -s, --screen=SPEC WIDTHxHEIGHT[xDEPTH] to be used. | 71 | -s, --screen=SPEC WIDTHxHEIGHT[xDEPTH] to be used. |
26 | -x, --fxs=WxH+X+Y Fake xinerama screen resolution | 72 | -x, --fxs=WxH+X+Y Fake xinerama screen resolution |
27 | (can be applied repeatedly) | 73 | (can be applied repeatedly) |
74 | -ax 2x3 Automatic set of fake xineramas, 2 horizontal | ||
75 | screens per 3 of vertical ones | ||
28 | -p, --profile=NAME Enlightenment profile name. | 76 | -p, --profile=NAME Enlightenment profile name. |
29 | -e, --empty-home[=PATH] Run with \$HOME being a new, empty directory at /tmp | 77 | -e, --empty-home[=PATH] Run with \$HOME being a new, empty directory at /tmp |
30 | 78 | ||
@@ -150,6 +198,13 @@ while [ $# -gt 0 ]; do | |||
150 | -callgrind|--callgrind) | 198 | -callgrind|--callgrind) |
151 | CALLGRIND="1" | 199 | CALLGRIND="1" |
152 | ;; | 200 | ;; |
201 | -ax|-auto-xinerama|--auto-xinerama) | ||
202 | if [ -z "$value" ]; then | ||
203 | value=$1 | ||
204 | shift | ||
205 | fi | ||
206 | xinerama_auto_modes $value | ||
207 | ;; | ||
153 | *) | 208 | *) |
154 | echo "Unknown option: $option" 1>&2 | 209 | echo "Unknown option: $option" 1>&2 |
155 | ;; | 210 | ;; |
@@ -221,5 +276,5 @@ enlightenment_start \ | |||
221 | -no-precache \ | 276 | -no-precache \ |
222 | -i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it \ | 277 | -i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it \ |
223 | -profile $PROFILE \ | 278 | -profile $PROFILE \ |
224 | $E_OPTIONS \ | 279 | $E_OPTIONS $xinerama_auto_args \ |
225 | $DEBUGGER | 280 | $DEBUGGER |