Rename a program systemwide - how?

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
jsfarinet
Posts: 305
Joined: 23. Nov 2014, 07:32

Rename a program systemwide - how?

Post 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
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Rename a program systemwide - how?

Post 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.
User avatar
jsfarinet
Posts: 305
Joined: 23. Nov 2014, 07:32

Re: Rename a program systemwide - how?

Post by jsfarinet »

Yep, that's it. Thanks. (As for the update: I think any application update will overwrite /usr/share/applications/<prgrname> ... (?)
DidierSpaier
Posts: 539
Joined: 20. Jun 2016, 20:15

Re: Rename a program systemwide - how?

Post 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
User avatar
laprjns
Salix Warrior
Posts: 1113
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: Rename a program systemwide - how?

Post 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"
“The past was erased, the erasure was forgotten, the lie became the truth.”
― George Orwell, 1984
User avatar
laprjns
Salix Warrior
Posts: 1113
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: Rename a program systemwide - how?

Post 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
“The past was erased, the erasure was forgotten, the lie became the truth.”
― George Orwell, 1984
User avatar
jsfarinet
Posts: 305
Joined: 23. Nov 2014, 07:32

Re: Rename a program systemwide - how?

Post 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 ' ' ?
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Rename a program systemwide - how?

Post 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"
User avatar
jsfarinet
Posts: 305
Joined: 23. Nov 2014, 07:32

Re: Rename a program systemwide - how?

Post by jsfarinet »

Btw, what' s the call in your bashrc to pull in the statements in .bash_aliases?
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Rename a program systemwide - how?

Post 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.
Post Reply