SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-10-19 19:45:26

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Modifying my Wallpaper changer

This is the wallpaper changer I am using with Crunchbang and it works great!

#!/bin/bash

# directory containing images
DIR="/home/randy/images/wallpapers/Wallpaper"

# select a random jpg from the directory
PIC=$(ls $DIR/*.jpg | shuf -n1)

# use nitrogen to set wallpaper
nitrogen --set-zoom-fill $PIC

I would like to put this on my wife's PC. She is running an older version of Linux Lite (1.0.8) which uses Thunar 1.2.3. How can I modify the script above so that it works on her machine?


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

Help fund CrunchBang, donate to the project!

#2 2014-10-19 20:14:05

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: Modifying my Wallpaper changer

Does her machine have nitrogen for setting the background? Install it if needed, or use something else eg feh

feh --bg-scale --no-fehbg $PIC

Is she called randy as well? Thought not, so change the path to the image directory!

It has nothing to do with Thunar - you are using bash, not a filemanager.

Last edited by damo (2014-10-19 20:17:55)


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#3 2014-10-19 20:15:28

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Modifying my Wallpaper changer

Maybe I'm missing something here, but thunar isn't used at all -- that script should still work.
If we're playing shell golf my submission would be:

#!/bin/sh
nitrogen --set-zoom-fill $(ls $HOME/images/wallpaper/Wallpaper/*.jpg | shuf -n1)

Offline

#4 2014-10-19 20:22:25

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Modifying my Wallpaper changer

I installed Nitrogen on her PC and did change the path to her wallpaper as well and I made the script executable as well. When I double click on the script, nothing happens. No wallpaper changing. Maybe I will run the script from the terminal and see what is going on and post back.


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#5 2014-10-19 20:24:02

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Modifying my Wallpaper changer

Just run my one-liner & see if that works.
No need for a script really...

EDIT: Just tried this & it works fine (needs hsetroot):

hsetroot -fill $(ls $HOME/images/wallpapers/Wallpaper/*.jpg|shuf -n1)

BTW, thanks for this -- now in my startup script big_smile

Last edited by Head_on_a_Stick (2014-10-19 21:17:20)

Offline

#6 2014-10-19 21:13:26

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Modifying my Wallpaper changer

rmcellig wrote:

I installed Nitrogen on her PC and did change the path to her wallpaper as well and I made the script executable as well. When I double click on the script, nothing happens. No wallpaper changing. Maybe I will run the script from the terminal and see what is going on and post back.

If you copied the script over from your computer, you might still be the owner of the file; use chown if necessary.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#7 2014-10-19 22:13:41

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Modifying my Wallpaper changer

Your code worked great on my laptop in Crunchbang, so the code does work but on my wife's PC, nothing happened.

nic@nicpc:~$ hsetroot -fill $(ls $HOME/Pictures/wallpaper/*.jpg|shuf -n1)
nic@nicpc:~$ 

I'll also check the ownership issue mentioned above. Good point.

Last edited by rmcellig (2014-10-19 22:28:33)


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#8 2014-10-19 22:24:23

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Modifying my Wallpaper changer

What is the output of the variable string?

ls $HOME/Pictures/wallpaper/*.jpg|shuf -n1

There are .jpg files in ~/Pictures/wallpaper/, right?

Offline

#9 2014-10-19 22:29:31

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Modifying my Wallpaper changer

They are all .jpg files.


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#10 2014-10-19 22:34:32

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Modifying my Wallpaper changer

Right, Linux Lite runs the XFCE Desktop Environment -- it is highly likely that whatever method XFCE uses to set the desktop background is over-riding nitrogen & hsetroot.
That's my theory, anyway...

Offline

#11 2014-10-20 00:38:22

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Modifying my Wallpaper changer

What version of Xfce is running? I think the current/newer Xfce is now like KDE where the DE sets the wallpaper on a layer above the destop - that command is probably working, but setting the wallpaper behind the Xfce set wallpaper.

Is there another window manager you can log in to and check?


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#12 2014-10-20 09:11:57

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: Modifying my Wallpaper changer

You can use xfconf to change the wallpaper that is set by xfdesktop. I don't know the exact commands, but this should get you going:
http://forum.xfce.org/viewtopic.php?id=8198


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#13 2014-10-20 10:08:49

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Modifying my Wallpaper changer

After a brief deliberation with my wife... I installed a screen changer app on her computer, AND she said if I wanted to, I could replace the distro she is using now with Crunchbang . All she does is surf the internet and play solitaire. I'm sure Crunchbang could handle that if need be wink

She knows that I love to try things out and play around with computers and distros, so, that's pretty cool.


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#14 2014-10-20 11:15:42

jeffreyC
#! Die Hard
Registered: 2010-09-02
Posts: 596

Re: Modifying my Wallpaper changer

Yes, Xfce sets its wallpaper above the root window.

I have thought about using a transparent .png as the Xfce wallpaper and another set by a different method on the root.
The idea being that it would allow a large conky and/or xplanetfx and a click-able desktop.


There's a reason you separate military and the police. One fights the enemies of the state, the other serves and protects the people. When the military becomes both, then the enemies of the state tend to become the people.

Offline

#15 2014-10-21 17:06:44

SallyK
Member
Registered: 2010-12-15
Posts: 11

Re: Modifying my Wallpaper changer

Sorry to butt in, but I'm pretty sure modern versions of XFCE come with the ability to automatically change the wallpaper from a specified list built in. Have you tried that and it doesn't work?

Offline

#16 2014-10-21 18:16:25

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Modifying my Wallpaper changer

The latest version does automatically change wallpaper. It works great. My wife has an older version of xfce, that I think I will update to the latest version. I just wanted to try a terminal non GUI solution instead.


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#17 2014-10-21 20:33:47

SallyK
Member
Registered: 2010-12-15
Posts: 11

Re: Modifying my Wallpaper changer

Sorry, I didn't mean to rain on your parade - it is great when you can get these more interesting ways to work. I just wondered if maybe you'd missed it, or tried it and it didn't work for some reason.

Offline

#18 2014-10-21 20:41:59

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Modifying my Wallpaper changer

SallyK,

You did not rain on my parade at all. You had a great point regarding the latest xfce. Coming from a Mac background, I am trying to find ways to get away from a GUI way of computing. It's my way to learn the terminal. It's challenging at times but wow is it ever fast and flexible and I would assume uses less use of the CPU than using the terminal.


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo