You are not logged in.

#1 2012-07-29 17:00:02

zcal
Member
Registered: 2010-01-13
Posts: 57

[SOLVED] Set background image without feh

I've been setting my background image by using "feh --bg-fill [path to image]" but I would like to move to a simpler alternative such as imlibsetroot, hsetroot, xsetbg, etc.  The problem is that I haven't been able to find a way to get any of these programs to do exactly what feh's --bg-fill option does.  That is, the image should scale up or down, while maintaining its aspect ratio, until either its horizontal or vertical edges meet the sides of the screen and there is no empty space visible.  Basically, I want the program to push part of the image off the screen if that's what it takes to fill the whole thing.

Is there a way to do this that I'm just missing?

Last edited by zcal (2012-08-05 16:29:50)

Offline

#2 2012-07-29 17:50:46

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] Set background image without feh

hsetroot -fill <imgfile> seems to work for me

(edit) I was wrong. it changes the aspect ratio.

Last edited by 2ManyDogs (2012-07-29 17:53:25)

Offline

#3 2012-07-29 18:44:05

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED] Set background image without feh

If feh does exactly what you want, does it get any simpler than that...? tongue

Offline

#4 2012-07-29 19:28:36

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Set background image without feh

There are a few very simple applications for setting background in the AUR, but I'm sure you have already found them, haven't you?


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#5 2012-07-29 19:32:11

burninate
Member
Registered: 2012-07-28
Posts: 22

Re: [SOLVED] Set background image without feh

mariusmeyer wrote:

If feh does exactly what you want, does it get any simpler than that...? tongue

+1

Why change a winning team? Feh is lightweight anyway..

Offline

#6 2012-07-29 20:42:41

zcal
Member
Registered: 2010-01-13
Posts: 57

Re: [SOLVED] Set background image without feh

Just trying to get down to one application per...well, application.  I've found sxiv more to my liking than feh for image browsing and viewing, so I'd like to get rid of feh in favor of a simpler application for setting the background.

Offline

#7 2012-07-29 20:55:42

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Set background image without feh

# pacman -S nitrogen

Start the program, add a folder and choose your wallpaper:

$ nitrogen

Then place this in ~/.config/openbox/autostart, or ~/.xinitrc, whatever:

nitrogen --restore &

I've been using it for over two years now.

https://wiki.archlinux.org/index.php/Nitrogen


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#8 2012-07-29 23:00:31

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED] Set background image without feh

Yeah, I get what you're trying to do, but you still mention the word "simpler application". Do you have a less abstract notion for what you want? Smaller (as in installed bytes), smaller (as in less memory footprint)? A program that can do less? Right now it looks to me like you have one app per need: feh for setting the background and sxiv for image browsing and viewing smile

If you want to find out whether sxiv can do what

feh --bg-fill /foo/bar

does, then maybe you should ask the people who made sxiv?

Offline

#9 2012-07-30 04:50:16

zcal
Member
Registered: 2010-01-13
Posts: 57

Re: [SOLVED] Set background image without feh

@DSpider

Thanks much for the suggestion, but I should have also specified that I'd like to stick to command line-only programs.  Sorry for being picky! tongue

@mariusmeyer

Preferably smaller as in installed size, and simpler in that it is built specifically for the task of setting images/colors on the root window.  feh does the job, but it's also an image viewer, image browser, something of an image file manager, etc.  Alternatives like imlibsetroot and hsetroot would be perfect but for the fact that I haven't been able to have them scale images like I want.  That is unless I'm overlooking some creative solution, which is part of what I'm looking for help with.

ber_t, the creator of sxiv, has already stated that he's uninterested in adding such functionality to the program.

Offline

#10 2012-07-30 06:04:34

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: [SOLVED] Set background image without feh

I use imlibsetroot, can be found in the AUR. It also supports xinerama.

imlibsetroot -x e -s '/path/to/image'

Last edited by Army (2012-07-30 06:06:11)

Offline

#11 2012-07-30 06:26:48

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Set background image without feh

zcal wrote:

@DSpider

Thanks much for the suggestion, but I should have also specified that I'd like to stick to command line-only programs.  Sorry for being picky! tongue

@mariusmeyer

Preferably smaller as in installed size...

Command-line tools for an Xorg environment? neutral

$ pacman -Qi nitrogen | grep "Installed Size"
Installed Size : 372.00 KiB

$ pacman -Qi feh | grep "Installed Size"
Installed Size : 436.00 KiB

They're both still under half a megabyte.

For contrast...

$ pacman -Qi leafpad | grep "Installed Size"
Installed Size : 424.00 KiB

$ pacman -Qi nano | grep "Installed Size"
Installed Size : 1521.00 KiB

(yes, the GUI takes up a lot less space than the command-line)


This is a moot point. I'm not posting anymore. I've made my case.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#12 2012-07-30 08:43:31

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Set background image without feh

I use esetroot from AUR - it Eterm's root setter, packaged separately.
Comes in at 40k - uses imlib2 which is quite big but is the same library that sxiv uses, so you'll have it anyway.

Might be better, worse or no different to any of the suggestions above, as I haven't used any of them.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#13 2012-08-02 00:12:49

zcal
Member
Registered: 2010-01-13
Posts: 57

Re: [SOLVED] Set background image without feh

@Army

imlibsetroot is exactly what I want minus the fill functionality.  Thought maybe there was a magic trick to get it to work but I haven't had any luck.

@skanky

Thanks for the tip on esetroot!  I hadn't found that one yet.  Doesn't seem to do what I'm looking for, though.  Other than the missing fill option, the *setroot programs are just about perfect.  Oh well.  tongue

Last edited by zcal (2012-08-02 00:13:23)

Offline

#14 2012-08-02 00:16:56

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

Re: [SOLVED] Set background image without feh

Use an image editor to scale/stretch your image to match your screen's resolution.  Then use one of the *setroots.


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

Offline

#15 2012-08-02 08:35:34

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Set background image without feh

zcal wrote:

@Army

imlibsetroot is exactly what I want minus the fill functionality.  Thought maybe there was a magic trick to get it to work but I haven't had any luck.

@skanky

Thanks for the tip on esetroot!  I hadn't found that one yet.  Doesn't seem to do what I'm looking for, though.  Other than the missing fill option, the *setroot programs are just about perfect.  Oh well.  tongue

I use -scale, but thought that was what -fit did - though it's been a long time since I've played with it, so I'm not surprised my recall was wrong.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#16 2012-08-05 06:57:14

zcal
Member
Registered: 2010-01-13
Posts: 57

Re: [SOLVED] Set background image without feh

Trilby wrote:

Use an image editor to scale/stretch your image to match your screen's resolution.  Then use one of the *setroots.

This was my first thought, but I move between three separate screens of different resolutions.  I've resigned myself to being stuck with feh for now.  sad  Thanks for your suggestion, though!

Edit:
Worked up a solution similar to this but that doesn't require editing any image files.  imlibsetroot has an option (-s X,Y) for scaling an image to a set X and Y number of pixels.  Since I use a couple of custom shortcuts to toggle screens with xrandr, I just tacked on imlibsetroot with the appropriate number of pixels for each screen.  This allows me to set the image width or height to be wider or higher than the screen if necessary to completely fill up the background, it just means I need to do some simple math to get the right dimensions.

Here's an example for an image of 1440x864 on my 1280x1024 monitor:

xrandr --output LVDS --off --output VGA-0 --auto && imlibsetroot -s 1707,1024 -p c ~/look/background

Admittedly this solution would suck if I changed my background on a regular basis, but I don't.  tongue

Last edited by zcal (2012-08-05 16:32:25)

Offline

Board footer

Powered by FluxBB