kwin/kconf_update/kwinrules-5.19-placement.pl
Ismael Asensio 61c6d58172 [kwinrules] Add kconf_update script to fix placement rule
Since the port to KConfigXT, the placement setting in `kwinrulesrc` now stores the enum value instead of a string equivalent.
The strings and enum values are taken from `placement.h/.cpp`

This was suggested by @zzag in https://phabricator.kde.org/D29790
2020-05-27 18:13:00 +00:00

22 lines
628 B
Perl

#! /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";
}