summaryrefslogtreecommitdiffstats
path: root/esheep.py
diff options
context:
space:
mode:
Diffstat (limited to 'esheep.py')
-rw-r--r--esheep.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/esheep.py b/esheep.py
index 190c4fd..1ec71a7 100644
--- a/esheep.py
+++ b/esheep.py
@@ -727,6 +727,12 @@ class SheepOverlay:
self.cairo_surface = self._pil_to_cairo(self.sprite)
self.dark_surface = self._make_dark_surface(self.sprite)
+
+ # Patch fall-hard (10) to occasionally boing on landing — 20% chance
+ hard = self.anim_defs.get(10)
+ if hard:
+ hard.seq_nexts = [NextRef(probability=20, only='', anim_id=8),
+ NextRef(probability=80, only='', anim_id=1)]
self.wayfire = WayfireWindows()
self.sheep_list: List[Sheep] = []
self.ufos: List[UFO] = []
@@ -1113,13 +1119,32 @@ class SheepOverlay:
# ─────────────────────── entry point ───────────────────────
def main():
- import argparse
+ import argparse, signal, subprocess
p = argparse.ArgumentParser(description='eSheep for Wayland')
p.add_argument('--xml', default=os.path.join(os.path.dirname(__file__), 'animations.xml'),
help='Path to animations.xml')
p.add_argument('--count', type=int, default=1, help='Number of sheep')
+ p.add_argument('--exit', action='store_true',
+ help='Kill any running eSheep instances and quit')
args = p.parse_args()
+ if args.exit:
+ my_pid = os.getpid()
+ result = subprocess.run(['pgrep', '-f', 'esheep.py'],
+ capture_output=True, text=True)
+ pids = [int(p) for p in result.stdout.split()
+ if p.strip() and int(p.strip()) != my_pid]
+ if pids:
+ for pid in pids:
+ try:
+ os.kill(pid, signal.SIGTERM)
+ except ProcessLookupError:
+ pass
+ print(f"Stopped {len(pids)} eSheep process(es).")
+ else:
+ print("No running eSheep found.")
+ sys.exit(0)
+
if not os.path.exists(args.xml):
print(f"animations.xml not found: {args.xml}", file=sys.stderr)
sys.exit(1)