Posted: . At: 8:58 AM. This was 3 years ago. Post ID: 15087
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to resize a window on Linux with the command line.


Resizing a window that has no border can be a problem on Linux. I started MPV with no border to watch a stream of TV and it was larger than I wanted. I could not resize the window by the old Alt->Right mouse button method, but I could use the wmctrl utility.

Use the wmctrl -l command to list all current windows on your desktop.

┌──[jason@192.168.1.2][~/Desktop]
└──╼  ╼ $ wmctrl -l
0x01e00003  0 jason-desktop Audacious
0x01e00034  0 jason-desktop Audacious Playlist Editor
0x01e00037  0 jason-desktop Audacious Equalizer
0x02c00003  0 jason-desktop NVIDIA X Server Settings
0x03400003  0 jason-desktop Resizing a window to a set size in Linux - Stack Overflow — Mozilla Firefox
0x04000006  0 jason-desktop Terminal
0x04400002  0           N/A tv.101204200421.m3u8 - mpv

Once I knew the title of the window I wished to resize, I could do this.

┌──[jason@192.168.1.2][~/Desktop]
└──╼  ╼ $ wmctrl -r tv.101204200421.m3u8 - mpv -e 0,0,0,960,720

This instantly resized the window on my desktop to the right size. This is a very useful utility I think, it is the best way to manipulate the windows on your desktop with a script.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.