configs/desktop/scripts/firefox_to_workspace.sh
2024-02-04 15:59:59 -03:00

32 lines
545 B
Bash
Executable File

#!/bin/bash
# i adapted this script from maze, a dear friend of mine
# maze42d/dotfiles on github
firefox_binary="firefox-bin"
if [[ -z $1 ]]; then
echo "Usage: $0 <profile> <workspace>"
exit 1
fi
firefox_profile=$1
workspace=$2
echo "$firefox_profile to $workspace"
$firefox_binary -p $firefox_profile &> /dev/null &
PID=$!
command="hyprctl dispatch movetoworkspacesilent ${workspace},pid:$PID"
echo $command
until hyprctl clients | grep "pid: $PID" > /dev/null #wait till window opens
do
sleep 0
done
$command
disown
exit 0