Update linux-toggle-app executable

This commit is contained in:
2020-04-07 11:57:22 +01:00
parent 07438d46b1
commit 815c4e0323

View File

@@ -73,7 +73,7 @@ fi
PID=$(pgrep "$APP_NAME" | head -n 1) PID=$(pgrep "$APP_NAME" | head -n 1)
# If the application is not running, we will try to launch it. # If the application is not running, we will try to launch it.
if [ -z $PID ]; then if [ -z "$PID" ]; then
echo "$APP_NAME not running, launching it.." echo "$APP_NAME not running, launching it.."
"$APP_BIN" "$APP_BIN"
else else
@@ -94,12 +94,10 @@ else
# minimized it will be raised as well. # minimized it will be raised as well.
if [ "$MOVE_TO" == "yes" ]; then if [ "$MOVE_TO" == "yes" ]; then
xdotool search --onlyvisible --name "$WIN_NAME" windowactivate xdotool search --onlyvisible --name "$WIN_NAME" windowactivate
# wmctrl -x -a "$WIN_NAME"
else else
# WIN_ID=$(xdotool search --onlyvisible --name "$WIN_NAME") # This allows window name to be a regular expression
# xdotool set_desktop "$WIN_ID" $(xdotool get_desktop) WIN_TITLE="$(xdotool search --onlyvisible --name "$WIN_NAME" getwindowname %@ | head -n 1)"
# xdotool windowactivate "$WIN_ID" wmctrl -R "$WIN_TITLE"
wmctrl -x -R "$WIN_NAME"
fi fi
fi fi
fi fi