Use -n when "returning" from a function with echo

long-opts
noctuid 9 years ago
parent c23c30ef65
commit 777a7d41bb

@ -484,7 +484,7 @@ current_create() {
wid=$(xdotool getactivewindow) wid=$(xdotool getactivewindow)
echo "$wid" > /tmp/tdrop/current"$num" echo "$wid" > /tmp/tdrop/current"$num"
get_class_name "$wid" > /tmp/tdrop/current"$num"_type get_class_name "$wid" > /tmp/tdrop/current"$num"_type
echo "$wid" echo -n "$wid"
} }
wid_toggle() { wid_toggle() {
@ -564,7 +564,7 @@ get_geometry() {
if [[ -n $(type is_floating 2> /dev/null) ]] && \ if [[ -n $(type is_floating 2> /dev/null) ]] && \
[[ -z $(is_floating "$1") ]]; then [[ -z $(is_floating "$1") ]]; then
# window is not floating; don't bother saving geometry # window is not floating; don't bother saving geometry
echo "false" echo -n "false"
else else
local wininfo x y rel_x rel_y local wininfo x y rel_x rel_y
wininfo=$(xwininfo -id "$1") wininfo=$(xwininfo -id "$1")
@ -586,7 +586,7 @@ get_geometry() {
y=$((y-rel_y)) y=$((y-rel_y))
fi fi
fi fi
echo -e "X=$x\nY=$y" echo -n -e "X=$x\nY=$y"
fi fi
} }
@ -604,7 +604,7 @@ give_geometry() {
X=$((X-x_fix)) X=$((X-x_fix))
Y=$((Y-y_fix)) Y=$((Y-y_fix))
fi fi
echo "$X $Y" echo -n "$X $Y"
} }
set_geometry() { set_geometry() {

Loading…
Cancel
Save