diff --git a/tips/distrobox/kde/.kde_bashrc b/tips/distrobox/kde/.kde_bashrc new file mode 100644 index 0000000..1167121 --- /dev/null +++ b/tips/distrobox/kde/.kde_bashrc @@ -0,0 +1,24 @@ +# Required for kde-builder command +if [[ $PATH != *".local/bin"* ]]; then + export PATH="$HOME/.local/bin:$PATH" +fi + +# Workaround for NixOS +# ENVs have nix store references and made conflict during build or run of KDE Apps, Shells, Frameworks +alias new_shell="env -u PATH -u QML2_IMPORT_PATH -u QT_PLUGIN_PATH -u NIXPKGS_QT6_QML_IMPORT_PATH -u XDG_CONFIG_DIRS bash -l" + +alias build_plasma_mobile="kde-builder plasma-mobile plasma-settings plasma-desktop kactivitymanagerd" + +function run_mobile() { + source "$HOME/kde/build/plasma-mobile/prefix.sh" + + QT_QPA_PLATFORM=offscreen plasma-mobile-envmanager --apply-settings + + # Environment variables + export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + export QT_QUICK_CONTROLS_MOBILE=1 + export PLASMA_PLATFORM=phone:handheld + export QT_QUICK_CONTROLS_STYLE=org.kde.breeze + + QT_QPA_PLATFORM=wayland dbus-run-session kwin_wayland --xwayland "plasmashell -p org.kde.plasma.mobileshell" --width 360 --height 720 +} \ No newline at end of file diff --git a/tips/distrobox/kde/configure.sh b/tips/distrobox/kde/configure.sh index 9d3d952..abb0ae0 100755 --- a/tips/distrobox/kde/configure.sh +++ b/tips/distrobox/kde/configure.sh @@ -7,6 +7,13 @@ if [[ $PATH != *".local/bin"* ]]; then source ~/.bashrc fi +if [[ $PATH != *"alias new_shell"* ]]; then + echo "Append new_shell alias to PATH in ~/.bashrc" + echo 'alias new_shell="env -u PATH -u QML2_IMPORT_PATH -u QT_PLUGIN_PATH -u NIXPKGS_QT6_QML_IMPORT_PATH -u XDG_CONFIG_DIRS bash -l"' >> ~/.bashrc + echo "Reload shell" + source ~/.bashrc +fi + echo "Installing kde-builder" curl 'https://invent.kde.org/sdk/kde-builder/-/raw/master/scripts/initial_setup.sh?ref_type=heads' > ~/initial_setup.sh bash ~/initial_setup.sh && rm ~/initial_setup.sh @@ -15,6 +22,6 @@ echo "Run initial setup from kde-builder" kde-builder --initial-setup echo "Install missing dependencies" -sudo dnf install qt6-qttools-devel +sudo dnf install qt6-*-devel echo "Configuration DONE" \ No newline at end of file diff --git a/tips/distrobox/kde/use_distrobox.md b/tips/distrobox/kde/use_distrobox.md index 910cb5a..deda652 100644 --- a/tips/distrobox/kde/use_distrobox.md +++ b/tips/distrobox/kde/use_distrobox.md @@ -3,10 +3,12 @@ ## First configuration 1. `distrobox assemble` - > You can add --replace to recreate distrobox container + > You can add --replace to recreate distrobox container 2. `distrobox enter kdedev` 3. `bash configure.sh` 4. `kde-builder run solid` + > You use NixOS ? It's necessary to run `new_shell` alias before. + > The alias unset all nixos env variables with nix store references to avoid conflicts with build or run of KDE Shells/Apps/Tools. ## Usefull config in ~/.config/kdesrc-buildrc @@ -14,4 +16,4 @@ Autogenerate editor configuration - generate-clion-project-config - generate-vscode-project-config -- generate-qtcreator-project-config \ No newline at end of file +- generate-qtcreator-project-config