2
Fedora release 20 (Heisenbug)

 Linux 3.19.8-100.fc20.x86_64 #1 SMP Tue May 12 17:08:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

I have downloaded a binary and ran it in the terminal. The binary is xflux for x86_64. It reduces the bluelight during night time.

However, when I run the binary I get this message This will only work if you're running X on console

All I have done is extracted the tgz and ran the binary. Everything seemed to work fine.

Welcome to xflux (f.lux for X)
This will only work if you're running X on console.

Found 1 screen.
Your location (lat, long) is 13.8, 100.6

Your night-time color temperature is 3400
Going to background: 'kill 9662' to turn off.

Just wondering about that message.

Many thanks for any suggestions,

2
  • 1
    I prefer redshift, jonls.dk/redshift It is in the repos. You should give it a try. Jan 15, 2016 at 10:25
  • 1
    Redshift is good. But I would still like an answer to the above question just out of interest.
    – ant2009
    Jan 18, 2016 at 2:53

2 Answers 2

4
+100

I couldn't find the source code, but I did run an strace on it. From the strace, it's clear that the This will only work... message is just the standard message that is printed to stdout before anything is actually done. Here's the important strace output:

write(1, "\33[2J\33[0;0f\n--------\n", 20) = 20
write(1, "Welcome to xflux (f.lux for X)\n", 31) = 31
write(1, "This will only work if you're ru"..., 52) = 52
write(1, "\n", 1)                       = 1
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path=@"/tmp/.X11-unix/X0"}, 20) = 0
getpeername(3, {sa_family=AF_LOCAL, sun_path=@"/tmp/.X11-unix/X0"}, [20]) = 0
uname({sysname="Linux", nodename="mingus", ...}) = 0
access("/run/user/1000/gdm/Xauthority", R_OK) = 0

You can see that the message is printed before any attempt to access the X11 socket. Another good indication is if you run it outside of an X session; you'll see the exact same message followed by:

Couldn't open display (null)
1
  • 1
    I don't want to edit your answer, but I'd suggest that you add why X is needed. It most likely controls monitor settings through X libraries and drivers (using just pure console, this would be hard)
    – Manwe
    Jan 20, 2016 at 9:14
1

I think f.lux is refering that you should start f.lux before a X (graphical) desktop.

Not sure, but maybe x needs to be a son process of your shell, like flux, and not flux from a shell interpreter opened in X

You must log in to answer this question.

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