0

Context: Ubuntu 14.04 (trusty), 3.19.0-26-generic (#28~14.04.1-Ubuntu SMP Wed Aug 12 14:09:17 UTC 2015), Xorg 1.17.1 (13 May 2015 04:35:05AM), Toshiba Satellite L750

I am trying to write a script to control the brightness of my screen.

#!/bin/bash
#
BRIGHTNESS=`zenity --scale --text="Dim screen" --min-value=1 --max-value=9 --step-value=1 --value=9`
#xrandr --output VGA1 --brightness 0.$BRIGHTNESS

(xrandr is deliberately commented out at this point.)

I had initially thought zenity would work with floating point numbers so I had --min-value as 0.0 and --max-value of 2.0 and a --step-value of 0.1. I got an error (the same as I'm getting now) so I changed to integers and changed the xrandr --brightness value to 0.$BRIGHTNESS.

It doesn't seem to matter what I do. I get the following error:

bugmagnet@bugmagnet-Satellite-L750:~/bin$ ./brightness

** (zenity:6095): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-3jrfy88FSO: Connection refused
This option is not available. Please see --help for all possible usages.

I'm fairly sure that my syntax is okay. So where am I going wrong?

2
  • The second error ("option is not available") appears to be because the step parameter is just --step rather than --step-value: see zenity --help-scale. Sep 6, 2015 at 9:04
  • @steeldriver can you post that as a solution so that you can get some kudos. I thought I had RTFM but in this case obviously not.
    – bugmagnet
    Sep 6, 2015 at 10:33

1 Answer 1

1

The second error ("option is not available") appears to be because the step parameter is just --step rather than --step-value:

$ zenity --help-scale
Usage:
  zenity [OPTION...]

Scale options --scale Display scale dialogue --text=TEXT Set the dialogue text --value=VALUE Set initial value --min-value=VALUE Set minimum value --max-value=VALUE Set maximum value --step=VALUE Set step size --print-partial Print partial values --hide-value Hide value

i.e.

zenity --scale --text="Dim screen" --min-value=1 --max-value=9 --step=1 --value=9

I don't know what is causing the accessibility bus warning: however there are some possibly related bug reports here and here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .