Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update live_user in desktop scripts #200

Merged
merged 6 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,14 @@ boot()
cp LICENSE ${cd_root}/LICENSE
cp -R boot/ ${cd_root}/boot/
mkdir ${cd_root}/etc
cd "${cwd}" && zpool export ghostbsd && while zpool status ghostbsd >/dev/null; do :; done 2>/dev/null

# Try to unmount dev and release if mounted
umount ${release}/dev >/dev/null 2>/dev/null || true
umount ${release} >/dev/null 2>/dev/null || true

# Export ZFS pool and ensure it's clean
zpool export ghostbsd
while zpool status ghostbsd >/dev/null; do :; done 2>/dev/null
ericbsd marked this conversation as resolved.
Show resolved Hide resolved
}

image()
Expand Down
30 changes: 15 additions & 15 deletions common_config/autologin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ set -e -u
ghostbsd_setup_autologin()
{
{
echo "# ${liveuser} user autologin"
echo "${liveuser}:\\"
echo ":al=${liveuser}:ht:np:sp#115200:"
echo "# ${live_user} user autologin"
echo "${live_user}:\\"
echo ":al=${live_user}:ht:np:sp#115200:"
} >> "${release}/etc/gettytab"
sed -i "" "/ttyv0/s/Pc/${liveuser}/g" "${release}/etc/ttys"
mkdir -p "${release}/home/${liveuser}/.config/fish"
sed -i "" "/ttyv0/s/Pc/${live_user}/g" "${release}/etc/ttys"
mkdir -p "${release}/home/${live_user}/.config/fish"
printf "set tty (tty)
if test \$tty = \"/dev/ttyv0\"
sudo xconfig auto
Expand All @@ -21,8 +21,8 @@ ghostbsd_setup_autologin()
sleep 1
startx
end
" > "${release}/home/${liveuser}/.config/fish/config.fish"
chmod 765 "${release}/home/${liveuser}/.config/fish/config.fish"
" > "${release}/home/${live_user}/.config/fish/config.fish"
chmod 765 "${release}/home/${live_user}/.config/fish/config.fish"

# setup root
mkdir -p "${release}/root/.config/fish"
Expand All @@ -37,12 +37,12 @@ ghostbsd_setup_autologin()
community_setup_autologin()
{
{
echo "# ${liveuser} user autologin"
echo "${liveuser}:\\"
echo ":al=${liveuser}:ht:np:sp#115200:"
echo "# ${live_user} user autologin"
echo "${live_user}:\\"
echo ":al=${live_user}:ht:np:sp#115200:"
} >> "${release}/etc/gettytab"
sed -i "" "/ttyv0/s/Pc/${liveuser}/g" "${release}/etc/ttys"
mkdir -p "${release}/home/${liveuser}/.config/fish"
sed -i "" "/ttyv0/s/Pc/${live_user}/g" "${release}/etc/ttys"
mkdir -p "${release}/home/${live_user}/.config/fish"
if [ -f "${release}/usr/local/bin/xconfig" ] ; then
printf "if not test -f /tmp/.xstarted
touch /tmp/.xstarted
Expand All @@ -57,7 +57,7 @@ community_setup_autologin()
startx
end
end
" > "${release}/home/${liveuser}/.config/fish/config.fish"
chmod 765 "${release}/home/${liveuser}/.config/fish/config.fish"
" > "${release}/home/${live_user}/.config/fish/config.fish"
chmod 765 "${release}/home/${live_user}/.config/fish/config.fish"
fi
}
}
26 changes: 13 additions & 13 deletions common_config/setuser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ set -e -u
set_user()
{
chroot "${release}" pw usermod -s /usr/local/bin/fish -n root
chroot "${release}" pw useradd "${liveuser}" \
-c "GhostBSD Live User" -d "/home/${liveuser}" \
chroot "${release}" pw useradd "${live_user}" \
-c "GhostBSD Live User" -d "/home/${live_user}" \
-g wheel -G operator -m -s /usr/local/bin/fish -k /usr/share/skel -w none
}

ghostbsd_setup_liveuser()
{
set_user
chroot "${release}" su "${liveuser}" -c "mkdir -p /home/${liveuser}/.config/gtk-3.0"
chroot "${release}" su "${liveuser}" -c "echo '[Settings]' >> /home/${liveuser}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${liveuser}" -c "echo 'gtk-application-prefer-dark-theme = false' >> /home/${liveuser}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${liveuser}" -c "echo 'gtk-theme-name = Vimix' >> /home/${liveuser}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${liveuser}" -c "echo 'gtk-icon-theme-name = Vivacious-Colors-Dark' >> /home/${liveuser}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${liveuser}" -c "echo 'gtk-font-name = Droid Sans Bold 12' >> /home/${liveuser}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${live_user}" -c "mkdir -p /home/${live_user}/.config/gtk-3.0"
chroot "${release}" su "${live_user}" -c "echo '[Settings]' >> /home/${live_user}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${live_user}" -c "echo 'gtk-application-prefer-dark-theme = false' >> /home/${live_user}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${live_user}" -c "echo 'gtk-theme-name = Vimix' >> /home/${live_user}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${live_user}" -c "echo 'gtk-icon-theme-name = Vivacious-Colors-Dark' >> /home/${live_user}/.config/gtk-3.0/settings.ini"
chroot "${release}" su "${live_user}" -c "echo 'gtk-font-name = Droid Sans Bold 12' >> /home/${live_user}/.config/gtk-3.0/settings.ini"
mkdir -p "${release}/root/.config/gtk-3.0"
{
echo '[Settings]'
Expand All @@ -32,11 +32,11 @@ ghostbsd_setup_liveuser()
community_setup_liveuser()
{
set_user
chroot "${release}" su "${liveuser}" -c "mkdir -p /home/${liveuser}/Desktop"
chroot "${release}" su "${live_user}" -c "mkdir -p /home/${live_user}/Desktop"

if [ -e "${release}/usr/local/share/applications/gbi.desktop" ] ; then
chroot "${release}" su "${liveuser}" -c "cp -af /usr/local/share/applications/gbi.desktop /home/${liveuser}/Desktop"
chroot "${release}" su "${liveuser}" -c "chmod +x /home/${liveuser}/Desktop/gbi.desktop"
sed -i '' -e 's/NoDisplay=true/NoDisplay=false/g' "${release}/home/${liveuser}/Desktop/gbi.desktop"
chroot "${release}" su "${live_user}" -c "cp -af /usr/local/share/applications/gbi.desktop /home/${live_user}/Desktop"
chroot "${release}" su "${live_user}" -c "chmod +x /home/${live_user}/Desktop/gbi.desktop"
sed -i '' -e 's/NoDisplay=true/NoDisplay=false/g' "${release}/home/${live_user}/Desktop/gbi.desktop"
fi
}
}
12 changes: 6 additions & 6 deletions desktop_config/mate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ lightdm_setup()

setup_xinit()
{
chroot "${release}" su "${liveuser}" -c "echo 'gsettings set org.mate.SettingsDaemon.plugins.housekeeping active true &' > /home/${liveuser}/.xinitrc"
chroot "${release}" su "${liveuser}" -c "echo 'gsettings set org.mate.screensaver lock-enabled false &' >> /home/${liveuser}/.xinitrc"
chroot "${release}" su "${liveuser}" -c "echo 'gsettings set org.mate.lockdown disable-lock-screen true &' >> /home/${liveuser}/.xinitrc"
chroot "${release}" su "${liveuser}" -c "echo 'gsettings set org.mate.lockdown disable-user-switching true &' >> /home/${liveuser}/.xinitrc"
chroot "${release}" su "${liveuser}" -c "echo 'exec ck-launch-session mate-session' >> /home/${liveuser}/.xinitrc"
chroot "${release}" su "${live_user}" -c "echo 'gsettings set org.mate.SettingsDaemon.plugins.housekeeping active true &' > /home/${live_user}/.xinitrc"
chroot "${release}" su "${live_user}" -c "echo 'gsettings set org.mate.screensaver lock-enabled false &' >> /home/${live_user}/.xinitrc"
chroot "${release}" su "${live_user}" -c "echo 'gsettings set org.mate.lockdown disable-lock-screen true &' >> /home/${live_user}/.xinitrc"
chroot "${release}" su "${live_user}" -c "echo 'gsettings set org.mate.lockdown disable-user-switching true &' >> /home/${live_user}/.xinitrc"
chroot "${release}" su "${live_user}" -c "echo 'exec ck-launch-session mate-session' >> /home/${live_user}/.xinitrc"
echo "exec ck-launch-session mate-session" > "${release}/root/.xinitrc"
echo "exec ck-launch-session mate-session" > "${release}/usr/share/skel/dot.xinitrc"
}
Expand All @@ -29,4 +29,4 @@ community_setup_liveuser
community_setup_autologin
lightdm_setup
setup_xinit
final_setup
final_setup
8 changes: 4 additions & 4 deletions desktop_config/mate_oem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ lightdm_setup()

setup_xinit()
{
echo "exec marco &" > "${release}/home/${liveuser}/.xinitrc"
echo "exec feh --bg-fill /usr/local/share/backgrounds/ghostbsd/Lake_View.jpg &" >> "${release}/home/${liveuser}/.xinitrc"
echo "exec sudo install-station" >> "${release}/home/${liveuser}/.xinitrc"
chmod 765 "${release}/home/${liveuser}/.xinitrc"
echo "exec marco &" > "${release}/home/${live_user}/.xinitrc"
echo "exec feh --bg-fill /usr/local/share/backgrounds/ghostbsd/Lake_View.jpg &" >> "${release}/home/${live_user}/.xinitrc"
echo "exec sudo install-station" >> "${release}/home/${live_user}/.xinitrc"
chmod 765 "${release}/home/${live_user}/.xinitrc"
ericbsd marked this conversation as resolved.
Show resolved Hide resolved
ericbsd marked this conversation as resolved.
Show resolved Hide resolved
# root
echo "exec marco &" > "${release}/root/.xinitrc"
echo "exec feh --bg-fill /usr/local/share/backgrounds/ghostbsd/Lake_View.jpg &" >> "${release}/root/.xinitrc"
Expand Down
2 changes: 1 addition & 1 deletion desktop_config/xfce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ lightdm_setup()

setup_xinit()
{
chroot "${release}" su "${liveuser}" -c "echo 'exec ck-launch-session startxfce4' > /home/${liveuser}/.xinitrc"
chroot "${release}" su "${live_user}" -c "echo 'exec ck-launch-session startxfce4' > /home/${live_user}/.xinitrc"
echo "exec ck-launch-session startxfce4" > "${release}/root/.xinitrc"
echo "exec ck-launch-session startxfce4" > "${release}/root/.xinitrc"
echo "exec ck-launch-session startxfce4" > "${release}/usr/share/skel/dot.xinitrc"
Expand Down
Loading