Perl Hacking my Gnome Backgrounds

Dec 10, 2008 21:10

One of the other things I managed to do was to write a short Perl script that cycles my background under gnome to a random image from a folder, again something I thought beyond my ability. I find it ironic that I've used a lot of Perl to write simple system scripts, amongst them some installation and maintenance scripts for the Tsunami Beowulf ( Read more... )

linux, scripting

Leave a comment

pseudomonas December 10 2008, 23:54:34 UTC
invoke it in ~/.bash_profile, if you're using bash. otherwise your favourite shell will have a magic file equivalent.

Reply

aphenine December 11 2008, 15:07:33 UTC
Hmm, I'd thought of that, but didn't know a few things, so I didn't try it.

What I'm not sure about is when ~/bash_profile is run. Is it like ~/bashrc which runs with every shell invocation? Does it only run once for each instance of bash under my user? Does it run multiple times if I log in on different vts?

Reply

pseudomonas December 11 2008, 15:09:09 UTC
Um, not sure. It usually does what I want, I think. I know that's not terribly helpful. I like putting echo commands in these files so I can see what's starting when.

Reply

aphenine December 11 2008, 16:56:49 UTC
Ok, thanks for trying anyway. I found out that I could do it via GDM.

(In case you're interested: I added it to /etc/gdm/PostLogin as the Default script and that works so far. I had to add a line asking the username and also a chown at the end.)

Reply

pseudomonas December 11 2008, 16:58:48 UTC
Ah; I was assuming that the usual model was you wanted something to run when ssh-ing into a machine that you didn't necessarily have root access to.

Reply

aphenine December 11 2008, 19:52:46 UTC
Oh, ok. I suppose I could have been accessing the desktop remotely, but then, don't you think sticking graphic (and therefore network) intensive backgrounds plus a visually heavy desktop environment would have hinted strongly that I wasn't?

Reply

pplfichi December 13 2008, 13:52:04 UTC
.xinitrc (or if using a session manager .xsession) would be where I would put it. GDM should hopefully look at .xsession, so if you ever change session manager it should still work.

Reply

aphenine December 14 2008, 19:04:58 UTC
Hmm, it would be a lot better if I could get the script run from my own home directory. Do you know off the top of your head how you'd go about embedding/invoking the script from either of them?

Reply

pplfichi December 14 2008, 21:58:28 UTC
script.pl & (or however you call your script) at the end of .xsession? If the script isn't in your $PATH you'll need to provide it.

(This is the top of my head, it might not really work like this)

Reply


Leave a comment

Up