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"
|
|
|
|
|
2017-06-21 16:30:28 +00:00
|
|
|
@staticmethod
|
|
|
|
def is_available():
|
|
|
|
return "TILIX_ID" in os.environ
|
|
|
|
|
2017-07-03 14:48:09 +00:00
|
|
|
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,
|
2017-07-03 14:48:09 +00:00
|
|
|
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))
|