add theme

This commit is contained in:
Shiina
2023-10-23 21:34:15 +08:00
parent f71da6aefa
commit 33cb1fa43f
3 changed files with 14 additions and 2 deletions

View File

@@ -32,6 +32,12 @@ class BaseAction:
# self.server_name = "test"
# print(self.working_dir)
def _python(self, *lines):
return f'python -Bc "{"; ".join(lines)}"'
def _import(self, *packages):
return f'from jarvis.{".".join(packages)} import *'
@property
def _command(self):
raise NotImplementedError

View File

@@ -8,7 +8,10 @@ class turn_on_dark_mode(BaseAction):
@property
def _command(self):
return 'shortcuts run "Dark Mode"'
return self._python(
self._import("atom", "operations"),
"adjust_theme('Adwaita-dark')"
)
# def _success(self):
# return "Successfully turned the system into the Dark Mode"

View File

@@ -8,7 +8,10 @@ class turn_on_light_mode(BaseAction):
@property
def _command(self):
return 'shortcuts run "Light Mode"'
return self._python(
self._import("atom", "operations"),
"adjust_theme('Adwaita')"
)
# def _success(self):
# return "Successfully turned the system into the Light Mode"