This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Installing & activating kwin-script via commandline

Tags: None
(comma "," separated)
Caldazar
Registered Member
Posts
1
Karma
0
I recently got a request for my PKGBUILD of Workflow to also install its kwin-script together with the Plasmoid.
Trying to do so, I ran into a couple of problems, I wasn't able to solve yet.

First of all the relevant section of my script, installing and then activating the kwin-script:
Code: Select all
echo $(plasmapkg --type kwinscript -i kwin-script-workflow-${pkgver}.kwinscript)
cp $HOME/.kde4/share/config/kwinrc $HOME/.kde4/share/config/kwinrc~
sed -i "s/workflowEnabled=false/\workflowEnabled=true/" $HOME/.kde4/share/config/kwinrc


!. Installing
Installing via plasmapkg works quite well except that the workflow-script doesn't occur in the install/uninstall list, just in the list of installed scripts.

Is there anything wrong with my plasmapkg command or is this an actual bug?

2. Activating
To edit the config file with 'sed' was the only way I could come up with, though I doubt that that's the correct way to do it.
Isn't there a more appropriate method?
However, the real problem with that is that it doesn't work reliably. I had the whole range of possible outcome with one and the same commands.

  • a) Not checked in the script list but active and working
  • b) Checked but not activated / working (manually unchecking and again checking helped here)
  • c) Working as intended
Neither relogin nor reboot changed any of that.

Any ideas how to fix and optimize my small script?
luebking
Karma
0
Code: Select all
plasmapackage -t kwinscript -i kwin-script-workflow-${pkgver}.kwinscript


Uninstall won't work, you installed as root, ie. to system - a user lacks the permissions to remove that (plus i'm not sure whether that works aside GHNS at all)

You might have to -u ("upgrade") rather than -i in order to override present installations

instead of "sed" use "kwriteconfig":
Code: Select all
kwriteconfig --file kwinrc --group Plugins --key workflowEnabled true


afterwards run
Code: Select all
qdbus org.kde.kwin /KWin reconfigure


to activate the script for even the running session.

NOTICE!!!
------------
This is UNLIKELY gonna work with the PKGBUID, because that will usually run as root.
You'd have to determine the "wanted" user (usually the one that holds the current X11 session, if there's any) and su into him, then see to have DISPLAY and DBUS_SESSION_BUS_ADDRESS exported properly.

IOW,
scripted activation by the user from eg. konsole: NICE
scripted activation by package installation: CAN OF WORMS


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar