Pokemon-Terminal/pokemonterminal/adapter/implementations/Tilix.py

24 lines
708 B
Python
Raw Normal View History

2017-06-21 11:49:16 +00:00
import os
2017-07-12 23:03:59 +00:00
from pokemonterminal.adapter.base import TerminalAdapterInterface
2017-06-21 11:49:16 +00:00
class Tilix(TerminalAdapterInterface):
setting_key = "com.gexperts.Tilix.Settings"
setting_field = "background-image"
@staticmethod
def is_available():
return "TILIX_ID" in os.environ
def set_image_file_path(self, image_file_path):
2017-06-21 13:39:13 +00:00
command = 'gsettings set {} {} "{}"'
2017-06-21 11:49:16 +00:00
os.system(command.format(self.setting_key,
self.setting_field,
image_file_path))
2017-06-21 11:49:16 +00:00
def clear(self):
2017-06-21 13:39:13 +00:00
command = 'gsettings set {} {}'
2017-06-21 11:49:16 +00:00
os.system(command.format(self.setting_key,
self.setting_field))