mostly t11 fixes
[distro-setup] / filesystem / etc / profile.d / environment.sh
index d5c7e57f13f1fa5230270124bd1009cdf4de441a..9e4feef6a732f8c93227d01794737e7f3f3a86a6 100644 (file)
@@ -10,7 +10,8 @@ if [ -f $HOME/path-add-function ]; then
   path-add --end /snap/bin
 
 
-  for p in $HOME/.gem/ruby/*/bin; do
+  # ~/.local is newer, eg ruby 3.0+
+  for p in $HOME/.gem/ruby/*/bin $HOME/.local/share/gem/ruby/*/bin; do
     path-add --ifexists --end $p
   done
 
@@ -115,6 +116,18 @@ for _file in $(pgrep -a '^ssh-agent$' | sed -r 's/.*-a *([^ ]+).*/\1/'); do
   fi
 done
 
+# in t11, user ssh-agent once again stopped working, it isn't started anymore
+# by i3. So, enough is enough, I just made a service that will try to
+# start it all the time for the user. If the var isn't set by the above,
+# just set them to the values I know are in the service.
+if ! test "$SSH_AUTH_SOCK"; then
+  if [ "$EUID" == 0 ]; then
+    export SSH_AUTH_SOCK=/run/openssh_agent
+  else
+    export SSH_AUTH_SOCK=/run/user/1000/openssh_agent
+  fi
+fi
+
 
 # background:
 # ubuntu has 002 for non-system users, debian has 022.  002 makes groups