Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Working with Terminals (autocleaning, ect)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Tue Aug 15, 2006 3:35 am    Post subject: Working with Terminals (autocleaning, ect) Reply with quote

Ok, so I've got a thing for clean (you couldn't tell it in alot of cases, but I do), and there are a few things I'd like to do.

A) Have terminal windows that are unused for x minutes run the clean command
B) Have a terminal run clean automatically when leaving su

The second is partly a security thing (every little bit helps), and the first is because I generally use transparent windows (unless I'm doing some work where I *really* need to see everything, then I use xterm, as opposed to aterm)

Ok, then I have another question dealing with automaticly starting term windows, in that when I start IceWM, I have it start 3 aterm windows, XMMS, xscreensaver, and conky. Well, this is all fine and good, but 2 of the 3 aterm windows are borderless, and are set up to fit around XMMS (one term next to XMMS that is the same height. Another below covering the rest of the screen), and when I startx, everything thats in workspace #1, and I was wondering if someone could help with any of this.

The first 2 are marginally more important, but the second would be handy.

For refrence:

Aterm (3): 2 borderless, 1 windowed
IceWM
XMMS
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Aug 15, 2006 3:58 am    Post subject: Re: Working with Terminals (autocleaning, ect) Reply with quote

Dralnu wrote:
Ok, so I've got a thing for clean (you couldn't tell it in alot of cases, but I do), and there are a few things I'd like to do.

A) Have terminal windows that are unused for x minutes run the clean command


Mmm, not sure, let me think a bit about this one. :P


Quote:

B) Have a terminal run clean automatically when leaving su


This could easly be done in a login terminal, but this is not the case. A login terminal or console always parse the ~/.bash_logout and the /etc/bash/bash_logout files (both if they exist). So, when you close a login bash, any command on those two files will be launched. Unfortunatelly, this is not possible in this situation.

You could define an alias like exit = "exit && clear". But I dont advice it. Exit is a common thing that a lot of scripts use and it could have some side effects that would need to be evaluated slowly.

Another way to do it (I think the best way) would be to alias bash = "bash --login", this way, every sesion of bash will be considered like a login one. And the above files will work. YOu can just edit /etc/bash/bash_logout, I think that that file even comes shipped with a #clear line, you just need to uncomment it. Beware that some -not so bright- scripts can use the condition of login shell to do or not certain things... So, this might have some side effects as well, but I dont think it will be something terrible. Still, I would test it before doing so in a serious machine globally. You can always put the alias only in your user home in ~/.bashrc and all should be fine.

Quote:
The second is partly a security thing (every little bit helps),


If security is a concern you should think of launching the the terms with sudo of with kdesu or anything similar, as root. Then, once you are done, close them. Note that clear will only scroll down the thing, but if you scroll up you will still see the previous output. Even if root is not logged in that term at the momment.

I cant help with icewm, sorry :P

Regards.
Back to top
View user's profile Send private message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Tue Aug 15, 2006 4:16 am    Post subject: Reply with quote

Thanks, I'll look over all that.

IceWM is a seriously under-rated WM. I like it, although I do have Fluxbox installed (been meaning to text it out), so there is no telling where I'll end up in a few weeks, lol.
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum