You are not logged in.

#1 2012-05-22 19:52:47

wgetfree
Member
From: New Zealand
Registered: 2012-05-21
Posts: 18

[SOLVED] feh not displaying wallpaper

Hi there. I just installed feh and wanted it to display a wallpaper for me in dwm. I put the following in my .xinitrc file:

exec feh --bg-fill /home/user/wallpaper.jpg

But it doesn't display the wallpaper at all. I then consulted the feh wiki and tried their approach to displaying a wallpaper which is choosing the wallpaper by using the following in the terminal:

$ feh --bg-fill /home/user/wallpaper.jpg

...which displayed the wallpaper, but after I restart Xorg after adding this to my .xinitrc:

sh ~/.fehbg &

...the wallpaper is no longer displaying. Any clues as to why? Thanks in advance.

Last edited by wgetfree (2012-05-22 20:14:25)

Offline

#2 2012-05-22 19:58:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,564
Website

Re: [SOLVED] feh not displaying wallpaper

it doesn't need to be executable if it is called with sh. <- was response to disappearing post.

I suspect there is a problem in your xinitrc, can you post that?

There really is no reason to use sh to call your .fehbg, it is one more process than you need to create during startup.  Just put "feh --bg-fill path/to/your/wallpaper.png" in your .xinitrc.

Don't use "exec", I'm surprised your wm started at all with this - unless of course that line came after launching your wm, which would then explain why it never set the wallpaper.

In any case, posting your .~/.xinitrc will sort the issue quickly.

Last edited by Trilby (2012-05-22 19:58:47)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2012-05-22 19:58:45

ahammel
Member
Registered: 2012-05-01
Posts: 23

Re: [SOLVED] feh not displaying wallpaper

wgetfree wrote:

Hi there. I just installed feh and wanted it to display a wallpaper for me in dwm. I put the following in my .xinitrc file:

exec feh --bg-fill /home/user/wallpaper.jpg

I believe the comand should be

 feh --bg-fill /home/user/wallpaper.jpg

with no `exec'.

From the man pages:

exec [-cl] [-a name] [command [arguments]]
              If  command  is  specified,  it replaces the shell.  No new process is created. 

`exec' is typically for a desktop environment or similar where you want X to stop when the process stops running.


Laptop: Arch+i3                    Personal file sever: Slackware                   Work PC: Fedora+wmii
Work file sever: FreeBSD       Work application server: Scientific Linux

I'm an addict.

Offline

#4 2012-05-22 20:04:24

wgetfree
Member
From: New Zealand
Registered: 2012-05-21
Posts: 18

Re: [SOLVED] feh not displaying wallpaper

Trilby wrote:

it doesn't need to be executable if it is called with sh. <- was response to disappearing post.

I suspect there is a problem in your xinitrc, can you post that?

There really is no reason to use sh to call your .fehbg, it is one more process than you need to create during startup.  Just put "feh --bg-fill path/to/your/wallpaper.png" in your .xinitrc.

Don't use "exec", I'm surprised your wm started at all with this - unless of course that line came after launching your wm, which would then explain why it never set the wallpaper.

In any case, posting your .~/.xinitrc will sort the issue quickly.

I did post it after the line where my wm was executed. I tried taking away the exec part and that still made no difference. My .xinitrc is very basic as this is a brand-new install and haven't really done much to it.

while true; do
   xsetroot -name "$( date +"%F %R" )"
   sleep 1m    # Update time every minute
done &
exec dwm
feh --bg-fill /home/user/wallpaper.jpg

I don't see what could be wrong here.

Offline

#5 2012-05-22 20:10:52

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED] feh not displaying wallpaper

Switch the last two lines. That's what Trillby mentioned.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2012-05-22 20:14:12

wgetfree
Member
From: New Zealand
Registered: 2012-05-21
Posts: 18

Re: [SOLVED] feh not displaying wallpaper

Inxsible wrote:

Switch the last two lines. That's what Trillby mentioned.

This worked. Did not see him mention that. Thank you all for your help!

Offline

#7 2012-05-22 20:19:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,564
Website

Re: [SOLVED] feh not displaying wallpaper

I suppose I only mentioned it indirectly.  But for future reference note the part of the man excerpt ahammel posted: exec replaces the current process, so anything that comes after an exec line in a shell script will never execute.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB