diff --git a/pyprland/plugins/scratchpads.py b/pyprland/plugins/scratchpads.py index 608bf88..fd2e1a3 100644 --- a/pyprland/plugins/scratchpads.py +++ b/pyprland/plugins/scratchpads.py @@ -290,8 +290,10 @@ class Extension(Plugin): if not item.isAlive(): print(f"{uid} is not running, restarting...") self.procs[uid].kill() - del self.scratches_by_pid[self.procs[uid].pid] - del self.scratches_by_address[item.address] + if item.pid in self.scratches_by_pid: + del self.scratches_by_pid[item.pid] + if item.address in self.scratches_by_address: + del self.scratches_by_address[item.address] self.start_scratch_command(uid) while uid in self._respawned_scratches: await asyncio.sleep(0.05) diff --git a/pyprland/plugins/workspaces_follow_focus.py b/pyprland/plugins/workspaces_follow_focus.py index 0a9e2b2..d9f840a 100644 --- a/pyprland/plugins/workspaces_follow_focus.py +++ b/pyprland/plugins/workspaces_follow_focus.py @@ -47,7 +47,7 @@ class Extension(Plugin): try: idx = available_workspaces.index(cur_workspace) except ValueError: - next_workspace = available_workspaces[0] + next_workspace = available_workspaces[0 if increment > 0 else -1] else: next_workspace = available_workspaces[ (idx + increment) % len(available_workspaces)