Page 1 of 1

SimpleTintControl - powered by 'sct', now featuring selectable presets...

Posted: Wed Nov 01, 2023 2:42 am
by mikewalsh

Evening, gang.

I found myself going through some of the multitude of small apps/utilities I've got archived on my system. Following recent enquiries about 'sct' from @hundido , I reviewed the simple 'tint' control I built around it some years ago.

labbe5 originally discovered it back in 2017:-

https://oldforum.puppylinux.com/viewtop ... 111450#top

At the time myself, Fred and a few others were discussing/experimenting with various ways to implement brightness & red 'tint' controls for night-time use. When 'sct' showed up, I got the idea for a very simple, back-to-Puppy-basics GUI, based around it. Essentially, a button to implement a preset daytime value, ditto for a night-time value, and an infobox describing how to use it.

I don't think I ever actually posted about this! Be that as it may, I've re-jigged and upgraded it a bit. The day-time button still implements a single, default value - 6500 K. The night-time button now features a 'drop-down', giving you a choice of 9 'preset' values - from a 'low' of 2000 K all the way up to 4400K, in 300K steps - and this is implemented immediately upon hitting the 'OK' button. And the infobox has been edited/re-written to reflect these changes.

Image

Image

Pre-compiled 'sct' binaries are included. The whole thing runs from an icon in the notification area over to the right of the tray. It auto-starts at boot-time, and also features a Menu entry under 'Desktop' if you exit the icon from the right-click menu, and need to re-add the icon back during a session without having to dig around in /root/Startup to find the script.

If anybody fancies playing around with a simple 'tint' control that's basic & lightweight, y'all can find it below....

Perhaps it'll prove useful for some of you. Anyways; enjoy.

Mike. Image


Re: SimpleTintControl - powered by 'sct', now featuring selectable presets...

Posted: Wed Nov 01, 2023 4:10 pm
by geo_c

Just for amusement sake, you might want to try my bash script. I think all you need to have installed is xgamma, xrandr, and sct. It's actually all I use now since I know exactly what numbers to enter to get a desired result.

brightness.fake.gz
(1.9 KiB) Downloaded 42 times

needs to be located in /root/my-applications/bin for desktop file to work.

g-bright.desktop.fake.gz
(291 Bytes) Downloaded 44 times

Code: Select all

#!/bin/bash

echo "  ________________________________________________________"
echo " |                                                        |"
echo " |                    COLOR TEMPERATURE                   |"
echo " |            Enter value between 1000 and 10,000         |"
echo " |            note: 6500 is the median temperature        |"
echo " |________________________________________________________|"
echo ""
read -p '                    Enter TEMP: ' TEMP
sct $TEMP
echo ""
echo ""
MONITOR="$(xrandr | grep " connected" | cut -f1 -d " ")"
echo ""
echo "  ________________________________________________________"
echo " |                                                        |"
echo " |                  BRIGHTNESS/BACKLIGHT                  |"
echo " |            Enter value between 0.5 and 1.3             |"
echo " |    WARNING! Lower values are dangerously invisible!    |"
echo " |    note: Some monitors may handle values above 1.3     |"
echo " |________________________________________________________|"
echo ""
read -p '                    Enter BACKLIGHT: ' LEVEL
xrandr --output $MONITOR --brightness $LEVEL
echo ""
echo ""
echo "  ________________________________________________________"
echo " |                                                        |"
echo " |                        CONTRAST                        |"
echo " |            Enter value between 0.3 and 1.5             |"
echo " |    WARNING! Lower values are dangerously invisible!    |"
echo " |________________________________________________________|"
echo ""
read -p '                    Enter CONTRAST: ' CONTRAST
xgamma -gamma $CONTRAST
echo ""
echo ""
printf "temperature = "$TEMP
echo ""
printf "brightness  = "$LEVEL
echo""
printf "contrast    = "$CONTRAST
echo ""
echo ""
GOODBYE=$(
read -p 'Enter settings again? y for yes, any character to exit: ' LEAVE
if [ $LEAVE = 'y' ]; then
	/root/my-applications/bin/brightness
fi )
$GOODBYE

I'm thinking what this script could use is test of input that doesn't accept backlight and contrast values below a certain level that render the screen invisible!