Skip to content

KDE Plasma package has been added to the script. #219

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ or
```
./build.sh -d xfce -b unstable
```
#### (Option) To build GhostBSD with __KDE Plasma 6__ as default desktop
```
./build.sh -d plasma -b unstable
```

## Burn an image to cd:
```
Expand Down
62 changes: 62 additions & 0 deletions desktop_config/plasma.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/sh

set -e -u

# Source common configuration scripts
. "${cwd}/common_config/autologin.sh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Undefined variable 'cwd' used for sourcing

Please define 'cwd' before using it, such as with cwd=$(dirname "$0"), or use an explicit path.

. "${cwd}/common_config/base-setting.sh"
. "${cwd}/common_config/finalize.sh"
. "${cwd}/common_config/setuser.sh"

sddm_setup() {
# Path to SDDM config
sddm_conf="${release}/etc/sddm.conf"

# Create or update SDDM configuration
if [ ! -f "${sddm_conf}" ]; then
cat <<EOF > "${sddm_conf}"
[Autologin]
User=${live_user}
Session=plasma

[Theme]
Current=breeze

[General]
Numlock=on
EOF
else
# Ensure required sections exist and update keys
grep -q "^\[Autologin\]" "${sddm_conf}" || echo "[Autologin]" >> "${sddm_conf}"
sed -i '' "s@^User=.*@User=${live_user}@" "${sddm_conf}" || echo "User=${live_user}" >> "${sddm_conf}"
sed -i '' "s@^Session=.*@Session=plasma@" "${sddm_conf}" || echo "Session=plasma" >> "${sddm_conf}"

grep -q "^\[Theme\]" "${sddm_conf}" || echo "[Theme]" >> "${sddm_conf}"
sed -i '' "s@^Current=.*@Current=breeze@" "${sddm_conf}" || echo "Current=breeze" >> "${sddm_conf}"

grep -q "^\[General\]" "${sddm_conf}" || echo "[General]" >> "${sddm_conf}"
sed -i '' "s@^Numlock=.*@Numlock=on@" "${sddm_conf}" || echo "Numlock=on" >> "${sddm_conf}"
fi
}

setup_xinit() {
# Disable screen locking in KDE Plasma for live_user
chroot "${release}" su "${live_user}" -c "
mkdir -p /home/${live_user}/.config
kwriteconfig5 --file /home/${live_user}/.config/kscreenlockerrc --group Daemon --key Autolock false
kwriteconfig5 --file /home/${live_user}/.config/kscreenlockerrc --group Daemon --key LockOnResume false
echo 'exec ck-launch-session startplasma-x11' >> /home/${live_user}/.xinitrc
"
Comment on lines +47 to +49
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Appending .xinitrc exec line without idempotency check

This can cause duplicate lines; check if the line exists before appending.

Suggested change
kwriteconfig5 --file /home/${live_user}/.config/kscreenlockerrc --group Daemon --key LockOnResume false
echo 'exec ck-launch-session startplasma-x11' >> /home/${live_user}/.xinitrc
"
kwriteconfig5 --file /home/${live_user}/.config/kscreenlockerrc --group Daemon --key LockOnResume false
grep -qxF 'exec ck-launch-session startplasma-x11' /home/${live_user}/.xinitrc || echo 'exec ck-launch-session startplasma-x11' >> /home/${live_user}/.xinitrc
"


# Set the same .xinitrc for root and skel
echo "exec ck-launch-session startplasma-x11" > "${release}/root/.xinitrc"
echo "exec ck-launch-session startplasma-x11" > "${release}/usr/share/skel/dot.xinitrc"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Skeleton file named 'dot.xinitrc' instead of '.xinitrc'

The file in the skel directory should be named '.xinitrc' (with a leading dot) to ensure it is correctly copied to new user home directories. 'dot.xinitrc' will not be recognized by default.

}

# Execute setup routines
patch_etc_files
community_setup_liveuser
community_setup_autologin
sddm_setup
setup_xinit
final_setup
10 changes: 10 additions & 0 deletions packages/plasma
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plasma6-plasma
sddm
firefox
dolphin
kate
ark
kcalc
kate
gwenview
okular
10 changes: 10 additions & 0 deletions packages/vital/plasma
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plasma6-plasma
sddm
firefox
dolphin
kate
kcalc
kate
gwenview
okular
ark