Article 5CWXQ Help me sed or awk this figity config file please!

Help me sed or awk this figity config file please!

by
arifd86
from LinuxQuestions.org on (#5CWXQ)
So if I want to programmatically add an app to the quicklaunch of lxqt-panel, they've made it somewhat frustratingly difficult to do so.

Among the config file is this relevant section
Code:[quicklaunch]
alignment=Left
apps\1\desktop=/usr/share/applications/pcmanfm-qt.desktop
apps\2\desktop=/usr/share/applications/pavucontrol-qt.desktop
apps\size=2
type=quicklaunchI want some sed or awk code that will find this line 'apps\size=' followed by an unkwnown number, which has to appear after a line containing '[quicklaunch]' but before any empty lines. the number must be incremented by 1 and stored into a variable so that we can then inject into the line above our desired .desktop file.

So that in this concrete example, the result will look like this:
Code:[quicklaunch]
alignment=Left
apps\1\desktop=/usr/share/applications/pcmanfm-qt.desktop
apps\2\desktop=/usr/share/applications/pavucontrol-qt.desktop
apps\3\desktop=/path/to/app.desktop
apps\size=3
type=quicklaunchThis is rather advanced awk manipulation for me, so I appreciate your help.

Thanks!latest?d=yIl2AUoC8zA latest?i=chLVSqzCcPk:7DU8vYlCvFk:F7zBnMy latest?i=chLVSqzCcPk:7DU8vYlCvFk:V_sGLiP latest?d=qj6IDK7rITs latest?i=chLVSqzCcPk:7DU8vYlCvFk:gIN9vFwchLVSqzCcPk
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments