What does your desktop look like?
Moderators: b1o, jkerr82508
Re: What does your desktop look like?
It shouldn't since it only works for a split second every 30 second, in that interval it sleeps
CPU: i7 950 3.1 ghz |RAM: 12 GB DDR3 |Graphics: Nvidia Geforce gtx 280 |motherboard: Rampage II Extreme |OS: Arch + windows7
Just remember, there is no such thing as a stupid question, until you ask it
Just remember, there is no such thing as a stupid question, until you ask it
Re: What does your desktop look like?
Yup - you are right it has no negative impact there. And it sure is easier that the cron job stuff. I have set mine to 300 sec. (5 min). Finally I can enjoy all my lovely backgrounds in gnome too. Thanks to rvause and you.
I am going to wrap this up over in the tips and tricks section.
I am going to wrap this up over in the tips and tricks section.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"
"There are no stupid questions - Only stupid answers!"
Re: What does your desktop look like?
Also made one in java, dunno if it's any use posting the code here but i'll do it anyway
Main Class:
The main class is realy all you need if you do some slight changes, but i though a config file would be nice since it's not a scripting language which you can run interpreted.
Here's the code for reading a config file with 2 parameters:
And at last the config file:
Test it and see if it's faster, erhm more resourcefull i mean...
Main Class:
Code: Select all
import java.io.File;
import java.util.Random;
/**
* Program for linux to change your background image from a folder.
* @author b1o
*/
public class Main {
public static void main(String args[]) throws Exception {
ConfReader cr = new ConfReader();
while (true) {
File[] files = new File(cr.getPath()).listFiles();
Runtime.getRuntime().exec("gconftool-2 -s -t string /desktop/gnome/background/picture_filename "+files[new Random().nextInt(files.length)].getAbsolutePath());
Thread.currentThread().sleep(cr.getInterval()*1000);
}
}
}
The main class is realy all you need if you do some slight changes, but i though a config file would be nice since it's not a scripting language which you can run interpreted.
Here's the code for reading a config file with 2 parameters:
Code: Select all
import java.io.File;
import java.util.Scanner;
/**
* Reads the config file
* @author b1o
*/
public class ConfReader {
private File conf;
private Scanner sc;
private String output;
private File jarFile;
public ConfReader() {
try{
jarFile = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI());
}catch(Exception e){}
String[] temp = jarFile.getAbsolutePath().split("/");
String path = "";
for(int i = 0; i < temp.length-1; i++)
{
path = path + temp[i] + "/";
}
conf = new File(path+"/conf/conf.cfg");
output = "";
}
public String getPath() throws Exception{
sc = new Scanner(conf);
while (sc.hasNext()) {
output = sc.next().toLowerCase();
if (output.equals("wallpaper_folder")) {
sc.next();
output = sc.next();
break;
}
}
sc.close();
return output;
}
public int getInterval() throws Exception{
sc = new Scanner(conf);
while (sc.hasNext()) {
output = sc.next().toLowerCase();
if (output.equals("interval")) {
sc.next();
output = sc.next();
break;
}
}
sc.close();
return Integer.parseInt(output);
}
}
And at last the config file:
Code: Select all
Wallpaper_Folder = /folder/containing/wallpapers
interval = 30
Test it and see if it's faster, erhm more resourcefull i mean...
Last edited by b1o on 21 Jul 2010, 01:15, edited 1 time in total.
CPU: i7 950 3.1 ghz |RAM: 12 GB DDR3 |Graphics: Nvidia Geforce gtx 280 |motherboard: Rampage II Extreme |OS: Arch + windows7
Just remember, there is no such thing as a stupid question, until you ask it
Just remember, there is no such thing as a stupid question, until you ask it
Re: What does your desktop look like?
Posting code is brilliant and not only allowed it is mandatory How about a simple howto for us common magazine readers?
You take the code and do what?
You take the code and do what?
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"
"There are no stupid questions - Only stupid answers!"
Re: What does your desktop look like?
well you could make a project in netbeans, and create both javaclasses and copy/paste the code in there and hit compile. then go in to your dist folder in your netbeansproject folder and add a folder called conf, create a file called conf.cfg and paste config file code in there. you should be good to go. Or i can find a propper place to upload the program and share it there
although i would like to get some tray functions in to it first, since then you would be able to change path and interval at runtime instead of having to restart the program.
Edit: found a place to upload it, and here's the link http://hotfile.com/dl/56450584/8c2de72/DesktopChanger.tar.gz.html you might have to wait a minute before the download starts if you aren't members(which i guess you aren't)
although i would like to get some tray functions in to it first, since then you would be able to change path and interval at runtime instead of having to restart the program.
Edit: found a place to upload it, and here's the link http://hotfile.com/dl/56450584/8c2de72/DesktopChanger.tar.gz.html you might have to wait a minute before the download starts if you aren't members(which i guess you aren't)
Code: Select all
java -jar /path/to/program/wp.jar
Last edited by b1o on 21 Jul 2010, 01:18, edited 1 time in total.
CPU: i7 950 3.1 ghz |RAM: 12 GB DDR3 |Graphics: Nvidia Geforce gtx 280 |motherboard: Rampage II Extreme |OS: Arch + windows7
Just remember, there is no such thing as a stupid question, until you ask it
Just remember, there is no such thing as a stupid question, until you ask it
Re: What does your desktop look like?
The changing of wallpaper works!
BUT every second wallpaper is empty (only a totally green background here). Must be fixed. Also I do not see the need for a config folder. Why not put the puny two files in the same folder?
like this:
Edit
Hm after a few changes the changing works just fine. The error was only on the first three changes or so. Works fine now - any idea what it was
Could it be diferent image formats?
Resource vise it looks like the plugin conatiner is pulling more juice out of the CPU than the python script - not sure yet tho... still testing....
Edit:
No this does not pull any power of the CPU. and it mostly works fine, I have the occasional green background I cannot explain but it is not often.
BUT every second wallpaper is empty (only a totally green background here). Must be fixed. Also I do not see the need for a config folder. Why not put the puny two files in the same folder?
like this:
Code: Select all
conf = new File(path+"conf.cfg")
Edit
Hm after a few changes the changing works just fine. The error was only on the first three changes or so. Works fine now - any idea what it was
Could it be diferent image formats?
Resource vise it looks like the plugin conatiner is pulling more juice out of the CPU than the python script - not sure yet tho... still testing....
Edit:
No this does not pull any power of the CPU. and it mostly works fine, I have the occasional green background I cannot explain but it is not often.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"
"There are no stupid questions - Only stupid answers!"
Re: What does your desktop look like?
your fault with the naming.^^
CPU: i7 950 3.1 ghz |RAM: 12 GB DDR3 |Graphics: Nvidia Geforce gtx 280 |motherboard: Rampage II Extreme |OS: Arch + windows7
Just remember, there is no such thing as a stupid question, until you ask it
Just remember, there is no such thing as a stupid question, until you ask it
Re: What does your desktop look like?
Yeah having several wallpapers starting with the name "wallpaper-archlinux" did produce an empty background in both scripts. They both work perfectly well now that that is taken care of.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"
"There are no stupid questions - Only stupid answers!"
- dedanna1029
- Sound-Berserk
- Posts: 8780
- Joined: 14 Mar 2010, 20:29
- Contact:
Re: What does your desktop look like?
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html
Re: What does your desktop look like?
Yes -you like that one! I see you have replaced the start-here image. Why not put an Arch logo there?
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"
"There are no stupid questions - Only stupid answers!"
- dedanna1029
- Sound-Berserk
- Posts: 8780
- Joined: 14 Mar 2010, 20:29
- Contact:
Re: What does your desktop look like?
I didn't manually replace that. Came with gnome-colors.
I'm sorry, I'm not fond of distro logos. I'm just not.
I'm sorry, I'm not fond of distro logos. I'm just not.
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html
Re: What does your desktop look like?
hi folks, it's dedanna's fault i'm here. she suggested i join and jump in so here i be. i wanted to showoff my desktop to her. i hope you like it dedanna. this is mandriva 2010.0 gnome 2.28.0. i'm running dual monitors. total resolution = 3520x1200. wallpaper found on deviantart. i like this guy's flames. http://jbensch.deviantart.com/ i like kde3510 but had to switch to gnome. i just can't get used to kde4. it's all good though, i'm not gonna insult any linux project. i just prefer the way kde 3.5.10 worked. been running mandriva about five years now. it seems to work the best for me out of all the distros so i stick with it. i have seen just about all the other distros in virtual machines. i would like to try arch someday when i get time to delve into it. i have debian and mandriva spring kde4 on another couple of old machines for testing, etc. i've really got to make some time to learn arch as i know it's hot stuff
Code: Select all
$ cat /etc/issue
Mandriva Linux release 2010.0 (Official) for i586
Kernel 2.6.31.13-desktop-1mnb on an i686 / \l
Code: Select all
$ gnome-panel --version
GNOME gnome-panel 2.28.0
Code: Select all
$ xrandr
Screen 0: minimum 3520 x 1200, current 3520 x 1200, maximum 3520 x 1200
default connected 3520x1200+0+0 0mm x 0mm
3520x1200 50.0*