-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
|
||
home_dir = os.environ['HOME'] | ||
|
||
def replace_waybar_theme(val): | ||
os.system(f"rm -rf {home_dir}/.config/waybar/*") | ||
os.system(f"cp -r {home_dir}/.swts/wbthemes/{val}/* {home_dir}/.config/waybar/") | ||
|
||
def replace_sway_config(val): | ||
os.system(f"rm -rf {home_dir}/.config/sway/*") | ||
os.system(f"cp -r {home_dir}/.swts/swconfig/{val}/* {home_dir}/.config/sway/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import os | ||
import PySimpleGUIQt as sg | ||
from funcs import * | ||
|
||
sg.LOOK_AND_FEEL_TABLE['Native'] = { | ||
'BACKGROUND': sg.COLOR_SYSTEM_DEFAULT, | ||
'TEXT': sg.COLOR_SYSTEM_DEFAULT, | ||
'INPUT': sg.COLOR_SYSTEM_DEFAULT, | ||
'TEXT_INPUT': sg.COLOR_SYSTEM_DEFAULT, | ||
'SCROLL': sg.COLOR_SYSTEM_DEFAULT, | ||
'BUTTON': (sg.COLOR_SYSTEM_DEFAULT, sg.COLOR_SYSTEM_DEFAULT), | ||
'PROGRESS': sg.DEFAULT_PROGRESS_BAR_COLOR, | ||
'BORDER': 1, | ||
'SLIDER_DEPTH': 0, | ||
'PROGRESS_DEPTH': 0, | ||
} | ||
|
||
sg.theme('Native') | ||
|
||
waybar_themes_array = os.listdir(f'{home_dir}/.swts/wbthemes') | ||
sway_config_array = os.listdir(f'{home_dir}/.swts/swconfig') | ||
|
||
waybar_layout = [ | ||
[ | ||
sg.Text('Select a Theme to apply') | ||
], | ||
[ | ||
sg.Combo(waybar_themes_array) | ||
], | ||
[ | ||
sg.Text("", key="-WBOUTPUT-") | ||
], | ||
[ | ||
sg.Button('Ok', key="-WBOKBTN-"), | ||
sg.Button('Apply', key="-WBAPPLYBTN-"), | ||
] | ||
] | ||
|
||
sway_config_layout = [ | ||
[ | ||
sg.Text('Select a Config to apply') | ||
], | ||
[ | ||
sg.Combo(sway_config_array) | ||
], | ||
[ | ||
sg.Text("", key="-SWOUTPUT-") | ||
], | ||
[ | ||
sg.Button('Ok', key="-SWOKBTN-"), | ||
sg.Button('Apply', key="-SWAPPLYBTN-"), | ||
] | ||
] | ||
|
||
|
||
|
||
about_layout = [ | ||
[ | ||
sg.Text('SwTS') | ||
], | ||
[ | ||
sg.Text('Change your Sway and Waybar theme in a easier way!') | ||
], | ||
[ | ||
sg.Text('') | ||
], | ||
[ | ||
sg.Text('Made by Brisolo32 in Brazil') | ||
] | ||
] | ||
|
||
|
||
tab_layout = [ | ||
[ | ||
sg.TabGroup( | ||
[ | ||
[ | ||
sg.Tab( | ||
"Waybar", | ||
waybar_layout, | ||
border_width=10, | ||
background_color='white', | ||
), | ||
sg.Tab( | ||
"Sway", | ||
sway_config_layout, | ||
border_width=10, | ||
background_color='white', | ||
), | ||
sg.Tab( | ||
"About", | ||
about_layout, | ||
border_width=10, | ||
background_color='white', | ||
element_justification='center' | ||
), | ||
] | ||
] | ||
) | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/python | ||
import PySimpleGUIQt as sg | ||
import os | ||
from funcs import * | ||
from layouts import * | ||
|
||
sg.LOOK_AND_FEEL_TABLE['Native'] = { | ||
'BACKGROUND': sg.COLOR_SYSTEM_DEFAULT, | ||
'TEXT': sg.COLOR_SYSTEM_DEFAULT, | ||
'INPUT': sg.COLOR_SYSTEM_DEFAULT, | ||
'TEXT_INPUT': sg.COLOR_SYSTEM_DEFAULT, | ||
'SCROLL': sg.COLOR_SYSTEM_DEFAULT, | ||
'BUTTON': (sg.COLOR_SYSTEM_DEFAULT, sg.COLOR_SYSTEM_DEFAULT), | ||
'PROGRESS': sg.DEFAULT_PROGRESS_BAR_COLOR, | ||
'BORDER': 1, | ||
'SLIDER_DEPTH': 0, | ||
'PROGRESS_DEPTH': 0, | ||
} | ||
|
||
sg.theme('Native') | ||
|
||
window = sg.Window('SwTS', tab_layout, size=(290, 4)) | ||
while True: | ||
event, values = window.read() | ||
if event == sg.WIN_CLOSED: | ||
break | ||
|
||
# Events for Waybar Layout | ||
if event == '-WBOKBTN-': | ||
replace_waybar_theme(values[0]) | ||
break | ||
if event == '-WBAPPLYBTN-': | ||
replace_waybar_theme(values[0]) | ||
|
||
window['-WBOUTPUT-'].update( | ||
'\nPress MOD+Shift+C to Restart Sway\nor kill waybar and start it up again' | ||
) | ||
|
||
# Events for Sway Layout | ||
if event == '-SWOKBTN-': | ||
replace_sway_config(values[1]) | ||
break | ||
if event == '-SWAPPLYBTN-': | ||
replace_sway_config(values[1]) | ||
|
||
window['-SWOUTPUT-'].update( | ||
'\nPress MOD+Shift+C to Restart Sway\nor log off and log on again' | ||
) | ||
window.close() |