last day (15 days later) » 

02:35
0
Q: Dual monitors: on startup, screenbrightness only changes for one monitor

marc.sodaI am trying to change my default screen brightness on startup. I have added the following script to ~/.config/autostart screenBrightness.desktop: [Desktop Entry] ...

Can you post the output of `xrandr | grep " connected " | awk '{ print$1 }'?
@PixelatedFish yes, see above
Interesting. What happens if you remove that line from the desktop file?
@PixelatedFish if I remove the exec line from the desktop file, both monitors are at 100% brightness on startup.
@PixelatedFish note that I also added the command to my .profile out of curiosity, and the behavior was the same: on startup, the HDMI display brightness was at 70% and the DVI display was at 100%. Very strange behavior...
I wonder if, for some reason, the DVI monitor hasn't been setup by the time that command runs. Maybe try setting the exec command to `bash -c '$(xrandr | grep " connected " | awk '{ print$1 }) >> /tmp/monitors', and post the contents of that file? Not sure if that command would even work in the exec line. Also might want to try in a terminal first.
02:41
I am getting a syntax error when entering the command you suggested. Trying to fix it now, but I'm unfamiliar with awk.
oh, that would be because I lost a single quote. Should probably be bash -c '$(xrandr | grep " connected " | awk '{ print$1 }') >> /tmp/monitors'
marc@bigBoop:~$ bash -c '$(xrandr | grep " connected " | awk '{ print$1 }') >> /tmp/monitors'
print: -c: line 0: unexpected EOF while looking for matching `)'
print: -c: line 1: syntax error: unexpected end of file
oops again. bash -c '$(xrandr | grep " connected " | awk '{ print$1 })' Sorry I'm making so many errors
marc@bigBoop:~$ bash -c '$(xrandr | grep " connected " | awk '{ print$1 })' >> /tmp/monitors
bash: syntax error near unexpected token `)'
no worries! thanks for helping me out with this, I appreciate it
Wow... I chopped off the same single quote again. Try bash -c '$(xrandr | grep " connected " | awk '{ print$1 }')'
02:51
marc@bigBoop:~$ bash -c '$(xrandr | grep " connected " | awk '{ print$1 }')'
print: -c: line 0: unexpected EOF while looking for matching `)'
print: -c: line 1: syntax error: unexpected end of file
Alright, bad solution: try putting xrandr | grep " connected " | awk '{ print$1 }' >> /tmp/monitors into a file (/home/user/test.sh), and running chmod +x on it. Then just set the exec line to execute that file.
or, better yet, just xrandr >> /tmp/monitors
doing that now
okay so I changed the .desktop to
1 [Desktop Entry]
2 Encoding=UTF-8
3 Version=1.0
4 Type=Application
5 Name=screenBrightness
6 Comment=automatically configures the screen brightness at startup
7 Exec=test.sh
8 StartupNotify=false
9 Terminal=false
10 Hidden=false
Sorry I haven't been working on this myself; I'm not on Ubuntu right now.
No worries at all
Just to be safe, you should put the absolute path to the file instead of just test.sh
02:59
test.sh is:
okay i'll do that
the .she file is
randr >> /tmp/monitors
.sh not .she ^^
Again just to be safe, put #!/bin/bash at the top of the file
done.
nothing changes on login. what is the expected behavior?
You have execute permssions on the file?
/tmp/monitors contains the output of xrandr
yes I do
ok
what does /tmp/monitors say?
03:03
both monitors are at 100% brightness on login
They should be
1 Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
2 DisplayPort-0 disconnected (normal left inverted right x axis y axis)
3 HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 476mm x 268mm
4 1920x1080 60.00*+ 50.00 59.94
5 1680x1050 59.88
6 1280x1024 60.02
7 1440x900 59.90
8 1280x800 59.91
9 1152x864 75.00
10 1280x720 60.00 50.00 59.94
11 1024x768 70.07 60.00
12 800x600 60.32 56.25
Ok, so the DVI monitor is connected by the time that command is run
Oh, yes, I see what you were trying to do there.
Yes it appears so.
Sorry I made that take so long.
03:06
No worries, I really appreciate you working with me here!
But you said that exact command to change the brightness will work from a console?
I am so confused at this point. Down to last resorts, what happens if you remove the stuff for HDMI from the command, and put it back in Exec=
I'll do that now.
The dvi monitor is still at 100%
What if you execute the command with -v in a terminal? Does it give any output?
03:12
Which command?
marc@bigBoop:~$ xrandr -v --output DVI-0 --brightness .7
xrandr program version 1.5.0
that one
oh, sorry again, I just assumed -v was verbose. try --verbose
marc@bigBoop:~$ xrandr --verbose --output DVI-0 --brightness .7
crtc 1: 1920x1080 60.00 +1920+0 "DVI-0"
What about with HDMI?
marc@bigBoop:~$ xrandr --verbose --output HDMI-0 --brightness .7
crtc 0: 1920x1080 60.00 +0+0 "HDMI-0"
The xrandr man page says
Multiple outputs may be modified at the same time by passing multiple --output options followed immediately by their corresponding modifying options.
So did you try xrandr --output DVI-0 --output HDMI-0 --brightness .7
03:20
I'll try that right now
That command doesn't work in terminal
it manipulated the hdmi brightness but not the dvi
I believe that section of the man page is referring to a structure more like this (the command we've been working with): xrandr --output DVI-0 --brightness .7 --output HDMI-0 --brightness .7
The man page is kind of unclear. Maybe it means xrandr --output DVI-0 HDMI-0 -brightness .7?
But I suppose your's does make more sense
yeah that didn't work, it's trying to treat 'HDMI-0' as an option
note that I have also tried splitting the command in two, running two separate commands:
xrandr --output DVI-0 --brightness 1
xrandr --output HDMI-0 --brightness 1
in a terminal? or a desktop file?
i meant .7 instead of 1 but you get the idea
both
And that didn't work in either?
03:25
it works in terminal, not the desktop file. the dvi brightness remains unchanged
on startup
I'm still thinking maybe it hasn't been fully setup
That's really the only thing it could be
maybe because HDMI is the primary?
Maybe. But that doesn't explain why it works in command line after startup.
I could try setting the dvi to be main and see what happens
I'm thinking it might fully activate the HDMI first, and therefore, when the startup script runs, it can't yet change the brightness, which would explain why it works in terminal.
03:29
Yes that makes sense.
I guess try DVI as primary
working on that
I'm not sure how to set DVI-0 to be the primary display on startup if the HDMI-0 is the default primary
I think you'd have to set it to always be the primary
do you have a ~/.config/monitors.xml?
What's in it?
03:39
1 <monitors version="2">
2 <configuration>
3 <logicalmonitor>
4 <x>1920</x>
5 <y>0</y>
6 <scale>1</scale>
7 <monitor>
8 <monitorspec>
9 <connector>DVI-0</connector>
10 <vendor>ACR</vendor>
11 <product>Acer H226HQL</product>
12 <serial>LX2AA0024210</serial>
13 </monitorspec>
14 <mode>
15 <width>1920</width>
16 <height>1080</height>
17 <rate>60</rate>
18 </mode>
19 </monitor>
Sorry, that's confusing to read. I'm not sure why the tabs aren't copying
apparently ther's a primary tag in the xml file for each monitor
the edit on the first answer
checking that
also see here
10
Q: What do the tags in `monitors.xml` do?

JeroenI have a GNOME 3 desktop environment installed on my Arch Linux box, and I would like to manually configure my desktop settings. I understand there is a file ~/.config/monitors.xml but I am quite puzzled about what the tags in the file actually do. I am particularly interested in the presenta...

I gtg, I'll check back tomorrow
Sounds good. Thanks so much
 
17 hours later…
20:47
What happened with the primary?

last day (15 days later) »