You are not logged in.
Pages: 1
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
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
Offline
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
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
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
Last edited by Head_on_a_Stick (2014-10-19 21:17:20)
Offline
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
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
What is the output of the variable string?
ls $HOME/Pictures/wallpaper/*.jpg|shuf -n1
There are .jpg files in ~/Pictures/wallpaper/, right?
Offline
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
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
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
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
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
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
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
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
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
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
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
Pages: 1
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