Drop old kconf update scripts

master
Vlad Zahorodnii 2 years ago
parent 5b6b2a2219
commit b93e01a724

@ -427,7 +427,6 @@ if (KF6DocTools_FOUND)
endif()
add_subdirectory(data)
add_subdirectory(kconf_update)
add_subdirectory(src)
if (BUILD_TESTING)

@ -1,31 +0,0 @@
install(FILES kwin.upd
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.16-auto-bordersize.sh
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.18-move-animspeed.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.21-desktop-grid-click-behavior.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.21-no-swap-encourage.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.23-disable-translucency-effect.sh
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.23-remove-flip-switch.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.23-remove-cover-switch.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.23-remove-cubeslide.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.23-remove-xrender-backend.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.27-replace-cascaded-zerocornered.sh
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(FILES kwinrules.upd
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwinrules-5.19-placement.pl
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwinrules-5.23-virtual-desktop-ids.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-5.25-effect-pluginid-config-group.py
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})

@ -1,24 +0,0 @@
#!/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

@ -1,14 +0,0 @@
#!/usr/bin/env python3
import fileinput
speed_map = [0, 0.25, 0.5, 1, 2, 4, 20]
for line in fileinput.input():
if not line.startswith("AnimationSpeed="):
continue
speed = int(line[len("AnimationSpeed="):])
if speed < 0 or speed >= len(speed_map):
continue
print("AnimationDurationFactor=%f" % speed_map[speed])
print("# DELETE AnimationSpeed") #special kconf syntax to remove the old key

@ -1,16 +0,0 @@
#!/usr/bin/env python3
import sys
VALUE_MAP = {
'true': 0,
'false': 1,
}
if __name__ == '__main__':
for line in sys.stdin:
line = line.strip()
if line.startswith('PresentWindows='):
_, value = line.split('=', 1)
print("# DELETE PresentWindows")
print("ClickBehavior=%d" % VALUE_MAP[value])

@ -1,11 +0,0 @@
#!/usr/bin/env python3
import fileinput
for line in fileinput.input():
if not line.startswith("GLPreferBufferSwap="):
continue
value = line[len("GLPreferBufferSwap="):].strip()
if value != "n":
continue
print("# DELETE GLPreferBufferSwap") # will use the default swap strategy

@ -1,23 +0,0 @@
#!/bin/sh
HAS_ENABLED_KEY=''
HAS_CUSTOM_CONFIG=''
kwinrcname=`qtpaths --locate-file GenericConfigLocation kwinrc`
if [ -f "$kwinrcname" ]; then
if grep -q "\[Effect-kwin4_effect_translucency\]" "$kwinrcname"; then
HAS_CUSTOM_CONFIG=1
fi
fi
while read -r line; do
KEY="${line%=*}"
if [ "$KEY" = "kwin4_effect_translucencyEnabled" ]; then
HAS_ENABLED_KEY=1
fi
echo "$line"
done
if [ -n "$HAS_CUSTOM_CONFIG" ] && [ -z "$HAS_ENABLED_KEY" ]; then
echo "kwin4_effect_translucencyEnabled=true"
fi

@ -1,11 +0,0 @@
#!/usr/bin/env python3
import fileinput
for line in fileinput.input():
if not line.startswith("LayoutName="):
continue
value = line[len("LayoutName="):].strip()
if value != "coverswitch":
continue
print("# DELETE LayoutName") # will use the default layout

@ -1,11 +0,0 @@
#!/usr/bin/env python3
import fileinput
for line in fileinput.input():
if not line.startswith("cubeslideEnabled="):
continue
value = line[len("cubeslideEnabled="):].strip()
if value == "true":
print("# DELETE cubeslideEnabled")
print("# DELETE slideEnabled") # make slide effect enabled, it's off now

@ -1,11 +0,0 @@
#!/usr/bin/env python3
import fileinput
for line in fileinput.input():
if not line.startswith("LayoutName="):
continue
value = line[len("LayoutName="):].strip()
if value != "flipswitch":
continue
print("# DELETE LayoutName") # will use the default layout

@ -1,11 +0,0 @@
#!/usr/bin/env python3
import fileinput
for line in fileinput.input():
if not line.startswith("Backend="):
continue
value = line[len("Backend="):].strip()
if value != "XRender":
continue
print("# DELETE Backend") # will use the default compositing type

@ -1,35 +0,0 @@
#!/usr/bin/env python3
import fileinput
def migrate_group(old, new, line):
if not "[Effect-{}".format(old) in line:
return
print("# DELETE Effect-{}".format(old))
print("[Effect-{}]\n".format(new))
for line in fileinput.input():
if not "[Effect-" in line:
print(line)
continue
migrate_group("Blur", "blur", line)
migrate_group("DesktopGrid", "desktopgrid", line)
migrate_group("DimInactive", "diminactive", line)
migrate_group("FallApart", "fallapart", line)
migrate_group("Glide", "glide", line)
migrate_group("Kscreen", "kscreen", line)
migrate_group("LookingGlass", "lookingglass", line)
migrate_group("MagicLamp", "magiclamp", line)
migrate_group("Magnifier", "magnifier", line)
migrate_group("MouseClick", "mouseclick", line)
migrate_group("MouseMark", "mousemark", line)
migrate_group("Overview", "overview", line)
migrate_group("PresentWindows", "presentwindows", line)
migrate_group("Sheet", "sheet", line)
migrate_group("ShowFps", "showfps", line)
migrate_group("Slide", "slide", line)
migrate_group("SlidingPopups", "slidingpopups", line)
migrate_group("ThumbnailAside", "thumbnailaside", line)
migrate_group("TrackMouse", "trackmouse", line)
migrate_group("Wobbly", "wobblywindows", line)
migrate_group("Zoom", "zoom", line)

@ -1,16 +0,0 @@
#!/bin/sh
# KWin - the KDE window manager
# This file is part of the KDE project.
# SPDX-FileCopyrightText: 2022 Natalie Clarius <natalie_clarius@yahoo.de>
# SPDX-License-Identifier: GPL-2.0-or-later
while read -r line; do
if [ "$line" = "Placement=Cascaded" ]; then
echo "Placement=ZeroCornered"
else
echo "$line"
fi
done

@ -1,105 +0,0 @@
Version=5
# Replace old Scale in effect with Scale effect.
Id=replace-scalein-with-scale
File=kwinrc
Group=Plugins
Key=kwin4_effect_scaleinEnabled,scaleEnabled
# Port the Minimize Animation effect to JavaScript.
Id=port-minimizeanimation-effect-to-js
File=kwinrc
Group=Plugins
Key=minimizeanimationEnabled,kwin4_effect_squashEnabled
# Port the Scale effect to JavaScript.
Id=port-scale-effect-to-js
File=kwinrc
Group=Effect-Scale,Effect-kwin4_effect_scale
AllKeys
Group=Plugins
Key=scaleEnabled,kwin4_effect_scaleEnabled
# Port the Dim Screen effect to JavaScript.
Id=port-dimscreen-effect-to-js
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
# Move AnimationSpeed to kdeglobals as AnimationDurationFactor converting to a useful value
Id=animation-speed
File=kwinrc,kdeglobals
Group=Compositing,KDE
Script=kwin-5.18-move-animspeed.py,python3
# In the Desktop Grid effect, replace the PresentWindows boolean with an enum
Id=desktop-grid-click-behavior
File=kwinrc
Group=Effect-DesktopGrid
Script=kwin-5.21-desktop-grid-click-behavior.py,python3
# Remove GLPreferBufferSwap if it has a value of "n"
Id=no-swap-encourage
File=kwinrc
Group=Compositing
Script=kwin-5.21-no-swap-encourage.py,python3
# Make the Translucency effect disabled by default
Id=make-translucency-effect-disabled-by-default
File=kwinrc
Group=Plugins
Script=kwin-5.23-disable-translucency-effect.sh,sh
# Remove the Flip Switch effect
Id=remove-flip-switch-effect
File=kwinrc
Group=TabBox,TabBoxAlternative
Script=kwin-5.23-remove-flip-switch.py,python3
# Remove the Cover Switch effect
Id=remove-cover-switch-effect
File=kwinrc
Group=TabBox,TabBoxAlternative
Script=kwin-5.23-remove-cover-switch.py,python3
# Remove the Desktop Cube Animation effect
Id=remove-cubeslide-effect
File=kwinrc
Group=Plugins
Script=kwin-5.23-remove-cubeslide.py,python3
# Remove Backend if it has a value of "XRender"
Id=remove-xrender-backend
File=kwinrc
Group=Compositing
Script=kwin-5.23-remove-xrender-backend.py,python3
# Enable the Scale effect by default.
Id=enable-scale-effect-by-default
File=kwinrc
Group=Plugins
Key=kwin4_effect_fadeEnabled,kwin4_effect_scaleEnabled
# Overview config group based upon plugin id
Id=overview-group-plugin-id
File=kwinrc
Options=AllGroups
Script=kwin-5.25-effect-pluginid-config-group.py,python3
# Tidy up after a bug from the animation speed movement
Id=animation-speed-cleanup
File=kwinrc
Group=KDE
RemoveKey=AnimationDurationFactor
# Replace the cascaded placement policy by zero-cornered
Id=replace-cascaded-zerocornered
File=kwinrc
Group=Windows
Script=kwin-5.27-replace-cascaded-zerocornered.sh,sh

@ -1,22 +0,0 @@
#! /usr/bin/perl
# Convert strings as in `Placement::policyToString()` from `placement.cpp`
# to correponding values of enum `Placement::Policy` defined in `placement.h`
use strict;
while (<>)
{
chomp;
s/placement=NoPlacement/placement=0/;
s/placement=Default/placement=1/;
s/placement=Random/placement=3/;
s/placement=Smart/placement=4/;
s/placement=Cascade/placement=5/;
s/placement=Centered/placement=6/;
s/placement=ZeroCornered/placement=7/;
s/placement=UnderMouse/placement=8/;
s/placement=OnMainWindow/placement=9/;
s/placement=Maximizing/placement=10/;
print "$_\n";
}

@ -1,47 +0,0 @@
#!/usr/bin/env python3
import fileinput
import configparser
import os.path
import subprocess
# Get the config standard locations
config_locations = subprocess.check_output(['qtpaths', '--paths', 'ConfigLocation']).decode('utf-8').strip().split(':')
config_paths = [os.path.join(folder, 'kwinrc') for folder in config_locations]
# Get the desktops information from `kwinrc` config file
kwinrc = configparser.ConfigParser(strict=False, allow_no_value=True)
kwinrc.read(config_paths)
num_desktops = int(kwinrc.get('Desktops', 'Number', fallback=''))
# Generete the map from x11ids (ennumeration) to UUIDs
desktopUUIDs = { -1: "" } # NET::OnAllDesktops -> Empty string
for i in range(1, num_desktops + 1):
uuid = kwinrc.get('Desktops', f'Id_{i}', fallback='')
desktopUUIDs[i] = str(uuid)
# Apply the conversion to `kwinrulesrc`
for line in fileinput.input():
# Rename key `desktoprule` to `desktopsrule`
if line.startswith("desktoprule="):
value = line[len("desktoprule="):].strip()
print("desktopsrule=" + value)
print("# DELETE desktoprule")
continue
if not line.startswith("desktop="):
print(line.strip())
continue
# Convert key `desktop` (x11id) to `desktops` (list of UUIDs)
try:
value = line[len("desktop="):].strip()
x11id = int(value)
uuid = desktopUUIDs[x11id]
except:
print(line.strip()) # If there is some error, print back the line
continue
print("desktops=" + uuid)
print("# DELETE desktop")

@ -1,11 +0,0 @@
Version=5
# Replace `placement` string policy to its enum value equivalent
Id=replace-placement-string-to-enum
File=kwinrulesrc
Script=kwinrules-5.19-placement.pl,perl
# Replace the `desktop` x11id number to `desktops` list of desktop UUIDs
Id=use-virtual-desktop-ids
File=kwinrulesrc
Script=kwinrules-5.23-virtual-desktop-ids.py,python3
Loading…
Cancel
Save