#!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" PREVIOUS_DIR=$(pwd) cd $DIR # get active window in a variable lol=$(xdotool getactivewindow) # reload the browser xdotool search --onlyvisible --sync --pid $(cat ./.browserpid) --name chromium windowactivate --sync key CTRL+SHIFT+R # reactivate old window xdotool windowactivate $lol cd $PREVIOUS_DIR