Skip to content

Commit

Permalink
zsh: Re-add sourcing of profile.d files
Browse files Browse the repository at this point in the history
Source profile.d files again to regain default settings now that they are POSIX compliant
  • Loading branch information
Tracey Clark authored and TraceyC77 committed Jan 3, 2025
1 parent 543e057 commit e435571
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 47 deletions.
11 changes: 11 additions & 0 deletions packages/z/zsh/files/skel/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source /usr/share/defaults/etc/zsh/zprofile

# User specific zsh scripts and functions
if [ -d ~/.zshrc.d ]; then
for rc in ~/.zshrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
unset rc
fi
54 changes: 10 additions & 44 deletions packages/z/zsh/files/zprofile
Original file line number Diff line number Diff line change
@@ -1,51 +1,17 @@
## DO NOT edit this file. Your changes will be overridden on package updates.
# Instead add your changes to a new profile script under /etc/profile.d/ (create this directory if it does not exist) for system wide use or
# ~/.zshrc.d for an individual user

# Begin /usr/share/defaults/etc/zprofile

if [ -f /etc/zprofile ]; then
source /etc/zprofile
elif [ -f /etc/zsh/zprofile ]; then
source /etc/zsh/zprofile
fi

# Source paths that may not be included by systemctl
if [ -f /usr/share/defaults/etc/profile.d/10-path.sh ]; then
emulate sh -c 'source /usr/share/defaults/etc/profile.d/10-path.sh'
fi

# Source paths not included by systemctl necessary for XDG_DATA_DIRS

if [ -f /usr/share/defaults/etc/profile.d/10-xdg.sh ]; then
emulate sh -c 'source /usr/share/defaults/etc/profile.d/10-xdg.sh'
fi

# Source paths not included by systemctl necessary for flatpaks to be found in the app menu and run

if [ -f /usr/share/defaults/etc/profile.d/70-flatpak.sh ]; then
emulate sh -c 'source /usr/share/defaults/etc/profile.d/70-flatpak.sh'
fi

# Source paths not included by systemctl necessary for snaps to be found in the app menu and run

if [ -f /usr/share/defaults/etc/profile.d/70-snapd.sh ]; then
emulate sh -c 'source /usr/share/defaults/etc/profile.d/70-snapd.sh'
fi

# Source gtk modules variable for menus

if [ -f /usr/share/defaults/etc/profile.d/appmenu-gtk2-module.sh ]; then
emulate sh -c 'source /usr/share/defaults/etc/profile.d/appmenu-gtk2-module.sh'
fi

# Paths for gawk

if [ -f /usr/share/defaults/etc/profile.d/gawk.sh ]; then
emulate sh -c 'source /usr/share/defaults/etc/profile.d/gawk.sh'
fi

# Environment for vte, zsh compatible

if [ -f /usr/share/defaults/etc/profile.d/vte.sh ]; then
source /usr/share/defaults/etc/profile.d/vte.sh
fi
# This should always be sourced regardless of the above files
# Warning: Do not remove the line below, otherwise it will break the integrity of other packages which provide some scripts in /etc/profile.d/.
emulate sh -c 'source /usr/share/defaults/etc/profile'

# Do not source /etc/profile as Arch does
# This will source all other bash scripts in /etc/profile.d, some of which may not load properly.
# Some may also conflict with zsh frameworks or have other unintended consequences
# Additionally, Solus sources ~/.bashrc.d from /etc/profile which is not obvious to the user or expected in zsh
# End /usr/share/defaults/etc/zprofile
2 changes: 1 addition & 1 deletion packages/z/zsh/package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name : zsh
version : '5.9'
release : 34
release : 35
source :
- https://sourceforge.net/projects/zsh/files/zsh/5.9/zsh-5.9.tar.xz : 9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5
homepage : https://www.zsh.org/
Expand Down
4 changes: 2 additions & 2 deletions packages/z/zsh/pspec_x86_64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1397,8 +1397,8 @@
</Files>
</Package>
<History>
<Update release="34">
<Date>2024-11-11</Date>
<Update release="35">
<Date>2024-11-12</Date>
<Version>5.9</Version>
<Comment>Packaging update</Comment>
<Name>Tracey Clark</Name>
Expand Down

0 comments on commit e435571

Please sign in to comment.