Adding the image viewer
@@ -11,4 +11,4 @@ class CommandHelper:
|
||||
@staticmethod
|
||||
def run_async(cmd):
|
||||
with open(os.devnull, 'wb') as devnull:
|
||||
return subprocess.Popen(cmd.split(' '), stdout=devnull, stderr=subprocess.STDOUT)
|
||||
return subprocess.Popen(cmd.split(' '), stdout=devnull, stderr=subprocess.STDOUT)
|
||||
|
||||
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 2.0 MiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
@@ -94,4 +94,3 @@ class Term:
|
||||
if shutil.which(term) is not None:
|
||||
Term.terminal = term
|
||||
return term
|
||||
|
||||
|
||||
@@ -28,9 +28,11 @@ class Trick(ABC):
|
||||
|
||||
@staticmethod
|
||||
def get_random_trick():
|
||||
from Tricks.laughing_goose import LaughingGooseTrick
|
||||
from tricks.laughing_goose import LaughingGooseTrick
|
||||
from tricks.glorify_goose import GlorifyGooseTrick
|
||||
tricks = [
|
||||
LaughingGooseTrick
|
||||
LaughingGooseTrick,
|
||||
GlorifyGooseTrick
|
||||
]
|
||||
|
||||
return random.choice(tricks)()
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
import random
|
||||
|
||||
from command_helper import CommandHelper
|
||||
from trick import Trick
|
||||
|
||||
|
||||
class GlorifyGooseTrick(Trick):
|
||||
@property
|
||||
def name(self):
|
||||
return "Glorify goose"
|
||||
|
||||
@property
|
||||
def delay(self):
|
||||
return 5
|
||||
|
||||
@property
|
||||
def is_reversible(self):
|
||||
return False
|
||||
|
||||
def revert(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
images = os.listdir("data/glorify")
|
||||
CommandHelper.run_async(f"xdg-open data/glorify/{random.choice(images)}")
|
||||