From 2564189a769a5bd3de63086bb62dc3532d1b07b9 Mon Sep 17 00:00:00 2001 From: Chandler J Date: Sat, 6 Apr 2024 21:53:25 -0600 Subject: added menubutton bind for i3, refactoring --- src/update_i3.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/update_i3.py') diff --git a/src/update_i3.py b/src/update_i3.py index 1d4b792..3fc8858 100644 --- a/src/update_i3.py +++ b/src/update_i3.py @@ -12,12 +12,13 @@ def updatei3Theme( update_i3_lock: bool, dmenu: bool, lock_img_path: str, + menu_keybind: str, ) -> None: print('[bold red]Updating i3 color scheme') - update_i3_colors(config_path, colors, compliments, dmenu, img_path) + update_i3_colors(config_path, colors, compliments, dmenu, img_path, menu_keybind) if update_i3_lock: change_i3_lock_img(img_path, lock_img_path) @@ -49,7 +50,8 @@ def update_i3_colors( colors: list, compliments: list, dmenu: bool, - img_path: str + img_path: str, + menu_keybind: str, ) -> None: data = '' with open(config_path, 'r') as file: @@ -72,10 +74,10 @@ def update_i3_colors( if "set $bgimage" in line: data[i] = 'set $bgimage ' + img_path + '\n' # update i3 lock image - if "bindsym $mod+d exec --no-startup-id dmenu_run" in line: + if f"bindsym {menu_keybind} exec --no-startup-id dmenu_run" in line: if dmenu: print('[bold red]Updating Dmenu color scheme') - data[i] = f"bindsym $mod+d exec --no-startup-id dmenu_run -nb '{colors[0]}' -sf '{compliments[0]}' -sb '{colors[1]}' -nf '{compliments[1]}'\n" + data[i] = f"bindsym {menu_keybind} exec --no-startup-id dmenu_run -nb '{colors[0]}' -sf '{compliments[0]}' -sb '{colors[1]}' -nf '{compliments[1]}'\n" with open(config_path, 'w') as file: -- cgit v1.2.3