Wednesday, May 8, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 4152  / 2 Years ago, tue, april 19, 2022, 2:38:00

My shell is zsh and OS is Ubuntu 13.04



I need to add directory to $PATH to make it work in following places:




  • In graphical environment(Unity) (such as startup applications, gmrun program that runs by shortcut (it's basically as "Run command" on alt+f2)

  • In terminal in Unity

  • In terminal on Ctrl + Alt + F1



I've added it in .profile and it works for first two points, but not the last. I know I may add it to .zshrc but In this case it will be wrote in tow places (violates DRY) and in the case of terminal inside unity it'll be two times in $PATH (I don't think it's very bad but it's at least not pretty)



If I add it only to .zshrc it works only for second and third cases(obviously)



What can I do?


More From » unity

 Answers
3

This answer is basically based on Eliah Kagan's one and contains what I really did.



I've added to ~/.pam_environment



PATH DEFAULT=${PATH}:/home/riad/scripts


But at least on my PC it was not parsed on tty1 (Ctrl+Alt+F1) login but was parsed on graphical login. (Even locale settings that are created by unity wasn't work in non-graphical login)



The reason is that there was following line in pam configuration file for lightdm (/etc/pam.d/lightdm) :



session required        pam_env.so readenv=1 user_readenv=1 envfile=/etc/default/locale


I've added same line to /etc/pam.d/login between



@include common-session


and



@include common-password


Be careful! Bad .pam_environment file may broke your login.


[#30143] Tuesday, April 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
antoccasiona

Total Points: 430
Total Questions: 127
Total Answers: 131

Location: Netherlands
Member since Sat, Jun 26, 2021
3 Years ago
antoccasiona questions
Sat, Oct 23, 21, 22:34, 3 Years ago
Sat, Sep 24, 22, 09:39, 2 Years ago
Sun, Jan 15, 23, 11:08, 1 Year ago
;