Adding a reflection trick

This commit is contained in:
Anonymus Raccoon
2020-04-25 18:28:50 +02:00
parent 3ee763ca6f
commit 3183e3543e
2 changed files with 30 additions and 1 deletions
+3 -1
View File
@@ -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)()
+27
View File
@@ -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")