Adding a rotation

This commit is contained in:
Anonymus Raccoon
2020-04-25 18:59:50 +02:00
parent af8c200ac9
commit 76910f5e27
2 changed files with 29 additions and 1 deletions
+3 -1
View File
@@ -33,11 +33,13 @@ class Trick(ABC):
from tricks.glorify_goose import GlorifyGooseTrick
from tricks.anim_ascii import AnimAsciiTrick
from tricks.reflection import ReflectionTrick
from tricks.rotation import RotationTrick
tricks = [
LaughingGooseTrick,
GlorifyGooseTrick,
#AnimAsciiTrick,
ReflectionTrick
ReflectionTrick,
RotationTrick
]
return random.choice(tricks)()
+26
View File
@@ -0,0 +1,26 @@
import time
import os
from trick import Trick
class RotationTrick(Trick):
@property
def name(self):
return "Rotation"
@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') --rotation inverted")
time.sleep(5)
os.system("xrandr --output $(xrandr -q | grep ' connected' | cut -f 1 -d ' ' | cut -f 1 -d '\n') --rotation normal")