diff --git a/trick.py b/trick.py index d23e874..0f7e2ac 100644 --- a/trick.py +++ b/trick.py @@ -32,10 +32,12 @@ class Trick(ABC): from tricks.laughing_goose import LaughingGooseTrick from tricks.glorify_goose import GlorifyGooseTrick from tricks.anim_ascii import AnimAsciiTrick + from tricks.reflection import ReflectionTrick tricks = [ LaughingGooseTrick, GlorifyGooseTrick, - AnimAsciiTrick + #AnimAsciiTrick, + ReflectionTrick ] return random.choice(tricks)() diff --git a/tricks/reflection.py b/tricks/reflection.py new file mode 100644 index 0000000..1fe0c7b --- /dev/null +++ b/tricks/reflection.py @@ -0,0 +1,27 @@ +import time +import os + +from trick import Trick +from command_helper import CommandHelper + + +class ReflectionTrick(Trick): + @property + def name(self): + return "Reflection" + + @property + def delay(self): + return 5 + + @property + def is_reversible(self): + return False + + def revert(self): + pass + + def run(self): + os.system("xrandr --output $(xrandr -q | grep ' connected' | cut -f 1 -d ' ' | cut -f 1 -d '\n') --reflect x") + time.sleep(5) + os.system("xrandr --output $(xrandr -q | grep ' connected' | cut -f 1 -d ' ' | cut -f 1 -d '\n') --reflect normal")