Skip to content

Instantly share code, notes, and snippets.

@rakotomandimby
Last active February 18, 2026 11:59
Show Gist options
  • Select an option

  • Save rakotomandimby/c7e38164da696b538d4e5d2b636ee4e3 to your computer and use it in GitHub Desktop.

Select an option

Save rakotomandimby/c7e38164da696b538d4e5d2b636ee4e3 to your computer and use it in GitHub Desktop.
switch to wide screen
#!/bin/bash
# check if the new mode already exists
if ! xrandr | grep -q "3440x1440_60.00"; then
# create the new mode
xrandr --newmode "3440x1440_60.00" 419.50 3440 3696 4064 4688 1440 1443 1453 1493 -hsync +vsync
xrandr --addmode Virtual-1 "3440x1440_60.00"
fi
# check if the current mode is already set to 3440x1440_60.00
if ! xrandr | grep -q "Virtual-1 connected 3440x1440"; then
# set the new mode
xrandr --output Virtual-1 --mode "3440x1440_60.00"
else
echo "Virtual-1 is already set to mode 3440x1440_60.00."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment