mirror of
https://github.com/zoriya/AnonymousGoose.git
synced 2026-05-29 20:44:55 +00:00
Adding a rotation
This commit is contained in:
@@ -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)()
|
||||
|
||||
@@ -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")
|
||||
Reference in New Issue
Block a user