Pokemon-Terminal/adapter/implementations/Tilix.py

24 lines
679 B
Python
Raw Normal View History

2017-06-21 12:49:16 +01:00
import os
from adapter.base import TerminalAdapterInterface
class Tilix(TerminalAdapterInterface):
setting_key = "com.gexperts.Tilix.Settings"
setting_field = "background-image"
@staticmethod
def is_available():
return "TILIX_ID" in os.environ
2017-06-21 12:49:16 +01:00
def set_pokemon(self, pokemon):
2017-06-21 14:39:13 +01:00
command = 'gsettings set {} {} "{}"'
2017-06-21 12:49:16 +01:00
os.system(command.format(self.setting_key,
self.setting_field,
pokemon.get_path()))
def clear(self):
2017-06-21 14:39:13 +01:00
command = 'gsettings set {} {}'
2017-06-21 12:49:16 +01:00
os.system(command.format(self.setting_key,
self.setting_field))