You are not logged in.

#1 2011-06-14 10:24:31

awayand
Member
Registered: 2009-09-25
Posts: 398

[SOLVED] in-place execution of grepped command

I have an .xinitrc which contains the following line:

eval $(cat ~/.fehbg)

The ~/.fehbg file contains:

feh  --bg-scale '/home/x/beautiful.jpg'

The above sets my background screen in X to a picture.

Now I am setting the background to grey:

xsetroot -gray

Now while I am in my X session, I want to re-set my background picture. Thinking I am smart, I do the following:

$ $(grep feh ~/.xinitrc)

But no, linux teaches me once again I don't get it:

Error: feh WARNING: '/home/x/beautiful.jpg' - File does not exist
feh ERROR: Couldn't load image in order to set bg

What am I doing wrong?

Last edited by awayand (2011-06-14 12:13:59)

Offline

#2 2011-06-14 10:34:30

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] in-place execution of grepped command

man feh

Just use feh to reset it:

feh --bg-scale /path/to/image

Also, in your .xinitrc you don't need to abuse the cat

sh ~/.fehbg &

will do...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2011-06-14 10:50:23

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] in-place execution of grepped command

i like that url, bookmarked. thanks for the improvement suggestions but I am really trying to understand why this is not working as to me it definitely should. is it a bug in feh or something I dont understand? The file is definitely there...

Offline

#4 2011-06-14 11:35:25

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: [SOLVED] in-place execution of grepped command

The single quote marks are being included as part of the image name and not being stripped off. You'll see that if you do

feh --bg-scale 'imaginary_file'

The output is

feh WARNING: imaginary_file - File does not exist
feh ERROR: Couldn't load image in order to set bg

Notice the file it says does not exist does NOT include quote marks. Forcing whatever strips the quote marks not to do that (bash, maybe?), you get

feh --bg-scale \'imaginary_file\'
feh WARNING: 'imaginary_file' - File does not exist
feh ERROR: Couldn't load image in order to set bg

Doing "eval $(grep feh ~/.xinitrc)" works, but I recommend not doing that wink

Last edited by jac (2011-06-14 11:36:16)

Offline

#5 2011-06-14 12:13:03

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] in-place execution of grepped command

you're a genius, thanks!
I changed my line in .xinitrc to ". ~/.fehbg" as well and the problem has also vanished. But it bothered me what was going on with my first, not so elegant approach. thanks for clearing that up!

Offline

Board footer

Powered by FluxBB