For me system-wide hotkey does not work when iTerm2 is closed. Is there a way to enable it? Or maybe create an instance of iTerm that runs invisibly in background and listens for hotkey?
Follow these three steps:
/Applications/Utilities. Create a service for launching iTerm in Automator in these steps:
1.1. In the first window select
1.2. From left sidebar select
Utilities. From middle section drag
Launch Applicationto the right section and select
iTermfrom the its dropdown list. Select
no inputfrom upper dropdown list. Save the document by command+S and provide a meaningful name like
System Preferencesand open
Keyboardsection. Navigate to
Shortcutstab. From left sidebar select
Servicesand from right list scroll to
Generalsection. In this section should be an item named
Launch iTerm. Select it and then click on
add shortcutbutton appeared in the right. Assign a shortcut like control+command+Z.
iTermand navigate to the preferences. Assign the same keyboard shortcut in previous section.
This keyboard shortcut launches iTerm when it is not running and shows/hides iTerm when it is running.