Skip to content

Instantly share code, notes, and snippets.

@tomty89
Last active March 2, 2022 15:32
Show Gist options
  • Save tomty89/84f78aa6e34ed35addb029edef9793d9 to your computer and use it in GitHub Desktop.
Save tomty89/84f78aa6e34ed35addb029edef9793d9 to your computer and use it in GitHub Desktop.
alias 1920='echo Xft.dpi: 144 | xrdb; xrandr --output screen --mode 1920x1080; i3-msg restart'
alias 2560='echo Xft.dpi: 192 | xrdb; xrandr --output screen --mode 2560x1600; i3-msg restart'
#!/bin/sh
display="${DISPLAY/:/}"
case "$display" in
[8-9])
xrandr --newmode 1920x1080 0 1920 0 0 0 1080 0 0 0
xrandr --addmode screen 1920x1080
;;
esac
if [ "$display" = 9 ]; then
xrandr --output screen --mode 1920x1080
fi
case "$display" in
[1-6] | 9)
dpi=144
;;
8)
dpi=192
;;
esac
echo Xft.dpi: "$dpi" | xrdb
systemctl --user start x11vnc@"$display"
mkdir -p "$XDG_RUNTIME_DIR"/i3 && exec i3
#!/bin/bash
port=5900
if [ "$1" != 8 ]; then
let port+="$1"
if [ "$port" -eq 5900 ]; then
port=5908
fi
fi
exec x11vnc -rfbport "$port" -rfbportv6 "$port" -nevershared -forever -repeat -capslock -skip_lockkeys -skip_keycodes 187,188
[Unit]
Description=x11vnc-%i
ConditionPathExists=%T/.X11-unix/X%i
PartOf=xvfb@%i.service
After=xvfb@%i.service
[Service]
Environment=DISPLAY=:%i XAUTHORITY=%t/xauthority
ExecStart=/usr/local/bin/x11vnc-wrapper %i
SuccessExitStatus=2 3
[Unit]
Description=Xvfb-%i
[Service]
ExecStart=/usr/bin/bash -lc 'Xvfb-start :%i -screen 0 2560x1600x24'
[Install]
WantedBy=default.target
@tomty89
Copy link
Author

tomty89 commented Dec 31, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment