Note that you can already do that, if you are familiar with scripting, using new window action (gsettings option) of shuffler. Make new window action run a script to open one or more windows, have it wait for the window (-class) to appear, position them conditionally using tile-active (which also takes the window id as argument).
Ican imagine it sounds a bit complicated though. It is part of new shuffler features under the name window rules. -to be continued-.
Couldn’t use gsetting as you suggested because of lack of IQ, but as I couldn’t waste too much time on it I created a solution using xdotool to get window ID and then /usr/lib/budgie-window-shuffler/tile_active to position it.
#!/bin/bash -e
pid=$1
position=$2
position_list="maximize, right, left, top-right, top-left, bottom-right, bottom-left"
set_position() {
if [ "${position}" == 'top-right' ]; then
/usr/lib/budgie-window-shuffler/tile_active 1 0 2 2 "id=$1"
elif [ "${position}" == 'top-left' ]; then
/usr/lib/budgie-window-shuffler/tile_active 0 0 2 2 "id=$1"
elif [ "${position}" == 'bottom-right' ]; then
/usr/lib/budgie-window-shuffler/tile_active 1 1 2 2 "id=$1"
elif [ "${position}" == 'bottom-left' ]; then
/usr/lib/budgie-window-shuffler/tile_active 0 1 2 2 "id=$1"
elif [ "${position}" == 'right' ]; then
/usr/lib/budgie-window-shuffler/tile_active 1 0 2 1 "id=$1"
elif [ "${position}" == 'left' ]; then
/usr/lib/budgie-window-shuffler/tile_active 0 0 2 1 "id=$1"
elif [ "${position}" == 'maximize' ]; then
/usr/lib/budgie-window-shuffler/tile_active maximize "id=$1"
else
echo "${position} is invalid. Valid values are ${position_list}"
exit 1
fi
}
if [ -z "${pid}" ] || [ -z "${position}" ]
then
echo "Usage: $0 pid position"
echo "Valid positions: ${position_list}"
exit 1
fi
window_ids=()
while IFS='' read -r line; do window_ids+=("$line"); done < <(xdotool search --pid "${pid}" --onlyvisible --sync)
if [ -z "${window_ids[0]}" ]; then
echo "No window id found for pid ${pid}"
exit 1
fi
for windowid in "${window_ids[@]}"; do
echo "Setting window ID: ${windowid} to position: '${position}'"
set_position "${windowid}"
done
And then:
vlc "${video}" &
pid1=$!
vlc "${video}" &
pid2=$!
sleep 2
bash tile-window-at.sh $pid1 left
bash tile-window-at.sh $pid2 right
The sleep is needed because vlc player change its window size after loading the video.
Also, this solution doesn’t work with nemo, because the returned PID is not the one this a window ID.
Too complex! I wish you success with this new “window rules” feature.
I haven’t had a chance to download and compile this until today, but I absolutely love this! The amount you can fine tune all the window positions is absolutely incredible. For example, I was able to do this with ease: (maybe not the most practical use for nemo, but still, it shows the amazing level of control this update allows to open windows wherever you want them!)