mirror of
https://github.com/OS-Copilot/OS-Copilot.git
synced 2026-05-05 03:00:15 -04:00
add theme
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user