summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2020-12-07 19:57:55 +0100
committerRobert Günzler <r@gnzler.io>2021-01-21 19:39:13 +0100
commit8055bc1554ef171286cf9162253a0b510f344822 (patch)
treecf0f6475372f109e893160c7263250a120dbf0cb /bin
parentb3d9281a36dd656b1c19e3733f60794a3eaea598 (diff)
bin/centercon: fix arithmetic error
and also fix centercon usage in swx
Diffstat (limited to 'bin')
-rwxr-xr-xbin/centercon2
-rwxr-xr-xbin/swx2
2 files changed, 2 insertions, 2 deletions
diff --git a/bin/centercon b/bin/centercon
index dff3cda..90419fd 100755
--- a/bin/centercon
+++ b/bin/centercon
@@ -34,7 +34,7 @@ if [ -n "$1" ] || [ ! "$1" = "-" ]; then
 	con_width=$(awk "BEGIN{print int($con_height * $ratio)}")
 fi
 
-if (( perc >= 1 )); then
+if awk "BEGIN{ if (${perc} >= 1.0) exit 0; else exit 1; }"; then
 	printf "scaling factor %.1f larger than 100%%, aborting...\n" "${perc}"
 	exit 1
 fi
diff --git a/bin/swx b/bin/swx
index 3e894f7..dfe852f 100755
--- a/bin/swx
+++ b/bin/swx
@@ -144,7 +144,7 @@ sway_props_done=
 while [ -z "${sway_props_done}" ]; do
 	if [ -n "${floating}" ]; then
 		swaymsg -- [con_id="${con_id}"] floating enable
-		[ "${floating}" = "1" ] || centercon ${floating}
+		[ "${floating}" = "1" ] || centercon -w ${floating}
 	fi
 	if [ -n "${into_scratchpad}" ]; then
 		swaymsg -- [con_id="${con_id}"] move to scratchpad