Update openruyi-desktop-setup-labwc.spec
This commit is contained in:
@@ -21,9 +21,9 @@ Requires: swaybg
|
||||
Requires: waybar
|
||||
|
||||
%description
|
||||
Preset labwc configuration files for the openruyi desktop user.
|
||||
Preset labwc configuration files for desktop users.
|
||||
This package installs defaults under /usr/share and deploys them to
|
||||
/home/openruyi/.config/labwc on installation if missing.
|
||||
all existing user homes under /home on installation if missing.
|
||||
|
||||
%prep
|
||||
|
||||
@@ -36,18 +36,25 @@ install -m 0644 %{SOURCE2} %{buildroot}%{_datadir}/openruyi-desktop-setup-labwc/
|
||||
install -m 0755 %{SOURCE3} %{buildroot}%{_datadir}/openruyi-desktop-setup-labwc/labwc/autostart
|
||||
|
||||
%post
|
||||
if id -u openruyi >/dev/null 2>&1; then
|
||||
install -d -m 0755 /home/openruyi/.config/labwc
|
||||
for homedir in /home/*; do
|
||||
[ -d "$homedir" ] || continue
|
||||
user="$(basename "$homedir")"
|
||||
id -u "$user" >/dev/null 2>&1 || continue
|
||||
|
||||
target="$homedir/.config/labwc"
|
||||
install -d -m 0755 "$target"
|
||||
|
||||
for f in rc.xml menu.xml autostart; do
|
||||
if [ ! -e /home/openruyi/.config/labwc/$f ]; then
|
||||
install -m 0644 %{_datadir}/openruyi-desktop-setup-labwc/labwc/$f /home/openruyi/.config/labwc/$f
|
||||
if [ "$f" = "autostart" ]; then
|
||||
chmod 0755 /home/openruyi/.config/labwc/$f
|
||||
fi
|
||||
fi
|
||||
[ -e "$target/$f" ] && continue
|
||||
|
||||
mode=0644
|
||||
[ "$f" = "autostart" ] && mode=0755
|
||||
install -m "$mode" "%{_datadir}/openruyi-desktop-setup-labwc/labwc/$f" "$target/$f"
|
||||
chown "$user:$user" "$target/$f"
|
||||
done
|
||||
chown -R openruyi:openruyi /home/openruyi/.config/labwc
|
||||
fi
|
||||
|
||||
chown "$user:$user" "$target"
|
||||
done
|
||||
|
||||
%files
|
||||
%{_datadir}/openruyi-desktop-setup-labwc/labwc/rc.xml
|
||||
|
||||
Reference in New Issue
Block a user