nix-community / plasma-manager

Manage KDE Plasma with Home Manager
https://nix-community.github.io/plasma-manager/
MIT License
625 stars 73 forks source link

write_config.py key.split("[") ValueError: too many values to unpack (expected 2) #165

Closed I-Want-ToBelieve closed 5 months ago

I-Want-ToBelieve commented 5 months ago
× home-manager-i.want.to.believe.service - Home Manager environment for i.want.to.believe
     Loaded: loaded (/etc/systemd/system/home-manager-i.want.to.believe.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Thu 2024-05-09 16:57:40 CST; 63ms ago
    Process: 55979 ExecStart=/nix/store/l5kkmn3x65vq0vdiqk0w2k9irvi8fikh-hm-setup-env /nix/store/pqham57k40anijva65li87794srf36r9-home-manager-generation (code=exited, status=1/FAILURE)
   Main PID: 55979 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
        CPU: 947ms

May 09 16:57:40 nixos hm-activate-i.want.to.believe[56550]:   File "/nix/store/hs7xcf977s8c5qz6kswif6blbs658k0d-write_config.py", line 228, in read
May 09 16:57:40 nixos hm-activate-i.want.to.believe[56550]:     key, value = ConfigValue.parse_line(l)
May 09 16:57:40 nixos hm-activate-i.want.to.believe[56550]:                  ^^^^^^^^^^^^^^^^^^^^^^^^^
May 09 16:57:40 nixos hm-activate-i.want.to.believe[56550]:   File "/nix/store/hs7xcf977s8c5qz6kswif6blbs658k0d-write_config.py", line 92, in parse_line
May 09 16:57:40 nixos hm-activate-i.want.to.believe[56550]:     key, marking = key.split("[")
May 09 16:57:40 nixos hm-activate-i.want.to.believe[56550]:     ^^^^^^^^^^^^
May 09 16:57:40 nixos hm-activate-i.want.to.believe[56550]: ValueError: too many values to unpack (expected 2)
May 09 16:57:40 nixos systemd[1]: home-manager-i.want.to.believe.service: Main process exited, code=exited, status=1/FAILURE
May 09 16:57:40 nixos systemd[1]: home-manager-i.want.to.believe.service: Failed with result 'exit-code'.
May 09 16:57:40 nixos systemd[1]: Failed to start Home Manager environment for i.want.to.believe.
warning: error(s) occurred while switching to the new configuration
I-Want-ToBelieve commented 5 months ago

2024-05-14_17-58

The code generated by nix run github:pjones/plasma-manager | wl-copy has a lot of bugs. I deleted a lot of code under the configFile field and now it can be compiled successfully.

quentinmit commented 5 months ago

I think the error in your first screenshot might be unrelated to the arrays in your second screenshot.

The error in the first screenshot indicates it's failing to parse a config file that's already on your system (in particular, it looks like you somehow have a key in a KDE config file that contains more than one [ character). That's not supposed to be valid ([ is supposed to be escaped); do you think you could find the line in your on-disk config files that is failing to be parsed? If you're comfortable editing the source of write_config.py, you could have it print out the value of key right before that split line.

If it's plasma-manager that created the invalid config in the first place, we should definitely fix that generation, but I'm not too bothered by the failure to parse a seemingly invalid config file.

I-Want-ToBelieve commented 5 months ago

Yes, my screenshot is the code that I can build successfully after removing most of the code, the error is in the code that I removed,

Unresolved configurations should probably be better ignored and given a warning.

I was lazy and just used nix run github:pjones/plasma-manager | wl-copy and adopted the code it generated until I encountered this problem.

It doesn't matter, I will investigate the specific configuration items that caused this problem later. I did find a lot of wrong configuration items before and deleted them.

I-Want-ToBelieve commented 5 months ago

in ~/.config/dolphinrc

[General][$i]
Version[$i]=202
ViewPropsTimestamp[$i]=2023,3,21,20,12,27.81

[MainWindow][Toolbar mainToolBar]
IconSize=16
ToolButtonStyle=IconOnly

.config/plasmashellrc

[KFileDialog Settings]
Recent Files[$e]=bg1.png,file:$HOME/Downloads/bg1.png
Recent URLs[$e]=file:$HOME/Downloads/
detailViewIconSize=16

[PlasmaViews][Panel 1][Defaults]
offset=0
thickness=22

[PlasmaViews][Panel 1][Horizontal2560]
panelVisibility=0

[PlasmaViews][Panel 100]
alignment=132
floating=1
panelVisibility=2

.config/khotkeysrc

[$Version]
update_info=konsole_globalaccel.upd:konsole_globalaccel,spectacle_shortcuts.upd:spectacle-migrate-shortcuts

[ColorEffects:Disabled][$i]
ChangeSelectionColor[$di]
Color[$di]
ColorAmount[$di]
ColorEffect[$di]
ContrastAmount[$di]
ContrastEffect[$di]
Enable[$di]
IntensityAmount[$di]
IntensityEffect[$di]

[ColorEffects:Inactive][$i]
ChangeSelectionColor[$di]
Color[$di]
ColorAmount[$di]
ColorEffect[$di]
ContrastAmount[$di]
ContrastEffect[$di]
Enable[$di]
IntensityAmount[$di]
IntensityEffect[$di]

[Colors:Button][$i]
BackgroundAlternate[$di]
BackgroundNormal[$di]
DecorationFocus[$di]
DecorationHover[$di]
ForegroundActive[$di]
ForegroundInactive[$di]
ForegroundLink[$di]
ForegroundNegative[$di]
ForegroundNeutral[$di]
ForegroundNormal[$di]
ForegroundPositive[$di]
ForegroundVisited[$di]

[Colors:Complementary][$i]
BackgroundAlternate[$di]
BackgroundNormal[$di]
DecorationFocus[$di]
DecorationHover[$di]
ForegroundActive[$di]
ForegroundInactive[$di]
ForegroundLink[$di]
ForegroundNegative[$di]
ForegroundNeutral[$di]
ForegroundNormal[$di]
ForegroundPositive[$di]
ForegroundVisited[$di]

[Colors:Header]
BackgroundAlternate[$d]
BackgroundNormal[$d]
DecorationFocus[$d]
DecorationHover[$d]
ForegroundActive[$d]
ForegroundInactive[$d]
ForegroundLink[$d]
ForegroundNegative[$d]
ForegroundNeutral[$d]
ForegroundNormal[$d]
ForegroundPositive[$d]
ForegroundVisited[$d]

[Colors:Header][Inactive]
BackgroundAlternate[$d]
BackgroundNormal[$d]
DecorationFocus[$d]
DecorationHover[$d]
ForegroundActive[$d]
ForegroundInactive[$d]
ForegroundLink[$d]
ForegroundNegative[$d]
ForegroundNeutral[$d]
ForegroundNormal[$d]
ForegroundPositive[$d]
ForegroundVisited[$d]

[Colors:Selection][$i]
BackgroundAlternate[$di]
BackgroundNormal[$di]
DecorationFocus[$di]
DecorationHover[$di]
ForegroundActive[$di]
ForegroundInactive[$di]
ForegroundLink[$di]
ForegroundNegative[$di]
ForegroundNeutral[$di]
ForegroundNormal[$di]
ForegroundPositive[$di]
ForegroundVisited[$di]

[Colors:Tooltip][$i]
BackgroundAlternate[$di]
BackgroundNormal[$di]
DecorationFocus[$di]
DecorationHover[$di]
ForegroundActive[$di]
ForegroundInactive[$di]
ForegroundLink[$di]
ForegroundNegative[$di]
ForegroundNeutral[$di]
ForegroundNormal[$di]
ForegroundPositive[$di]
ForegroundVisited[$di]

[Colors:View][$i]
BackgroundAlternate[$di]
BackgroundNormal[$di]
DecorationFocus[$di]
DecorationHover[$di]
ForegroundActive[$di]
ForegroundInactive[$di]
ForegroundLink[$di]
ForegroundNegative[$di]
ForegroundNeutral[$di]
ForegroundNormal[$di]
ForegroundPositive[$di]
ForegroundVisited[$di]

[Colors:Window][$i]
BackgroundAlternate[$di]
BackgroundNormal[$di]
DecorationFocus[$di]
DecorationHover[$di]
ForegroundActive[$di]
ForegroundInactive[$di]
ForegroundLink[$di]
ForegroundNegative[$di]
ForegroundNeutral[$di]
ForegroundNormal[$di]
ForegroundPositive[$di]
ForegroundVisited[$di]

[Data_2_4Actions]
ActionsCount=1

[Data_2_4Actions0]
DestinationWindow=2
Input=Ctrl+F4
Type=KEYBOARD_INPUT

[Data_2_4Conditions]
Comment=
ConditionsCount=1

[Data_2_4Conditions0]
Type=ACTIVE_WINDOW

[Data_2_4Conditions0Window]
Comment=Qt Designer
WindowsCount=1

[DirSelect Dialog]
DirSelectDialog Size[$d]
History Items[$d]

[General][$i]
AccentColor[$di]
AccentColor\x5b$d\x5d[$i]=
AccentColorx5b$dx5d[$i]=
AllowKDEAppsToRememberWindowPositions[$di]
AllowKDEAppsToRememberWindowPositions\x5b$d\x5d[$i]=
AllowKDEAppsToRememberWindowPositionsx5b$dx5d[$i]=
BrowserApplication[$di]
BrowserApplication\x5b$d\x5d[$i]=
BrowserApplicationx5b$dx5d[$i]=
ColorScheme[$di]
ColorSchemeHash[$di]
ColorSchemeHash\x5b$d\x5d[$i]=
ColorSchemeHashx5b$dx5d[$i]=
ColorScheme\x5b$d\x5d[$i]=
ColorSchemex5b$dx5d[$i]=
LastUsedCustomAccentColor[$di]
LastUsedCustomAccentColor\x5b$d\x5d[$i]=
LastUsedCustomAccentColorx5b$dx5d[$i]=
XftHintStyle[$di]
XftSubPixel[$di]
accentColorFromWallpaper[$di]
font[$di]
toolBarFont[$di]

[General.$i]
AccentColor[$d]
AccentColorx5b$dx5d[$i]=
AllowKDEAppsToRememberWindowPositions[$d]
AllowKDEAppsToRememberWindowPositionsx5b$dx5d[$i]=
BrowserApplication[$d]
BrowserApplicationx5b$dx5d[$i]=
ColorScheme[$d]
ColorSchemeHash[$d]
ColorSchemeHashx5b$dx5d[$i]=
ColorSchemex5b$dx5d[$i]=
LastUsedCustomAccentColor[$d]
LastUsedCustomAccentColorx5b$dx5d[$i]=
XftHintStyle[$d]
XftSubPixel[$d]
accentColorFromWallpaper[$d]
font[$d]

[Gestures]
Disabled=true
MouseButton=2
Timeout=300

[GesturesExclude]
Comment=
WindowsCount=0

[Icons]
Theme[$d]

[KDE]
LookAndFeelPackage[$d]
ScrollbarLeftClickNavigatesByPage[$d]
ShowDeleteCommand[$d]
SingleClick[$d]
widgetStyle[$d]

[KFileDialog Settings]
Allow Expansion[$d]
Automatically select filename extension[$d]
Breadcrumb Navigation[$d]
Decoration position[$d]
LocationCombo Completionmode[$d]
PathCombo Completionmode[$d]
Show Bookmarks[$d]
Show Full Path[$d]
Show Inline Previews[$d]
Show Preview[$d]
Show Speedbar[$d]
Show hidden files[$d]
Sort by[$d]
Sort directories first[$d]
Sort hidden files last[$d]
Sort reversed[$d]
Speedbar Width[$d]
View Style[$d]

[KScreen]
ScreenScaleFactors[$d]
XwaylandClientsScale[$d]

[Main]
AlreadyImported=defaults,kde32b1,konqueror_gestures_kde321
Disabled=false
Version=2

[PreviewSettings]
MaximumRemoteSize[$d]

[Shortcuts]
GotoLine[$d]
Reload[$d]
SubstringCompletion[$d]

[Voice]
Shortcut=

[WM][$i]
activeBackground[$di]
activeBackground\x5b$d\x5d[$i]=
activeBackgroundx5b$dx5d[$i]=
activeBlend[$di]
activeBlend\x5b$d\x5d[$i]=
activeBlendx5b$dx5d[$i]=
activeForeground[$di]
activeForeground\x5b$d\x5d[$i]=
activeForegroundx5b$dx5d[$i]=
frame[$di]
frame\x5b$d\x5d[$i]=
framex5b$dx5d[$i]=
inactiveBackground[$di]
inactiveBackground\x5b$d\x5d[$i]=
inactiveBackgroundx5b$dx5d[$i]=
inactiveBlend[$di]
inactiveBlend\x5b$d\x5d[$i]=
inactiveBlendx5b$dx5d[$i]=
inactiveForeground[$di]
inactiveForeground\x5b$d\x5d[$i]=
inactiveForegroundx5b$dx5d[$i]=
inactiveFrame[$di]
inactiveFrame\x5b$d\x5d[$i]=
inactiveFramex5b$dx5d[$i]=

[WM.$i]
activeBackground[$d]
activeBackgroundx5b$dx5d[$i]=
activeBlend[$d]
activeBlendx5b$dx5d[$i]=
activeForeground[$d]
activeForegroundx5b$dx5d[$i]=
frame[$d]
framex5b$dx5d[$i]=
inactiveBackground[$d]
inactiveBackgroundx5b$dx5d[$i]=
inactiveBlend[$d]
inactiveBlendx5b$dx5d[$i]=
inactiveForeground[$d]
inactiveForegroundx5b$dx5d[$i]=
inactiveFrame[$d]
inactiveFramex5b$dx5d[$i]=
I-Want-ToBelieve commented 5 months ago

I found that ~/.config/kcminputrc is causing this issue

[$Version]
update_info=kcminputrc_fix_botched_5_21_0.upd:kcminputrc_fix_botched_5_21_0_pre,kcminputrc_fix_botched_5_21_0.upd:kcminputrc_fix_botched_5_21_0,kcminputrc_repeat.upd:kcminputrc_migrate_key_repeat,delete_cursor_old_default_size.upd:DeleteCursorOldDefaultSize

[Libinput][1133][16500][Logitech G304]
PointerAccelerationProfile=1

[Libinput][1133][16519][Logitech G903 LS]
PointerAccelerationProfile=1

[Libinput][1739][52856][06CB0001:00 06CB:CE78 Touchpad]
NaturalScroll=true
PointerAccelerationProfile=1
ScrollFactor=0.75
TapToClick=true

[Libinput][9011][26214][ydotoold virtual device]
PointerAccelerationProfile=1

[Libinput.1133.16500.Logitech G304]
PointerAccelerationProfile=1

[Libinput.1133.16519.Logitech G903 LS]
AnnePro2 Mouse=
AnnePro2 Mousex5d=
PointerAccelerationProfile=1
AnnePro2 Mouse]=
[Libinput.1241.41619.OBINS OBINS=

[Libinput.9011.26214.ydotoold virtual device]
AnnePro2 Mouse=
AnnePro2 Mousex5d=
PointerAccelerationProfile=1
AnnePro2 Mouse]=
[Libinput.1241.41619.OBINS OBINS=

[Mouse]
AnnePro2 Mouse=
AnnePro2 Mousex5d=
PointerAccelerationProfile=1
X11LibInputXAccelProfileFlat=false
XLbInptAccelProfileFlat=true
cursorTheme=Future-dark-cursors
AnnePro2 Mouse]=
[Libinput][1241][41619][OBINS OBINS=