summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChandler J <cjustice2000@gmail.com>2024-01-28 14:45:48 -0700
committerChandler J <cjustice2000@gmail.com>2024-01-28 14:45:48 -0700
commit21e53dd011a20dd237abfbe093bbb465fda1c11d (patch)
tree1eeb24f9d4ade6037f93796db671829ec6be33eb /src
parent62dae0243c597c3cbeaa9615a2169b81b0aada19 (diff)
working on tui
Diffstat (limited to 'src')
-rw-r--r--src/color_engine.py5
-rw-r--r--src/initialize_rofi.py21
-rw-r--r--src/tui.py30
3 files changed, 45 insertions, 11 deletions
diff --git a/src/color_engine.py b/src/color_engine.py
index 6d5c90a..1b94a02 100644
--- a/src/color_engine.py
+++ b/src/color_engine.py
@@ -33,8 +33,11 @@ def rgbToHex(input_values: list) -> list:
return hex_list
def hexToRGB(hex_value: str) -> tuple:
+ """
+ Takes in a list of Hex values and returns a tuple of those colors as rgb values
+ """
hex_value = hex_value.lstrip('#')
- return tuple(int(hex_value[i:i+2], 16) for i in (0, 2, 4))
+ return tuple(int(hex_value[i:i+2], 16) for i in (0, 2, 4)) # Magic :DDDDDD
def compColors(color_list: list) -> list:
"""
diff --git a/src/initialize_rofi.py b/src/initialize_rofi.py
index 69c8637..8b8efdd 100644
--- a/src/initialize_rofi.py
+++ b/src/initialize_rofi.py
@@ -6,14 +6,11 @@ configPath = f'/home/{uname}/.config/rofi/'
def reconfigureRofi() -> None:
"""
- Create a Rofi theme if one is not present with desired defaults to work with InstantRice.
- Will pull source file from data dir
+ Create a Rofi configuration file if one is not present with desired defaults to work with InstantRice.
"""
print('[bold red]Initializing Rofi Theme')
- # copy the default config from data to .config
- dirExists = os.path.isdir(configPath)
- if dirExists:
+ def changeConfigContents() -> None:
print('path exists')
if os.path.exists(f'{configPath}config.rasi'):
print('config present')
@@ -33,15 +30,19 @@ def reconfigureRofi() -> None:
file = open(rf'{configPath}config.rasi', 'w')
file.write('@theme "theme.rasi"')
file.close()
+
+ # copy the default config from data to .config
+ dirExists = os.path.isdir(configPath)
+ if dirExists:
+ changeConfigContents()
else:
print('path doesnt exist')
- # add line to rofi config
- # (this means we need might need to make the rofi config file, and the rofi directory)
- # (it also will be necessary to grab the current user's username to access their .config)
- print(uname)
- print(dirExists)
+
def dropRofiTheme():
+ """
+ Drop the config file from data/ directory and place it in the .config/rofi directory
+ """
with open('../data/theme.rasi', 'r') as file:
data = file.readlines()
diff --git a/src/tui.py b/src/tui.py
new file mode 100644
index 0000000..fc702f9
--- /dev/null
+++ b/src/tui.py
@@ -0,0 +1,30 @@
+import pytermgui as ptg
+
+
+global gaps_enabled
+gaps_enabled = False
+def toggle_gaps(gaps):
+ gaps = not gaps
+
+with ptg.WindowManager() as manager:
+ layout = ptg.Layout()
+ layout.add_slot("Body Left", index=0)
+ layout.add_slot("Body Right", width=0.5, index=1)
+ i3window = (
+ ptg.Window(
+ "[bold]i3 Configuration Settings",
+ ptg.Label("[italic gray]gaps", parent_align=0),
+ ptg.Splitter(ptg.Label("Toggle window gaps", parent_align=0), ptg.Checkbox(parent_align=2))
+ )
+ .set_title("[italic inverse !gradient(60)]i3 Configuration[/!]")
+ )
+ polybar_window = (
+ ptg.Window(
+ "[bold]Polybar Configuration Settings"
+ ).set_title("[italic inverse !gradient(45)]Polybar Configuration")
+ )
+ layout.assign(polybar_window, index=0)
+ layout.assign(i3window, index=1)
+ manager.add(i3window)
+ manager.add(polybar_window)
+