diff options
| author | Robert Günzler <r@gnzler.io> | 2020-07-07 18:07:23 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2020-07-07 18:07:23 +0200 |
| commit | 2f2c0ab361fb31edd2fe5c39281c5150411c1d9a (patch) | |
| tree | afdac02d1ed8d874864c31d0039a361be5cf2c28 /bin/swx | |
| parent | 6791776f428307c6aa500287a7e03c1ed1d1de89 (diff) | |
bin/centercon,swx: support placing windows in corners
Diffstat (limited to 'bin/swx')
| -rwxr-xr-x | bin/swx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/swx b/bin/swx index e902751..1536ad0 100755 --- a/bin/swx +++ b/bin/swx @@ -3,7 +3,7 @@ set -e [ -n "$DEBUG" ] && set -x # check requirements -for app in swaymsg jq swq; do +for app in swaymsg jq swq centercon; do if ! command -v "$app" >/dev/null; then printf "%s: %s not install but required" "$0" "$app" >&2 exit 1 @@ -19,7 +19,7 @@ rotate= sticky= floating= autotile= -while getopts b:w:o:g:I:r:stfah name; do +while getopts b:w:o:g:I:r:stfF:ah name; do case "$name" in b) # border border="${OPTARG}" ;; @@ -41,6 +41,8 @@ while getopts b:w:o:g:I:r:stfah name; do sticky=1 ;; f) # set container to float floating=1 ;; + F) + floating="${OPTARG}" ;; a) # auto-tiling enabled autotile=1 ;; h|?) printf "usage: %s [-bwogIrsfo] COMMAND\n" "$(basename "$0")" @@ -52,7 +54,7 @@ while getopts b:w:o:g:I:r:stfah name; do printf " -g GEOMETRY \tresize/position window\n" printf " -r ROTATION \trotate the container, requires cage(1)\n" printf " -s \t\tmake COMMAND a sticky window, appearing on all workspaces\n" - printf " -f \t\tmake COMMAND a floating window\n" + printf " -f [PERC [MODE]]\tmake COMMAND a floating window\n\tsee centercon(1) for possible values\n" printf " -a \t\tauto-tiling; always open COMMAND on the shorter edge\n\t\tof the current container\n" printf "\n" printf "See sway(5) for possible options for BORDER, WORKSPACE, OUTPUT and GEOMETRY.\n" @@ -134,6 +136,7 @@ while [ -z "${sway_props_done}" ]; do fi if [ -n "${floating}" ]; then swaymsg [con_id="${con_id}"] floating enable + [ "${floating}" = "1" ] || centercon ${floating} fi sway_props_done=1 done >/dev/null |