Skip to content

Instantly share code, notes, and snippets.

@tstellanova
Last active March 2, 2024 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstellanova/a042b0696d77b2615b029c52129477ff to your computer and use it in GitHub Desktop.
Save tstellanova/a042b0696d77b2615b029c52129477ff to your computer and use it in GitHub Desktop.
one liners for wmctrl and xrandr on ubuntu 22 with wayland
# wmctrl one-liners
# DISPLAY is needed if you're running from eg an ssh shell
# list all windows
DISPLAY=:0 wmctrl -lG
# Resize the "active" window
# dimensions are: X,Y,width,height
DISPLAY=:0 wmctrl -r :ACTIVE: -e 0,40,40,1000,500
# Resize a specific (named) window
# dimensions are: X,Y,width,height
DISPLAY=:0 wmctrl -r "X-System" -e 0,1920,54,2048,1152
# close a named window
DISPLAY=:0 wmctrl -c "X-System"
# list GPU modes / ports on DISPLAY=:0
xrandr -d :0
# set display mode for a specific output
xrandr -d :0 --output XWAYLAND13 --mode 2560x1440
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment