Custom Resolutionmaker

RESOLUTIONMAKER is a script which makes a custom resolution. it can be handy if you have some problematic monitor, etc. If resolution is acceptable, it can add to thr startup. In antiX on the bottom of $HOME/.desktop-session/startup

If script is installed as a program, custom resolution file comes to $HOME folder. If running as plain script, custom resolution comes directory, where the script has launched.

An example:

xdg-open $HOME/.desktop-session/startup

… add custom resolution without #/bin/bash

xrandr --newmode "1552x1100_60.00" 142.25 1552 1656 1816 2080 1100 1103 1113 1141
xrandr --addmode VGA1 "1552x1100_60.00"
xrandr -s 1552x1100

DEB package and script: Resolutionmaker-allsystems-script-and-package.zip

RPM package and script: Resolutionmaker_rpm_package.zip

Code:

#!/bin/bash
#
## RJP 19.2.2025 Sript for making a custom resolution file
# Packages xcvt xrandr and yad must be installed
# 22.2.2025 Typos corrected from costom_resolution file
# 22.2.2025 x-terminal-emulator removed from /tmp/modeline command for getting the script working with other linux systems too
time=$(date "+%F-%H-%M-%S")
xrandr | grep -m 1 "connected" > /tmp/connected0
cat /tmp/connected0 | awk '{print $1}' > /tmp/connected
RUUTU=$(cat /tmp/connected)
#
yad yad --width=700 --text-align=center --center --title=$"Make resolution file " --text="Would you like to make custom resolution file?" --title="Make custom resolution file" --text="Would you like to make a custom resolution file?" --title="Make custom resolution file"
WIDHT=`yad --center --width=500 --height=100 --text-align=center --title=$"WIDHT" --text="PUT WIDHT TO THIS" --entry --entry-label=BOX --entry-text=""`
HEIGHT=`yad --center --width=500 --height=100 --text-align=center --title=$"HEIGHT" --text="PUT HEIGHT TO THIS" --entry --entry-label=BOX --entry-text=""`
if [ $? = 0 ];
then
yad --center --width=500 --height=100 --text-align=center --title=$"INFORMATION" --text="YOU SET: $WIDHT $HEIGHT"
/bin/bash -c "cvt $WIDHT $HEIGHT > /tmp/modeline " && \
cat /tmp/modeline | grep Modeline > /tmp/modeline2
cat /tmp/modeline2 | awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11}' > /tmp/newline0
cat /tmp/modeline2 | awk '{print $2}' > /tmp/reso
xrandr --newmode $(cat /tmp/newline0)
xrandr --addmode $RUUTU $(cat /tmp/reso)
sed 's/_.*//' /tmp/reso > /tmp/reso2
sed -s -i '1s/.//' /tmp/reso2
touch custom_resolution$time.sh
echo "#/bin/bash" > custom_resolution$time.sh
echo "xrandr --newmode $(cat /tmp/newline0)" >> custom_resolution$time.sh
echo "xrandr --addmode $RUUTU $(cat /tmp/reso)" >> custom_resolution$time.sh
echo "xrandr -s $(cat /tmp/reso2)" >> custom_resolution$time.sh
sleep 0,1
#
chmod +x custom_resolution$time.sh
#
sleep 0,1
#
yad --width=200 --center --buttons-layout=center --borders=5 --text-align=center --title="READY" --text="Custon resolution set" --button=OK:1 --center
#
# To test custom resolution
yad --width=700 --text-align=center --center --title=$"Test resolution" --text="Would you like to test custom resolution file for 5 seconds?" --title="Test custom resolution file"
if [ $? = 0 ];
then
./custom_resolution$time.sh && sleep 5 && xrandr -s 0
else exit 0
fi
fi