Page 1 of 1

Rename a program systemwide - how?

Posted: 18. Nov 2016, 14:14
by jsfarinet
I'd like to send claw-mails *ALWAYS* through a proxy (by

Code: Select all

proxychains4 claws-mail
Now, how could that be done, systemwide (and upgrade proof)? I could change the lines in /usr/share/applications or $HOME/.local/ but that would be overwritten after any upgrade i presume ... (?) What i think of is something like a systemwide "equation" claws-mail = proxychains4 claws-mail. Does there exist such option?

TIA

Re: Rename a program systemwide - how?

Posted: 18. Nov 2016, 14:32
by mimosa
Salix is not a rolling release distribution, so you probably needn't worry about anything like that getting clobbered. As to how to do it, I'm not sure, but if you find you can't do it in the sort of way you indicate, there's nothing to stop you writing a little script and getting whatever menu item points to claws-mail to call that instead. The script could go in /usr/local/bin, which is on your $PATH.

Re: Rename a program systemwide - how?

Posted: 18. Nov 2016, 15:02
by jsfarinet
Yep, that's it. Thanks. (As for the update: I think any application update will overwrite /usr/share/applications/<prgrname> ... (?)

Re: Rename a program systemwide - how?

Posted: 18. Nov 2016, 15:47
by DidierSpaier
jsfarinet wrote:As for the update: I think any application update will overwrite /usr/share/applications/<prgrname> ... (?)
Yes. You can copy /usr/share/applications/claws-mail.desktop to ~/.local/share/applications and modify the Exec entry, but this will work only for one user and if you start the application from the menu. If you want to have that for each user that you will create afterwards you will need to copy the edited file to /etc/skel/.local/share/applications instead.

But as mimosa pointed out, Salix is not a rolling release, so that could be an overkill

Re: Rename a program systemwide - how?

Posted: 18. Nov 2016, 22:38
by laprjns
Not sure that it satifies your "system wide' requirment but you could use an alias in your users .bashrc file

Code: Select all

alias claws="proxychains4 claws-mail"

Re: Rename a program systemwide - how?

Posted: 18. Nov 2016, 23:15
by laprjns
You can create a new desktop file in /usr/share/application. Just copy the existing claw-mail.desktop file, rename it to something like proxy-claws-mail.desktop and edit the new file to change the Exec line to "proxychains4 claws-mail %u" It should look like this:

Code: Select all

Exec=proxychains4 claws-mail %u
Also change the Name line to something like this:

Code: Select all

Name=Proxy Claws Mail

Re: Rename a program systemwide - how?

Posted: 19. Nov 2016, 10:15
by jsfarinet
@laprjns Thanks a lot for your advice! Ithink a can use both ... ;)

PS. In the alias statement for .bashrc, i think the original call for claws mail is 'claws-mail' and not 'claws'. So, should i simply right it or put it between ' ' ?

Re: Rename a program systemwide - how?

Posted: 19. Nov 2016, 10:43
by mimosa
It makes sense to use a different name, so you can still call the application in its vanilla form. But I think it works not to do so, for instance, I have

Code: Select all

mimosa[~]$ cat .bash_aliases
alias ls="ls --color"

Re: Rename a program systemwide - how?

Posted: 20. Nov 2016, 21:03
by jsfarinet
Btw, what' s the call in your bashrc to pull in the statements in .bash_aliases?

Re: Rename a program systemwide - how?

Posted: 21. Nov 2016, 08:15
by mimosa

Code: Select all

mimosa[~]$ cat .bashrc
export PS1='\u[\W]\$ '
export PAGER=/usr/bin/most
export EDITOR=/usr/bin/vim

if [ -f ~/.bash_aliases ]; then
        . ~/.bash_aliases
fi
I think this is the default .bashrc. But you can add those directly to .bashrc if you like, the effect is the same. This way is just tidier if you have a lot of customisations.