On Fri, 2018-07-06 at 20:13 +0800, Ed Greshko wrote:
On 07/06/18 19:46, Patrick O'Callaghan wrote:
> I found a Python script (I think on Github, but I can't seem to locate
> the URL or the original author) that saves or restores the desktop
> location of each open Firefox window*. It does this by calling
> wmctrl(1) and storing/loading the location as a JSON data structure.
> The data structure is indexed by the window title, but Firefox changes
> the title based on the currently active tab in each window. Thus the
> saved data will depend on which tab happens to be active in each
> window.
>
> The script already works when called manually but I just want to
> automate the process when I log in or out of KDE.
>
> The Save script has to run *after* Plasma starts and all my windows are
> already created. According to the KDE manual, this seems to rule out
> Autostart.
Not really. I had a kvm guest where I needed to run xrandr and autostart didn't
work
for me. That is until I made the first line of the script "sleep 15".
Yes, the docs for Autostart say there's a bug which prevents it from
running scripts after Plasma has started (it's not clear whether that
also applies to programs - Autostart seems to treat them differently
for some reason). I don't even mind that part, it's the shutdown that's
more of a pain: if I forget to run the Save script then the Restore one
will sometimes fail.
Thanks anyway.
poc