Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What Happens
I write this line to copy an image to my local home dir

cp .cache/wallpaper/0_4_1280* .image.jpg

and all is well ....so I think it would be great if terminal would do this on start. So I decide to put the line in the box to run custom command instead of shell ....

and of course no matter how i alter the line Terminal will not stat the dir and complains that dir/file doesnt exist when we know it does. If i put ls -a in the box it shows the .cache folder but will not go into it.

Screen of err

I'm starting to think I'm going about this all wrong . So now that I've shown what I'm after, what I tried and what happens this is ....

What I want to Happen

When I click to launch terminal I would like it to execute this command and then restart at the regular prompt.

What i think i need to do is write some short bash script that will detach gnome terminal and then execute the copy command and then restart or reattach the terminal window.

One more thing that might be an issue , (might be the one thing that is holding this all up , i dunno) is that the star is there in the copy command because the file changes (it is in the .cache folder) so the first part is always the same but the rest of the filename changes as it rotates in the .cache. Which is why i want to constantly copy the new image to a known filename, because it changes..... and i need to reference it.

Its seems so easy ....yet I cant make it go ...I don't get it

share|improve this question
add comment

1 Answer 1

One way to accomplish this is to edit your .bashrc file.

Step-by-step:

  • Run gedit ~/.bashrc. This will open up the bash configuration file, which gets run every time you open a terminal.

  • At the bottom of the file, add this:

    # Copy wallpaper to .image.jpg in the home folder.
    cp ~/.cache/wallpaper/0_4_1280* ~/.image.jpg
    
share|improve this answer
    
that is soooo awesome can i make the terminal restart right after that ......its like its an image behind –  dewb Apr 26 '12 at 12:54
    
since that seemed like a no brainer for u ... which it really should be if you know what your doing.... i was wondering if you could help me take a right click command from a background app and integrate it into my overall shell right click menu .... basically im running wallach and its in the unity dock and i can right click it and change paper .....is their a way to integrate this to my reg dsktp right click menu so i can keep the rotating function without seeing or having the app docked to bar....dude if u know how to do that it would....just be awesome –  dewb Apr 26 '12 at 13:26
    
@dewb: Try nautilus-actions -- it's in the Ubuntu repositories and has a GUI to edit context menus. –  Ben Pringle Apr 26 '12 at 21:20
    
yeah i have that installed ....i havent had success using it ....im obviously new to this whole thing ....i'll just have to read up on using the tool ....thanx for the help ....same wallpaper in terminal and on desktop ...if i figure the right click thing I will right a guide for wallach ....anyone know what the file is for the right click menu is ... –  dewb Apr 27 '12 at 0:53
    
its easier to just writes scripts and put them in the scripts folder .... this tool is more trouble than its worth .....just thought to throw that out there –  dewb Apr 29 '12 at 1:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.