diff --git a/tdrop b/tdrop index 8ea9202..327a914 100755 --- a/tdrop +++ b/tdrop @@ -134,11 +134,11 @@ wm_autoset_for_both() { # need to sleep first time to wait for window to be created map_post_oneshot() { sleep 0.1 && \ - i3-msg "[id=$1] floating enable" && \ + i3-msg "[id=$1] floating enable" > /dev/null && \ xdotool windowmove "$1" "$xoff" "$yoff" windowsize "$1" "$width" "$height" } map_post() { - i3-msg "[id=$1] floating enable" && \ + i3-msg "[id=$1] floating enable" > /dev/null && \ xdotool windowmove "$1" "$xoff" "$yoff" windowsize "$1" "$width" "$height" } fi @@ -214,7 +214,7 @@ map_pre_command() { if [[ -n $map_pre ]]; then eval "$map_pre" # use automatically set function if exists - elif [[ -n $(type map_pre) ]]; then + elif [[ -n $(type map_pre 2> /dev/null) ]]; then # needed when creating oneshot rules for programs where cmd differs from actual class name if [[ $1 == "gnome-terminal" ]]; then map_pre "Gnome-terminal" @@ -227,11 +227,11 @@ map_pre_command() { map_post_command() { if [[ -n $oneshot_post ]] && [[ $1 == oneshot ]]; then eval "$oneshot_post" - elif [[ -n $(type map_post_oneshot) ]] && [[ $1 == oneshot ]]; then + elif [[ -n $(type map_post_oneshot 2> /dev/null) ]] && [[ $1 == oneshot ]]; then map_post_oneshot "$2" elif [[ -n $map_post ]]; then eval "$map_post" - elif [[ -n $(type map_post) ]]; then + elif [[ -n $(type map_post 2> /dev/null) ]]; then map_post "$1" fi } @@ -239,13 +239,13 @@ map_post_command() { unmap_post_command() { if [[ -n $unmap_post ]]; then eval "$unmap_post" - elif [[ -n $(type unmap_post) ]]; then + elif [[ -n $(type unmap_post 2> /dev/null) ]]; then unmap_post fi } maybe_cancel_auto_show() { - if $cancel_auto_show && [[ $1 == "$(< /tmp/tdrop/auto_hidden/wid)" ]]; then + if $cancel_auto_show && [[ $1 == "$(cat /tmp/tdrop/auto_hidden/wid 2> /dev/null)" ]]; then > /tmp/tdrop/auto_hidden/wid fi } @@ -363,7 +363,7 @@ wid_toggle() { get_geometry() { # so that won't float a tiled window later when showing - if [[ -n $(type is_floating) ]] && [[ -z $(is_floating "$1") ]]; then + if [[ -n $(type is_floating 2> /dev/null) ]] && [[ -z $(is_floating "$1") ]]; then # window is not floating; don't bother saving geometry echo "false" else