Search code examples
bashyad

Pass variable from YAD slider bar whenever slider is moved, without clicking Ok


I am running Arch Linux with all the latest updates, and have a simple effective program sct installed to let me adjust screen colour temperature. It is from https://github.com/faf0/sct.

I use YAD (Yet Another Dialog) to adjust the variable sent to sct as follows

#! /bin/bash

VALUE=$(yad --title="Select Colour Temperature" \
--geometry=800x100+280+200 --window-icon="colour_temp.png" \
--scale \
--mark=NIGHT:3000 --mark=MID:5000 --mark=DAY:6500 \
--value="2400" --min-value="2000" --max-value="6500" --step="100")

#--print-partial. This option seems of no help; if run from the command prompt partial values are dumped after the 'Ok' dialog clicked.

./sct/xsct $VALUE

This allows me to see the result of the chosen colour temperature when I click Ok on the YAD gui.

How can I make the screen colour temperature update dynamically as I move the slider bar, without clicking Ok?


Solution

  • As of today that's not possible using yad. yad displays a dialog and returns. You can write your own GTK+ dialog application for your purpose.