You are not logged in.

#1 2015-11-23 02:12:59

opskoewel
Member
Registered: 2015-11-23
Posts: 6

xgamma autostart problem

Hi;

I'm trying to run a xgamma command at start. I've followed many different instructions without success.
I added the command at /home/xinitrc but id didn't work;
I did a script that executes fine and added a service to it at /etc/systemd/system, I "systemctl enable" it and everything works fine but after reboot "status" gives me "unable to open display"; (and yes, I tried with "sleep 60" at the script and even so it didn't work).
I tried to put something at /etc/xdg/autostart but it didn't work either.

Ok, maybe there is a syntax problem somewhere but I cannot recognize it since I'm following the instructions I find at Archwiki.

Can someone help me???

thx.

Offline

#2 2015-11-23 13:11:15

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: xgamma autostart problem

opskoewel wrote:

I added the command at /home/xinitrc but id didn't work

you probably mean /home/user/.xinitrc. It should work but most likely you must delay xgamma's startup with sleep by few seconds.

opskoewel wrote:

I did a script that executes fine and added a service to it at /etc/systemd/system, I "systemctl enable" it and everything works fine but after reboot "status" gives me "unable to open display"

did you try importing DISPLAY and XAUTHORITY: https://wiki.archlinux.org/index.php/Sy … XAUTHORITY

opskoewel wrote:

I tried to put something at /etc/xdg/autostart but it didn't work either.

It needs to be a valid .desktop entry. You could also put it in ~/.config/autostart/

Please post your .xinitrc/script/.service/.desktop file, which ever you're trying to get to work.

Offline

#3 2015-11-23 19:06:11

opskoewel
Member
Registered: 2015-11-23
Posts: 6

Re: xgamma autostart problem

thank you ooo for your response.

I'm trying first the /home/user/xinitrc. Could you please take a look to see what is missing?
The file looks like this (myxgamma.sh is my script):

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
exec i3
sleep 10
exec  /home/user/myxgamma.sh

Last edited by opskoewel (2015-11-23 19:09:04)

Offline

#4 2015-11-23 19:18:45

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: xgamma autostart problem

Nothing after your 'exec i3' line gets run until after i3 has finished (that's what the exec does).

Try changing the last 3 lines to...

/home/user/myxgamma.sh
exec i3

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2015-11-23 19:51:08

opskoewel
Member
Registered: 2015-11-23
Posts: 6

Re: xgamma autostart problem

I've tried:

/home/user/myxgamma.sh

nope

exec /home/user/myxgamma.sh

nope

exec --no-startup-id /home/user/myxgamma.sh

nope.

Everything before exec i3 as you said and tried with and without sleep before.

Any other ideas?

(thanks for the trouble!).

Last edited by opskoewel (2015-11-23 19:51:32)

Offline

#6 2015-11-23 19:57:18

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: xgamma autostart problem

Can you post the contents of your script (in code tags please, it makes it a lot easier to read).


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2015-11-23 20:08:57

opskoewel
Member
Registered: 2015-11-23
Posts: 6

Re: xgamma autostart problem

#!/bin/bash

xgamma -gamma 0.650 

Offline

#8 2015-11-24 01:47:58

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: xgamma autostart problem

please use code tags when posting your configs.

with your ~/.xinitrc, xgamma isn't executed until you exit i3.
You need to run the xgamma script in background before i3, and run sleep in the background process before xgamma.

For example, change your .xinitrc to something like

/home/user/myxgamma.sh &
exec i3

and put sleep in the myxgamma.sh script

sleep 10
xgamma -gamma 0.650

Offline

#9 2015-11-24 08:16:26

opskoewel
Member
Registered: 2015-11-23
Posts: 6

Re: xgamma autostart problem

Sorry but it didn't work.

I also tried to apply your changes to

 /root/.xinitrc 

or

 /etc/skel/.xinitrc 

and it didn't work.

Any other ideas?

Thank you for your patience!

Offline

#10 2015-11-24 09:05:44

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: xgamma autostart problem

post your updated ~/.xinitrc and xgamma script.
do you see any errors from xgamma on startx output (you can save the ouput to a file with 'startx > ~/startx.log')

you could also try something like this in your .xinitrc to run xgamma after i3 is started:

exec i3 & i3pid=$!

sleep 10
xgamma -gamma 0.650

wait $i3pid

Don't edit /etc/skel/.xinitrc or /root/.xinitrc. That won't make any difference. Also don't use X as root user.

Offline

#11 2015-11-24 09:49:07

opskoewel
Member
Registered: 2015-11-23
Posts: 6

Re: xgamma autostart problem

well, your changes to .xinitrc didn't work.

then I used

 startx >startx.log 

and got a blank screen. After reboot I can't log as a user anymore, only as root, all my settings are gone.

I don't know what to do now, should I reinstall everything and keep trying with the xgamma?

Offline

#12 2015-11-24 14:28:48

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: xgamma autostart problem

apparently logging startx output by redirecting didn't work for me either for some reason.

It can't be the cause of your latest issues though.
You could try creating a new user if your system isn't completely broken.

Offline

Board footer

Powered by FluxBB