https://community.kde.org/api.php?action=feedcontributions&user=Xvello&feedformat=atomKDE Community Wiki - User contributions [en]2024-03-28T20:52:56ZUser contributionsMediaWiki 1.40.2https://community.kde.org/index.php?title=Guidelines_and_HOWTOs/Build_from_source/Test_plasma&diff=80051Guidelines and HOWTOs/Build from source/Test plasma2018-05-05T07:54:40Z<p>Xvello: add other startx invocation method</p>
<hr />
<div>= Prepare the testing environment =<br />
Save the following script as /opt/kde/runPlasma5.sh<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
[ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
DISTRO=`source /etc/os-release 2>/dev/null; echo $ID_LIKE`<br />
<br />
export KF5=/opt/kde/install<br />
export QTDIR=/opt/qt5 # Change if you have your own qt build<br />
<br />
export PATH=$KF5/bin:$QTDIR/bin:$PATH<br />
<br />
export QT_PLUGIN_PATH=$KF5/lib/plugins:$KF5/lib64/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH<br />
#On some distros, this is $KF5/lib64/qml:$QTDIR/qml or something similar. After the installation, choose the directory/directories which contains the "qt/qml" folder.<br />
export QML2_IMPORT_PATH=$KF5/lib/qml:$QTDIR/qml<br />
<br />
#Fixes for Debian's "look at me, I'm so important" setups<br />
if [ $DISTRO == "debian" ] <br />
then<br />
export QT_PLUGIN_PATH=$KF5/lib/`uname -m`-linux-gnu/plugins:$QTDIR/plugins<br />
export QML2_IMPORT_PATH=$KF5/lib/`uname -m`-linux-gnu/qml:$QTDIR/qml<br />
fi<br />
<br />
export QML_IMPORT_PATH=$QML2_IMPORT_PATH<br />
<br />
export XDG_DATA_DIRS=$KF5/share:/usr/share<br />
export XDG_CONFIG_DIRS=$KF5/etc/xdg:/etc/xdg<br />
<br />
# Uncomment to change default home paths<br />
#export XDG_DATA_HOME=$HOME/.kde5/local<br />
#export XDG_CONFIG_HOME=$HOME/.kde5/config<br />
#export XDG_CACHE_HOME=$HOME/.kde5/cache<br />
<br />
exec startkde<br />
</syntaxhighlight><br />
<br />
For what works on Debian Sid alongside with packaged KF5 nicely see:<br />
[https://wiki.debian.org/KdeBuildingFromSource Using (parts of) self-built KF 5, Plasma 5 and/or KDE Applications on Debian]<br />
<br />
= Configure dbus =<br />
Because we installed Plasma 5 to a custom path, we need to make dbus aware of these new locations.<br />
<br />
Create a file /etc/dbus-1/session-local.conf with the following contents:<br />
<pre><br />
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"<br />
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><br />
<busconfig><br />
<servicedir>/opt/kde/install/share/dbus-1/services</servicedir><br />
</busconfig><br />
</pre><br />
<br />
Create another file /etc/dbus-1/system-local.conf with the following contents:<br />
<pre><br />
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"<br />
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><br />
<busconfig><br />
<servicedir>/opt/kde/install/share/dbus-1/system-services</servicedir><br />
<includedir>/opt/kde/install/etc/dbus-1/system.d</includedir><br />
</busconfig><br />
</pre><br />
<br />
Because dbus will load all these new paths each time you login, you should rename these files (to eg system-local.conf.bk and session-local.conf.bk) before starting your default Plasma 4 or other distro sessions.<br />
<br />
= Running Plasma =<br />
Finally, there are several ways of running Plasma 5. Choose the one which suits you best.<br />
<br />
== Using a login manager==<br />
The recommended login manager is SDDM. But this method should work with any login manager.<br />
<syntaxhighlight lang="bash"><br />
sudo cp /opt/kde/runPlasma5.sh /usr/share/xsessions<br />
sudo chmod +x /usr/share/xsessions/runPlasma5.sh<br />
sudo cp /opt/kde/install/share/xsessions/plasma.desktop /usr/share/xsessions/plasmaGit.desktop<br />
</syntaxhighlight><br />
Edit /usr/share/xsessions/plasmaGit.desktop and change the paths as:<br />
<pre><br />
Exec=/usr/share/xsessions/runPlasma5.sh<br />
TryExec=/usr/share/xsessions/runPlasma5.sh<br />
Name=Plasma Git<br />
</pre><br />
After this logout of your current session, select Plasma Git in the options and login. You should now have the last Plasma 5 running.<br />
<br />
== Using ~/.config/plasma-workspace/env ==<br />
This is what I found works on Debian Sid nicely. Put the script which sets up the environment into ~/.config/plasma-workspace/env, chmod +x it and be done. Aside from the "Using a login manager" approach probably – I didn´t test it –, this is the only thing that worked on Debian. Additionally to that it does not need any changes to system wide configuration files. This directory replaced ~/.kde/env from KDE SC 4 and older times.<br />
<br />
Specifically none of the put it into some user wide or system wide shell profile files worked. Also putting it at start of /usr/bin/startkde worked, as environment still got reset to the default.<br />
<br />
== From the command line ==<br />
- Edit your xinitrc file :<br />
<syntaxhighlight lang="bash"><br />
mv ~/.xinitrc ~/.xinitrc.bk # Backup any existing xinitrc file<br />
ln -s /opt/kde/runPlasma5.sh ~/.xinitrc<br />
</syntaxhighlight><br />
Log out of your current session, login to a tty (eg tty2 by pressing <code>Ctrl+Alt+F2</code>) and run <code>startx</code>. This should read your ~/.xinitrc and log you into a Plasma 5 desktop.<br />
<br />
- Instead of editing your xinitrc, you can simply override it by running <code>startx /opt/kde/runPlasma5.sh</code>.</div>Xvello