diff --git a/kconf_update/CMakeLists.txt b/kconf_update/CMakeLists.txt --- a/kconf_update/CMakeLists.txt +++ b/kconf_update/CMakeLists.txt @@ -1,2 +1,4 @@ install(FILES kwin.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) +install(PROGRAMS kwin-5.16-auto-bordersize.sh + DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) diff --git a/kconf_update/kwin-5.16-auto-bordersize.sh b/kconf_update/kwin-5.16-auto-bordersize.sh new file mode 100644 --- /dev/null +++ b/kconf_update/kwin-5.16-auto-bordersize.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +HAS_SIZE='' +HAS_AUTO='' + +while read -r line +do + # substring from beginning to equal sign + ENTRY="${line%%=*}" + if [ "$ENTRY" = "BorderSize" ]; then + HAS_SIZE=1 + fi + if [ "$ENTRY" = "BorderSizeAuto" ]; then + HAS_AUTO=1 + fi + echo "$line" +done + +if [ -n "$HAS_SIZE" -a -z "$HAS_AUTO" ]; then + # unset auto borders if user has set a border + # size in the past (for good measure make + # also sure auto borders are not yet set) + echo "BorderSizeAuto=false" +fi diff --git a/kconf_update/kwin.upd b/kconf_update/kwin.upd --- a/kconf_update/kwin.upd +++ b/kconf_update/kwin.upd @@ -25,3 +25,9 @@ File=kwinrc Group=Plugins Key=dimscreenEnabled,kwin4_effect_dimscreenEnabled + +# Deactivate auto border size if the user has changed border size in the past +Id=auto-bordersize +File=kwinrc +Group=org.kde.kdecoration2 +Script=kwin-5.16-auto-bordersize.sh,sh