From 39cc2a7d5ee1862d65a2e7355668ab4f9b298a85 Mon Sep 17 00:00:00 2001 From: t0xa Date: Fri, 22 Aug 2025 14:53:25 +0300 Subject: [PATCH] Scripts: Add scripts for work thinkpad management --- scripts/set_brightness_keyboard.sh | 13 +++++++++++++ scripts/set_brightness_screen.sh | 12 ++++++++++++ scripts/xrandr_3.sh | 2 ++ scripts/xrandr_main-type_c.sh | 2 ++ 4 files changed, 29 insertions(+) create mode 100755 scripts/set_brightness_keyboard.sh create mode 100755 scripts/set_brightness_screen.sh create mode 100755 scripts/xrandr_3.sh create mode 100755 scripts/xrandr_main-type_c.sh diff --git a/scripts/set_brightness_keyboard.sh b/scripts/set_brightness_keyboard.sh new file mode 100755 index 0000000..96040d9 --- /dev/null +++ b/scripts/set_brightness_keyboard.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +BRIGHTNESS_LEVEL="${1:-}" + +if [ -z "$BRIGHTNESS_LEVEL" ]; then + BRIGHTNESS_LEVEL=2 + echo "No brightness level provided. Setting brightness to: $BRIGHTNESS_LEVEL" +fi + +echo "Setting keyboard brightness to: $BRIGHTNESS_LEVEL" + +echo "$BRIGHTNESS_LEVEL" | sudo tee /sys/class/leds/tpacpi::kbd_backlight/brightness + diff --git a/scripts/set_brightness_screen.sh b/scripts/set_brightness_screen.sh new file mode 100755 index 0000000..7322692 --- /dev/null +++ b/scripts/set_brightness_screen.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +BRIGHTNESS_LEVEL="${1:-}" + +if [ -z "$BRIGHTNESS_LEVEL" ]; then + BRIGHTNESS_LEVEL=1 + echo "No brightness level provided. Setting brightness to: $BRIGHTNESS_LEVEL" +fi + +echo "Setting screen brightness to: $BRIGHTNESS_LEVEL" + +xrandr --output eDP --brightness "$BRIGHTNESS_LEVEL" diff --git a/scripts/xrandr_3.sh b/scripts/xrandr_3.sh new file mode 100755 index 0000000..3e77f77 --- /dev/null +++ b/scripts/xrandr_3.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output eDP --primary --mode 1920x1200 --pos 3134x3757 --rotate normal --output HDMI-A-0 --mode 2560x1440 --pos 2814x2317 --rotate normal --output DisplayPort-0 --off --output DisplayPort-1 --mode 2560x1440 --pos 5374x2317 --rotate normal --output DisplayPort-2 --off --output DisplayPort-3 --off --output DisplayPort-4 --off --output DisplayPort-5 --off diff --git a/scripts/xrandr_main-type_c.sh b/scripts/xrandr_main-type_c.sh new file mode 100755 index 0000000..67012da --- /dev/null +++ b/scripts/xrandr_main-type_c.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output eDP --primary --mode 1920x1200 --pos 0x1124 --rotate normal --output HDMI-A-0 --off --output DisplayPort-0 --off --output DisplayPort-1 --mode 2560x1440 --pos 1920x0 --rotate normal --output DisplayPort-2 --off --output DisplayPort-3 --off --output DisplayPort-4 --off --output DisplayPort-5 --off