Skip to content

Instantly share code, notes, and snippets.

@stefanwatt
Created February 11, 2023 01:46
Show Gist options
  • Save stefanwatt/ee460ebe47147d864fbcde45d0ce9746 to your computer and use it in GitHub Desktop.
Save stefanwatt/ee460ebe47147d864fbcde45d0ce9746 to your computer and use it in GitHub Desktop.
switch resolution
#!/bin/bash
mode1="3440x1440"
mode2="1920x1080"
output="HDMI-1"
currentMode=$(xrandr | sed '/\s[0-9].*\*/!d' | awk '{print $1}')
newMode=$mode1
if [[ $currentMode == $mode1 ]]
then
newMode=$mode2
fi
xrandr --output $output --mode $newMode
i3-msg reload
i3-msg restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment