Skip to content

Commit

Permalink
fix aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanCarloMachado committed Oct 16, 2024
1 parent c2e897e commit c3ac114
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
10 changes: 10 additions & 0 deletions PythonSearch.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "."
},
{
"path": "../PersonalMonorepo"
}
]
}
Binary file modified python_search/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion python_search/host_system/system_paths.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class SystemPaths:
BINARIES_PATH = "/Users/jean.machado/miniconda3/envs/python312/bin"
BINARIES_PATH = "/opt/miniconda3/envs/python312/bin"
KITTY_BINNARY = "/Applications/kitty.app/Contents/MacOS/kitty"
VIM_BINNARY = "/usr/bin/vim"
30 changes: 15 additions & 15 deletions python_search/search/search_ui/kitty.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
import sys
from python_search.apps.terminal import KittyTerminal
from python_search.host_system.system_paths import SystemPaths
from python_search.environment import is_mac

Expand Down Expand Up @@ -44,15 +45,18 @@ def launch(self) -> None:
"""
Entry point for the application to launch the search ui
"""
from python_search.apps.terminal import KittyTerminal
from python_search.theme import get_current_theme

theme = get_current_theme()

cmd = self.get_kitty_complete_cmd()
self._logger.debug(f"Launching kitty with cmd: {cmd}")
result = os.system(cmd)
if result != 0:
raise Exception("Failed: " + str(result), cmd)

def get_kitty_complete_cmd(self) -> str:
terminal = KittyTerminal()
from python_search.host_system.system_paths import SystemPaths

launch_cmd = f"""{get_kitty_cmd()} \
from python_search.theme import get_current_theme
theme = get_current_theme()
return f"""{self.get_kitty_cmd()} \
--title {self._title} \
--listen-on unix:/tmp/mykitty \
-o allow_remote_control=yes \
Expand All @@ -69,13 +73,9 @@ def launch(self) -> None:
-o background={theme.backgroud} \
-o foreground={theme.text} \
-o font_size="{theme.font_size}" \
-o font_family="SF\ Pro" \
{terminal.GLOBAL_TERMINAL_PARAMS} \
{SystemPaths.BINARIES_PATH}/term_ui
"""
result = os.system(launch_cmd)
if result != 0:
raise Exception("Failed: " + str(result), launch_cmd)

@staticmethod
def run() -> None:
Expand Down Expand Up @@ -104,10 +104,10 @@ def focus_kitty_command():
return f"{get_kitty_cmd()} @ --to unix:/tmp/mykitty focus-window"


def get_kitty_cmd() -> str:
if is_mac():
return SystemPaths.KITTY_BINNARY
return "kitty"
def get_kitty_cmd(self) -> str:
if is_mac():
return SystemPaths.KITTY_BINNARY
return "kitty"


def main():
Expand Down

0 comments on commit c3ac114

Please sign in to comment.