diff --git a/helpers/CMakeLists.txt b/helpers/CMakeLists.txt --- a/helpers/CMakeLists.txt +++ b/helpers/CMakeLists.txt @@ -1,2 +1,3 @@ +add_subdirectory(kconf_update) add_subdirectory(killer) add_subdirectory(xclipboardsync) diff --git a/helpers/kconf_update/CMakeLists.txt b/helpers/kconf_update/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/helpers/kconf_update/CMakeLists.txt @@ -0,0 +1,6 @@ +install(FILES kwin.upd + DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR} +) +install(PROGRAMS kwin-5.14-auto-bordersize.sh + DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR} +) diff --git a/helpers/kconf_update/kwin-5.14-auto-bordersize.sh b/helpers/kconf_update/kwin-5.14-auto-bordersize.sh new file mode 100644 --- /dev/null +++ b/helpers/kconf_update/kwin-5.14-auto-bordersize.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +KWINRC_PATH=`qtpaths --locate-file GenericConfigLocation kwinrc` + +if [ ! -f "$KWINRC_PATH" ]; then + exit +fi + +AUTOSIZE_LINE=$(echo "$a" | sed -n '/\[org.kde.kdecoration2\]/,/\[/!d;/BorderSizeAuto=/=' "$KWINRC_PATH") +if [ ! -z "$AUTOSIZE_LINE" ]; then + exit +fi + +ENTRY_LINE=$(echo "$a" | sed -n '/\[org.kde.kdecoration2\]/,/\[/!d;/BorderSize=/=' "$KWINRC_PATH") +if [ -z "$ENTRY_LINE" ]; then + exit +fi + +sed -in "${ENTRY_LINE}aBorderSizeAuto=false" "$KWINRC_PATH" diff --git a/helpers/kconf_update/kwin.upd b/helpers/kconf_update/kwin.upd new file mode 100644 --- /dev/null +++ b/helpers/kconf_update/kwin.upd @@ -0,0 +1,5 @@ +Version=5 + +# Deactivate auto border size if the user has changed border size in the past +Id=auto-bordersize +Script=kwin-5.14-auto-bordersize.sh,sh