I am using the i3 window manager. I would like to autostart an xterm window and move it…
- User
I am using the i3 window manager. I would like to autostart an xterm window and move it to scratchpad; and then use a keypress to show the xterm. If I accidentally close the xterm window, I would also like the keypress to start xterm in the scratchpad again. How do I do this?
Assistant
To autostart an xterm window and move it to the scratchpad in i3 window manager, you can use the following steps:
-
Open the i3 config file by running the command nano ~/.config/i3/config.
-
Add the following lines to the config file to start an xterm window and move it to the scratchpad:
# Start an xterm window exec --no-startup-id xterm # Move the xterm window to the scratchpad move scratchpad- Save the changes to the config file by pressing Ctrl+X, then Y, and then Enter.
To use a keypress to show the xterm window, you can create a keyboard shortcut for it. Here's how:
-
Open the i3 config file again by running the command nano ~/.config/i3/config.
-
Add the following lines to the config file to create a keyboard shortcut for the xterm window:
# Set the keyboard shortcut (you can change "Ctrl+Alt+X" to any key combination you want) bindsym $mod+Ctrl+Alt+X exec --no-startup-id xterm # Move the xterm window to the scratchpad move scratchpad- Save the changes to the config file by pressing Ctrl+X, then Y, and then Enter.
Now, when you press the keyboard shortcut you set (Ctrl+Alt+X by default), an xterm window will be opened and moved to the scratchpad.
If you accidentally close the xterm window, you can simply press the keyboard shortcut again to start it in the scratchpad again.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.