i3wm and Keepassx2 on an Arch-Linux installation. I configured
i3 to automatically move a window with the window class
"Keepassx2" to a certain workspace
$WSKP. I also configured
$mod+P to execute
Keepassx2. Now I would like to write a custom script that is executed by
$mod+P instead. This script should:
Keepassx2when no other instance of it is currently running
Keepassx2and move focus to the specific workspace
$WSKPwhen there already is a running instance
I want this because I don't need the Keepass-Workspace to be open all the time and it takes another unnecessary keypress when tabbing through the workspaces.
Checking whether there already is a running instance is easy:
if [ $(pidof keepassx2) ]; then # maximize the running instance and move focus with i3-msg fi;
But how do I accomplish maximizing the running instance?