VSIDO Community

VSIDO Support => Scripts and How To's => Zenity & Yad => Topic started by: statmonkey on September 27, 2013, 08:43:34 AM

Title: redeye type adjustment
Post by: statmonkey on September 27, 2013, 08:43:34 AM
OK, good to hear.  Above I mentioned that you can essentially drag and drop to make new scripts and here is an example.  Pretty simple but still relatively useful.  By essentially slightly altering the initial zenity call we can change the back up script from file selection to yes/no and make our little script adjust our monitor warmth (this is just a bastardization of redeye btw).
#!/bin/bash
#==========================================================================
# TITLE: redeye type adjustment
# AUTHOR:Statmonkey
#
# USAGE: redeye $1 as in redeye night or redeye day
# DESCRIPTION:  Automatically adjusts the screen to night mode for reduced eye strain
# Requires redeye             
# DATE: LAST UPDATED 4/30/13 to change the settings to greater variance
#==========================================================================
###############################################
# Define Variables:
###############################################
zenity --question --title="Redeye" --text="Set screen for ..." --ok-label="Night" --cancel-label="Day"

redeye=$?
if [ "$redeye" -eq "0" ] ; then
   xrandr | sed -n 's/ connected.*//p' | xargs -n1 -tri xrandr --output {} --brightness 0.7 --gamma 2:3:4
else
   xrandr | sed -n 's/ connected.*//p' | xargs -n1 -tri xrandr --output {} --brightness 1 --gamma 1:1:1
fi


I actually do use this frequently as I tend to sit at the box a little too much every day/night/week/month/year