From 445ae385cfd93eae2a0402a5ffe20378488dee7e Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Wed, 9 Sep 2026 11:24:19 +0530 Subject: vnc undo, left hand mode script, new functionality in nvim & attempts to fix some suspend issue --- scripts/left-mode.sh | 19 +++++++++++++++++++ scripts/unsetup-vnc-monitor.sh | 19 +++++++++++++++++++ scripts/vnc.sh | 1 + 3 files changed, 39 insertions(+) create mode 100755 scripts/left-mode.sh create mode 100755 scripts/unsetup-vnc-monitor.sh (limited to 'scripts') diff --git a/scripts/left-mode.sh b/scripts/left-mode.sh new file mode 100755 index 0000000..b5c8a22 --- /dev/null +++ b/scripts/left-mode.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euo pipefail + +device_id=$( + xinput list | + grep -i 'Optical Mouse' | + sed -n 's/.*id=\([0-9]\+\).*/\1/p' | + head -n 1 +) + +if [[ -z "$device_id" ]]; then + echo "Error: No device matching 'Optical Mouse' found." >&2 + exit 1 +fi + +echo "Found Optical Mouse with ID: $device_id" + +xinput set-prop "$device_id" "libinput Left Handed Enabled" 1 diff --git a/scripts/unsetup-vnc-monitor.sh b/scripts/unsetup-vnc-monitor.sh new file mode 100755 index 0000000..8eaa494 --- /dev/null +++ b/scripts/unsetup-vnc-monitor.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euo pipefail + +export DISPLAY=:0 + +# Remove the monitors created by the original script. +xrandr --delmonitor PHYSICAL 2>/dev/null || true +xrandr --delmonitor VNC 2>/dev/null || true + +# Remove any leftover monitor definitions from previous runs. +xrandr --delmonitor VNC-0 2>/dev/null || true +xrandr --delmonitor VNC-1 2>/dev/null || true +xrandr --delmonitor VNC-2 2>/dev/null || true + +# Restore the framebuffer to the physical display's resolution. +xrandr --fb 1920x1080 + +xrandr --listmonitors diff --git a/scripts/vnc.sh b/scripts/vnc.sh index ad9fefd..223382f 100755 --- a/scripts/vnc.sh +++ b/scripts/vnc.sh @@ -15,6 +15,7 @@ cleanup() { trap cleanup INT TERM EXIT Xvnc :1 \ + -rfbport 5900 :1 \ -geometry 1920x1080 \ -depth 24 \ -rfbauth ~/.config/vnc/passwd & -- cgit v1.2.3