From 59598c34df8430dc4c31925530bccaacc16a5944 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 21 Jul 2022 17:31:15 -0700 Subject: [PATCH] rc2nix: Block more state settings and theme settings --- script/rc2nix.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/script/rc2nix.rb b/script/rc2nix.rb index b7935ce..62fa680 100755 --- a/script/rc2nix.rb +++ b/script/rc2nix.rb @@ -80,13 +80,22 @@ module Rc2Nix KEY_BLOCK_LIST = [ /^activate widget \d+$/, # Depends on state :( /^ColorScheme(Hash)?$/, + /^History Items/, /^LookAndFeelPackage$/, - /^Theme$/, + /^Recent (Files|URLs)/, + /^Theme$/i, /^Version$/, /State$/, /Timestamp$/, ] + ############################################################################ + # List of functions that get called with a group name and a key + # name. If the function returns +true+ then block that key. + BLOCK_LIST_LAMBDA = [ + ->(group, key) { group == "org.kde.kdecoration2" && key == "library" } + ] + ############################################################################ attr_reader(:file_name, :settings) @@ -117,6 +126,7 @@ module Rc2Nix # Reasons to skip this group or key: next if GROUP_BLOCK_LIST.any? {|re| @last_group.match(re)} next if KEY_BLOCK_LIST.any? {|re| key.match(re)} + next if BLOCK_LIST_LAMBDA.any? {|fn| fn.call(@last_group, key)} next if File.basename(@file_name) == "plasmanotifyrc" && key == "Seen" @settings[@last_group] ||= {}