Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autostart nitrogen --restore doesn't work #86

Closed
tomicp opened this Issue Nov 20, 2016 · 29 comments

Comments

Projects
None yet
9 participants
@tomicp
Copy link

tomicp commented Nov 20, 2016

Autostart 'nitrogen --restore &' from openbox in Arch linux doesn't work since version 1.6!
With version 1.5.2-4 everything works as expected!?

@napcok

This comment has been minimized.

Copy link
Contributor

napcok commented Nov 21, 2016

Same here. It does not work when invoked from script. But it works as expected when typed in terminal window.

Update.
On my second installation I have in ~/.config/nitrogen/bg-saved.cfg

[:0.0]
file=/usr/share/backgrounds/AV_Aca_mountains.jpg
mode=0
bgcolor=#000000

[xin_-1]
file=/usr/share/backgrounds/cqQjpyt.jpg
mode=0
bgcolor=#000000

If I click Apply from GUI it write changes [:0.0] section, but keeps restoring what is in [xin_-1].

@holmeslinux

This comment has been minimized.

Copy link

holmeslinux commented Nov 21, 2016

but this is working?

vlw fwi, Holmes :)

@napcok

This comment has been minimized.

Copy link
Contributor

napcok commented Nov 21, 2016

@holmeslinux yes this is working... somehow. I've got wallpaper from [:0.0] section after reboot, and [xin_-1] after logout/login.

@daf

This comment has been minimized.

Copy link
Member

daf commented Nov 21, 2016

The mechanism for detecting what backend should be used has changed since 1.5.2 - whereas before, Xinerama would only be used if more than one screen was detected, now Xinerama is used as long as the X server reports the extension is present. This means that configurations created with 1.5.2 will have incorrect keys by 1.6.0's standard.

@tomicp, have you used the GUI to save a new background since upgrading? If not, you'll have to - you should see a [xin_<something>] group in ~/.config/nitrogen/bg-saved.cfg. --restore should work ok after that.

@napcok This is concerning. It sounds like there's a time that Nitrogen detects Xinerama is present versus a time that it thinks it is not present? If you're comfortable building from source, use ./configure --enable-debug=yes; make; ./src/nitrogen. Nitrogen will report what setter backend it is using (as an integer):

~/dev/nitrogen -> ./src/nitrogen
MARK: nitrogen: root window type 4

If you could do this and report what it says when invoked from a command line vs when you run your script (presumably at startup), this would be helpful in tracking down the issue.

@tomicp

This comment has been minimized.

Copy link
Author

tomicp commented Nov 21, 2016

Yes, I did use Gui to save new wallpaper but i dont have [xin_] group in bg-saved.cfg file.
Here is my bg-saved.cfg file.

[:0.0]
file=/home/tomicp/Pictures/wallpapers/DragonW.png
mode=4
bgcolor=#000000

Here is output from terminal...
UNKNOWN ROOT WINDOW TYPE DETECTED, will attempt to set via normal X procedure

@daf

This comment has been minimized.

Copy link
Member

daf commented Nov 21, 2016

@tomicp ok, this only happens when you're running some kind of Desktop window and Nitrogen doesn't know what kind it is (see source). You mentioned you were running openbox, but are you running some sort of DE?

@holmeslinux

This comment has been minimized.

Copy link

holmeslinux commented Nov 21, 2016

hi all,
also here

UNKNOWN ROOT WINDOW TYPE DETECTED, will attempt to set via normal X procedure

i'm using JWM.

vlw fwi, Holmes :)

@daf

This comment has been minimized.

Copy link
Member

daf commented Nov 21, 2016

@holmeslinux, @tomicp would also be interested to see what you get when you do xprop in a terminal and click your desktop (note this is not the same as xprop -root as that won't find a shim window).

(as a matter of style, either use gist.github.com or wrap your output in <details></details>)

@napcok

This comment has been minimized.

Copy link
Contributor

napcok commented Nov 21, 2016

@daf with --enable-debug=yes I have.
after reboot:

MARK: nitrogen: root window type 3

MARK: nitrogen: entering restore_bgs()
MARK: nitrogen: leaving restore_bgs()

after logout/log in

MARK: nitrogen: root window type 4

MARK: nitrogen: entering restore_bgs()
MARK: nitrogen: leaving restore_bgs()

then running from terminal again shows root window type 3

With different root window type I got different wallpaper :)

@holmeslinux

This comment has been minimized.

Copy link

holmeslinux commented Nov 22, 2016

hi,
xprop

http://pastebin.com/sLN1zTzH

vlw fwi, Holmes :)

@daf

This comment has been minimized.

Copy link
Member

daf commented Nov 22, 2016

Thanks all for the help. I've discovered an issue with Nitrogen and Conky (with own_window/own_window_type='desktop') where Nitrogen thinks that is a full screen overlay similar to how DEs implement their root windows, and therefore can't figure out which setter to use. This is causing it to pick UNKNOWN, which falls back to the X windows setter, instead of the Xinerama one that most of them use. I'll have to repair this detection, see #88.

@napcok / @tomicp are either of you running Conky with these settings? This might be your issue as well (or something similar).

@daf daf added this to the 1.6.x milestone Nov 22, 2016

@tomicp

This comment has been minimized.

Copy link
Author

tomicp commented Nov 22, 2016

yes I have conky 1.10.5.1 installed, but even with all disabled startup programs, it doesn' work.
~/.config/openbox/autostart

#xset b off
#lxpolkit &
#(sleep 4s; nitrogen --restore) &
nitrogen --restore &
#compton --config ~/.config/compton.conf &
#(sleep 2s; setxkbmap -layout ba,us -option grp:alt_shift_toggle) &
#pcmanfm -d &
#(sleep 2s; tint2) &
#(sleep 2s; conky -c ~/.config/conky/conky.conf) &

@tomicp

This comment has been minimized.

Copy link
Author

tomicp commented Nov 22, 2016

@napcok

This comment has been minimized.

Copy link
Contributor

napcok commented Nov 22, 2016

@daf Yes I have conky runninig too.

@daf

This comment has been minimized.

Copy link
Member

daf commented Nov 23, 2016

Folks, I have a work in progress refactor I've just pushed to https://github.com/l3ib/nitrogen/tree/rootdetect . I have to finish some corner cases but this is working for my reproduced setup and is also cleaning up code in the process. If anyone could try and report if it fixes issues I'd be grateful, thanks!

@daf daf closed this in 9821adf Dec 3, 2016

@VastOne

This comment has been minimized.

Copy link

VastOne commented Dec 25, 2016

I am confused @daf ... has this issue been resolved and pushed to debian maintainer? With VSIDO (Debian Sid distro) we have Nitrogen 1.6.0 installed and must alter the order that nitrogen starts in the fluxbox startup so that it will restore correctly IF own_window_type desktop is what is setup in conky .. this is the default settings in VSIDO .. I do not mind altering how things start on startup, I am just curious if there is code that corrects the entire issue

@daf daf referenced this issue Jan 1, 2017

Closed

conflict with conky #90

@daf

This comment has been minimized.

Copy link
Member

daf commented Jan 1, 2017

@VastOne the fix is in master but not yet released. I'm trying to fix a few more issues before 1.6.1 is released (and can then be packaged).

@VastOne

This comment has been minimized.

Copy link

VastOne commented Jan 1, 2017

@daf Thank you and Happy New Year!

@daf daf modified the milestones: 1.6.x, 1.6.1 Jan 1, 2017

@andoruB

This comment has been minimized.

Copy link

andoruB commented Jan 16, 2017

@daf Compiled the latest commit, but nitrogen still doesn't restore the wallpaper after a cold boot... Am I doing something wrong?

@daf

This comment has been minimized.

Copy link
Member

daf commented Jan 17, 2017

@andoruB doubt it's you, it's likely the software! What environment are you running? If you can ./configure --enable-debug=yes; make clean; make again Nitrogen will spit some sparse debugging information to console, including what it detected for which mode to use - that would be useful.

@daf daf reopened this Jan 17, 2017

@andoruB

This comment has been minimized.

Copy link

andoruB commented Jan 18, 2017

Is it possible to make Nitrogen drop a log instead? I'm launching it from OB's autostart file at boot.
Environment, as in DE? In that case it's OB :P

EDIT: Seems to also be a Conky issue. I tried running Nitrogen without performing a cold boot first, here's what I got in STDOUT:

UNKNOWN ROOT WINDOW TYPE DETECTED (conky), please file a bug
MARK: nitrogen: root window type 3

MARK: nitrogen: entering restore_bgs()
MARK: nitrogen: leaving restore_bgs()
@daf

This comment has been minimized.

Copy link
Member

daf commented Jan 18, 2017

Oh, strange, it's a capitalization issue! My version of conky that I was testing against produces "Conky" instead, and the check is case-sensitive. Thanks for helping troubleshoot, I'll add a correction. Out of curiosity, what version of conky?

@daf

This comment has been minimized.

Copy link
Member

daf commented Jan 18, 2017

@andoruB please try 9ac3826 when you have a chance, thanks.

@daf daf closed this Jan 18, 2017

@andoruB

This comment has been minimized.

Copy link

andoruB commented Jan 18, 2017

$ apt policy conky
conky:
  Installed: 1.10.6-1
  Candidate: 1.10.6-1
  Version table:
 *** 1.10.6-1 500
        500 http://debian.mirror.linux.com unstable/main amd64 Packages
        500 http://debian.mirror.linux.com unstable/main i386 Packages
        100 /var/lib/dpkg/status

Will try out the latest commit, and I'll let you know! :)

@boydkelly

This comment has been minimized.

Copy link

boydkelly commented Feb 28, 2017

I'm having this problem with Fedora 25, Fluxbox and Nitrogen 1.6.0 It will start from the command line, but not from the fluxbox/startup file. This is a livecd and worked previously with no problems and currently testing under kvm. I have updated the Nitrogen config files as below. I am getting the UNKOWN ROOT WINDOW TYPE DETECTED error message even when nitrogent --resstore works from a terminal. Any work-around?

cat > /home/liveuser/.config/nitrogen/bg-saved.cfg << FOE
[:0.0]
file=/usr/share/backgrounds/default.png
mode=4
bgcolor=#000000
FOE

cat > /home/liveuser/.config/nitrogen/nitrogen.cfg << FOE
[geometry]
posx=0
posy=0
sizex=450
sizey=500

[nitrogen]
view=list
recurse=true
sort=alpha
icon_caps=false
dirs=/usr/share/backgrounds;
FOE

@andoruB

This comment has been minimized.

Copy link

andoruB commented Feb 28, 2017

Whoops! I forgot to let you guys know that now Nitrogen works as expected here.
@boydkelly Have you tried compiling the latest commit off this repo?

@daf

This comment has been minimized.

Copy link
Member

daf commented Feb 28, 2017

Hi @boydkelly, this is fixed in 1.6.1 which was released about 2 weeks ago. It may not yet be packaged for your distro.

@JamesWrigley

This comment has been minimized.

Copy link
Contributor

JamesWrigley commented Feb 28, 2017

Uhhh, yeah. @boydkelly, I'll get on the Fedora package tonight :)

@RFGMM

This comment has been minimized.

Copy link

RFGMM commented Feb 24, 2018

I got a solution:

install feh and instead of nitrogen --restore put this on autostart

in case of using

[:0.0]

feh --bg-fill $(head -n 7 .config/nitrogen/bg-saved.cfg | tail -n 1 | cut -c 6-) &
or
in case of using

[xin_-1]

feh --bg-fill $(head -n 2 .config/nitrogen/bg-saved.cfg | tail -n 1 | cut -c 6-) &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.