Ok, a resposta parece ser não, você não pode fazer isso com os plug-ins "Place Windows" e "Window Rules". Em vez disso, você deve usar wmctrl
e / ou Torta do diabo .
No meu caso, apenas a título de exemplo, removi todas as coisas "Place Windows" / "Window Rules" para o Chrome e usei wmctrl
criando um arquivo google-chrome.desktop
personalizado com alguns scripts:
-
Copie o arquivo usual
google-chrome.desktop
:cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications
-
Edite
~/.local/share/applications/google-chrome.desktop
-
Encontre a linha
Exec=
e altere-a para apontar para um script em um local conveniente:Exec=/home/tjc/bin/runchrome %U
Meu script runchrome
apenas chama meu script runandmove
generalizado com os argumentos que quero usar para o Chrome:
#!/bin/bash
# For 1440x900:
runandmove "Google Chrome" 0 246 0 1025 875 /opt/google/chrome/google-chrome $*
Esses números são workspace x y width height
.
Meu script runandmove
- nada lindo - é:
#!/bin/bash
#
# runandmove looks to see if a program with a given title is already running. If so,
# it raises that program (brings it to the foreground). If not, it runs the program
# in the background (eating all output) and tries to move it to the given position.
# Check we have enough args
if [ $# -lt 7 ]; then
echo "ERROR: Please supply at least seven arguments."
echo
echo "Usage:"
echo
echo " runandmove \"program title\" workspace x y width height \"run command\" {args for command}"
echo
echo "Be sure to use quotes around the program title and the run command if they include"
echo "any spaces (no need if they don't)."
exit -1
fi
# Get the args
program_title=$1
program_ws=$2
program_x=$3
program_y=$4
program_width=$5
program_height=$6
program_cmd=$7
shift 7
# If the program is already running, bring it to the foreground. If it wasn't, wmctrl will
# return 1 and we'll use that as a flag telling us that we just started it.
wmctrl -a "$program_title"
just_started=$?
# If it isn't running, run it and put it in the right place
if [ $just_started -gt 0 ]; then
"$program_cmd" $* &> /dev/null &
wmctrlretry -r "$program_title" -e $program_ws,$program_x,$program_y,$program_width,$program_height
fi
Como pode haver um atraso depois que emitimos o comando do programa antes que ele apareça no gerenciador de janelas, observe que o acima usa wmctrlretry
se iniciar o programa, que é apenas um empacotador de repetição simples em torno de wmctrl
:
#!/bin/bash
# wmctrl with up to 100 retries; we use this when we've just launched a program
# and it takes a moment to show up in the window manager's list.
counter=0
wmctrl $*
while [ $? -gt 0 ]; do
counter=$[$counter+1]
if [ $counter -gt 19 ]; then
exit -1
fi
sleep 0.125
wmctrl $*
done