How on Debian 13 GNOME to resize a window with a command?
Jan 24, 2:51am

On Debian 13 with GNOME, you can resize a window using the command line with tools like xdotool or wmctrl. Here’s how you can do it:


1. Install Required Tools

First, ensure you have xdotool and wmctrl installed:

bash
sudo apt update sudo apt install xdotool wmctrl

2. Find the Window ID

You need the window ID or name of the window you want to resize. Use:

bash
xdotool selectwindow

Click on the window you want to resize, and it will output the window ID.

Alternatively, list all windows:

bash
wmctrl -l

3. Resize the Window

Using xdotool:

bash
xdotool windowsize <window_id> <width> <height>

Replace <window_id> with the ID from the previous step, and <width> and <height> with your desired dimensions.

Using wmctrl:

bash
wmctrl -i -r <window_id> -e 0,<x>,<y>,<width>,<height>
  • <x> and <y> are the window’s position (use -1 to keep the current position).
  • <width> and <height> are the new dimensions.

4. Example

To resize the active window to 800x600 pixels:

bash
xdotool getactivewindow windowsize 800 600

Or with wmctrl:

bash
wmctrl -i -r $(xdotool getactivewindow) -e 0,-1,-1,800,600

Notes:

  • These tools require the window manager to support X11 (not Wayland).
  • If you’re using Wayland (default in newer GNOME), these tools may not work. In that case, you’d need to use GNOME extensions or scripts that interact with Wayland.
Jan 24, 2:51am

This Chat is read-only. Login to resume chatting.