Еще один простой способ:
num=0
while (($num <= 10)); do
echo "$num"
((num++))
done
Это будет работать в bash, но не в стандартной оболочке POSIX.
Хорошо, ответ, похоже, не будет, вы не сможете сделать это с помощью плагинов «Разместить Windows» и «Window Rules». Вместо этого вы должны использовать wmctrl и / или Devil's Pie.
В моем случае, просто в качестве примера, я удалил все элементы «Place Windows» / «Window Rules» для Chrome и использовал wmctrl, создав настроенный файл google-chrome.desktop с некоторыми скриптами:
Скопируйте обычный файл google-chrome.desktop:cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications
Изменить ~/.local/share/applications/google-chrome.desktop Найдите строку Exec= и измените ее, чтобы указать на сценарий в удобном месте: Exec=/home/tjc/bin/runchrome %U
Скрипт runchrome просто вызывает мой обобщенный скрипт runandmove с аргументами, которые я хочу использовать для Chrome:
#!/bin/bash
# For 1440x900:
runandmove "Google Chrome" 0 246 0 1025 875 /opt/google/chrome/google-chrome $*
числа workspace x y width height.
My runandmove script & mdash; ни одна вещь красоты & mdash; is:
#!/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
Поскольку после выдачи команды программы перед ее отображением в диспетчере окон может возникнуть задержка, обратите внимание, что в этом случае используется wmctrlretry, если она запускает программу, которая просто простая обертка повтора вокруг 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