dotfiles/.local/bin/evolution-on-workspace-0

30 lines
687 B
Shell
Executable file

#!/bin/sh
# Raise Evolution and switch to its workspace,
# or switch to the target workspace first and launch it there
#
# Switching before the launch avoids the flicker that
# `auto-move-windows` causes by relocating an already mapped window
#
# Note that `auto-move-windows` must not also manage Evolution,
# or both mechanisms fight over the placement
set -eu
_CLASS=evolution
_COMMAND=/usr/bin/evolution
# This is the last of the 10 named but 0-based workspaces
# in "num-workspaces" under [org/gnome/desktop/wm/preferences]
_WORKSPACE=9
# "wmctrl -x -a" already switches to the window's workspace
wmctrl -x -a "$_CLASS" && exit 0
wmctrl -s "$_WORKSPACE"
exec "$_COMMAND"