Skip to content

Commit

Permalink
Merge pull request #82 from nwg-piotr/hypr044
Browse files Browse the repository at this point in the history
Hypr044
  • Loading branch information
nwg-piotr authored Oct 16, 2024
2 parents 803e0c8 + 3655062 commit a4747ca
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 90 deletions.
7 changes: 7 additions & 0 deletions nwg_shell_config/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"all-of-type": "All of this type",
"allow-small-split": "Allow small split",
"allow-small-split-tooltip": "Enable adding additional master windows in a horizontal split style.",
"allow-tearing": "Allow tearing",
"allow-tearing-tooltip": "Master switch for allowing tearing to occur.",
"always-center-master": "Always center master",
"always-center-master-tooltip": "When using orientation=center, keep the master window centered, even when it is the only window in the workspace.",
"always-show": "Always show",
Expand Down Expand Up @@ -44,6 +46,7 @@
"backgrounds": "Backgrounds",
"before-sleep": "Before sleep",
"before-sleep-tooltip": "Command to execute before systemd puts the computer to sleep.",
"blur-background": "Blur background",
"bottom": "Bottom",
"bottom-center": "Bottom Center",
"bottom-left": "Bottom Left",
Expand All @@ -55,6 +58,8 @@
"check-updates": "Check updates",
"clickfinger-behavior": "Clickfinger behavior",
"clickfinger-behavior-tooltip": "Button presses with 1, 2, or 3 fingers will be mapped to LMB, RMB, and MMB respectively.\nThis disables interpretation of clicks based on location on the touchpad.",
"click-method": "Click method",
"click-method-tooltip": "button_areas (default) - left/middle/right button click when pressing down the touchpad in specific areas (bottom left, middle and right by default)\nclickfinger - left/middle/right button click when pressing down the touchpad with 1, 2 or 3 fingers",
"clipboard-history": "Clipboard history",
"clipboard-history-tooltip": "Determines whether to store clipboard history to cliphist (add commands to autostart).",
"close": "Close",
Expand Down Expand Up @@ -194,6 +199,8 @@
"keywords-tooltip": "Comma-separated list of keywords",
"latitude": "Latitude",
"latitude-tooltip": "your location latitude: `wlsunset -l",
"launcher-at-start": "Launcher at start",
"launcher-at-start-tooltip": "Show launcher button at the beginning of the dock",
"leave-blank-to-use-above": "Leave blank to use the above.",
"layers-hog-keyboard-focus": "Layers hog keyboard focus",
"layers-hog-keyboard-focus-tooltip": "If true, will make keyboard-interactive layers keep their focus on mouse move (e.g. panel, launchers)",
Expand Down
9 changes: 8 additions & 1 deletion nwg_shell_config/langs/pl_PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"all-of-type": "Wszystkie tego typu",
"allow-small-split": "Zezwól na mały podział",
"allow-small-split-tooltip": "Umożliwia dodawanie dodatkowych okien Master w stylu podziału poziomego.",
"allow-tearing": "Zezwalaj na tearing",
"allow-tearing-tooltip": "Główny przełącznik dla ustawień tearingu.",
"always-center-master": "Zawsze centruj master",
"always-center-master-tooltip": "Gdy użyto orientacji 'środek', trzymaj okno master wycentrowane, nawet gdy jest jedynym w tym obszarze roboczym.",
"always-show": "Zawsze wyświetlaj",
Expand All @@ -24,7 +26,7 @@
"applications": "Aplikacje",
"apply": "Zastosuj",
"apply-tooltip": "Zastosuj zmiany, wyeksportuj pliki, przeładuj sway.",
"auto-show-hide": "Automatyczne wyświetlanie/ukrywanie",
"auto-show-hide": "Auto-wyświetlanie/ukrywanie",
"auto-show-hide-tooltip": "Automatycznie ukrywaj, wyświetl po wskazaniu hotspota myszą.",
"autotiling": "Autotiling",
"autotiling-tooltip": "Automatyzuje zmianę poziom/pion orientacji podziału okna.",
Expand All @@ -44,6 +46,7 @@
"backgrounds": "Tapety",
"before-sleep": "Przed uśpieniem",
"before-sleep-tooltip": "Komenda do wykonania zanim `systemd` uśpi komputer.",
"blur-background": "Rozmyj tło",
"bottom": "Dół",
"bottom-center": "Dół Środek",
"bottom-left": "Dół Lewo",
Expand All @@ -55,6 +58,8 @@
"check-updates": "Sprawdź aktualizacje",
"clickfinger-behavior": "Zachowanie palca klikającego",
"clickfinger-behavior-tooltip": "Button presses with 1, 2, or 3 fingers will be mapped to LMB, RMB, and MMB respectively.\nThis disables interpretation of clicks based on location on the touchpad.",
"click-method": "Metoda kliknięcia",
"click-method-tooltip": "button_areas (domyślne) - kliknięcie lewym/środkowym/prawym przyciskiem po naciśnięciu touchpada w określonych obszarach (domyślnie w lewym dolnym, środkowym i prawym dolnym rogu)\nclickfinger - kliknięcie lewym/środkowym/prawym przyciskiem po naciśnięciu touchpada 1, 2 lub 3 palcami",
"clipboard-history": "Historia schowka",
"clipboard-history-tooltip": "Określa czy zapisywać historię schowka w cliphist (dodaje komendy do autostart).",
"close": "Zamknij",
Expand Down Expand Up @@ -194,6 +199,8 @@
"keywords-tooltip": "Lista słów kluczowych, rozdzielonych przecinkiem.",
"latitude": "Szerokość",
"latitude-tooltip": "Twoja szerokość geograficzna: `wlsunset -l`",
"launcher-at-start": "Launcher na początku",
"launcher-at-start-tooltip": "Wyświetla przycisk launchera na początku doku",
"leave-blank-to-use-above": "Zostać puste by użyć powyższych.",
"layers-hog-keyboard-focus": "Żarłoczny fokus klawiatury na warstwach",
"layers-hog-keyboard-focus-tooltip": "Jeśli włączony, warstwy używające klawiatury zachowają fokus przy ruchu myszy (n.p. panel, szuflada aplikacji)",
Expand Down
33 changes: 24 additions & 9 deletions nwg_shell_config/main_hyprland.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ def preset_menu(preset_id):
row.eb.connect("button-press-event", set_up_dock_tab, preset, preset_name)
list_box.add(row)

row = SideMenuRow(voc["exit-menu"], margin_start=18)
row.eb.connect("button-press-event", set_up_bar_tab, preset, preset_name)
list_box.add(row)
# row = SideMenuRow(voc["exit-menu"], margin_start=18)
# row.eb.connect("button-press-event", set_up_bar_tab, preset, preset_name)
# list_box.add(row)

row = SideMenuRow(voc["notifications"], margin_start=18)
row.eb.connect("button-press-event", set_up_notification_tab, preset, preset_name)
Expand Down Expand Up @@ -389,12 +389,12 @@ def set_up_dock_tab(event_box, event_button, preset, preset_name):
grid.attach(content, 1, 0, 1, 1)


def set_up_bar_tab(event_box, event_button, preset, preset_name):
hide_submenus()
global content
content.destroy()
content = bar_tab(preset, preset_name, voc)
grid.attach(content, 1, 0, 1, 1)
# def set_up_bar_tab(event_box, event_button, preset, preset_name):
# hide_submenus()
# global content
# content.destroy()
# content = bar_tab(preset, preset_name, voc)
# grid.attach(content, 1, 0, 1, 1)


def set_up_notification_tab(event_box, event_button, preset, preset_name):
Expand Down Expand Up @@ -709,6 +709,9 @@ def save_includes():
if preset["dock-exclusive"]:
cmd_dock += " -x"

if preset["launcher-at-start"]:
cmd_dock += " -lp start"

if "preset-" in settings["panel-preset"]:
cmd_dock += " -s {}.css".format(settings["panel-preset"])
elif preset["dock-css"]:
Expand Down Expand Up @@ -822,6 +825,8 @@ def save_includes():
includes.append(' no_cursor_warps = {}'.format(bool2lower(settings["gen-no_cursor_warps"])))
if settings["gen-no_focus_fallback"]:
includes.append(' no_focus_fallback = {}'.format(bool2lower(settings["gen-no_focus_fallback"])))
if settings["gen-allow_tearing"]:
includes.append(' allow_tearing = {}'.format(bool2lower(settings["gen-allow_tearing"])))
if settings["gen-resize_on_border"]:
includes.append(' resize_on_border = {}'.format(bool2lower(settings["gen-resize_on_border"])))
if settings["gen-extend_border_grab_area"]:
Expand Down Expand Up @@ -943,6 +948,12 @@ def save_includes():
if preset["launcher-super-key"]:
includes.append('bindr = SUPER, SUPER_L, exec, $launcher')

includes.append('\n# LAYER RULES')
if preset["launcher-blur-background"]:
includes.append("layerrule = blur, nwg-drawer")
if preset["dock-blur-background"]:
includes.append("layerrule = blur, nwg-dock")

p = os.path.join(config_home, "hypr/includes.conf")
print("Saving includes to {}".format(p))
save_list_to_text_file(includes, p)
Expand Down Expand Up @@ -1017,6 +1028,7 @@ def load_settings():
"gen-resize_on_border": False,
"gen-extend_border_grab_area": 15,
"gen-hover_icon_on_border": True,
"gen-allow_tearing": False,

"dwindle-use-settings": True,
"dwindle-pseudotile": False,
Expand Down Expand Up @@ -1152,6 +1164,7 @@ def load_presets():
def load_preset(file_name):
defaults = {
"panel-css": "",
"launcher-at-start": False,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand All @@ -1167,6 +1180,7 @@ def load_preset(file_name):
"launcher-run-through-compositor": False,
"launcher-super-key": False,
"launcher-output": "Any",
"launcher-blur-background": False,
"exit-position": "center",
"exit-full": False,
"exit-alignment": "middle",
Expand All @@ -1188,6 +1202,7 @@ def load_preset(file_name):
"dock-startup-delay": 0,
"dock-css": "",
"dock-on": False,
"dock-blur-background": False,
"swaync-positionX": "right",
"swaync-positionY": "top",
"swaync-control-center-width": 500,
Expand Down
6 changes: 6 additions & 0 deletions nwg_shell_config/main_sway.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,9 @@ def save_includes():
if preset["dock-exclusive"]:
cmd_dock += " -x"

if preset["launcher-at-start"]:
cmd_dock += " -lp start"

if "preset-" in settings["panel-preset"]:
cmd_dock += " -s {}.css".format(settings["panel-preset"])
elif preset["dock-css"]:
Expand Down Expand Up @@ -820,6 +823,7 @@ def save_includes():
lines.append(' natural_scroll {}'.format(settings["touchpad-natural-scroll"]))
lines.append(' scroll_factor {}'.format(settings["touchpad-scroll-factor"]))
lines.append(' scroll_method {}'.format(settings["touchpad-scroll-method"]))
lines.append(' click_method {}'.format(settings["touchpad-click-method"]))
lines.append(' left_handed {}'.format(settings["touchpad-left-handed"]))
lines.append(' tap {}'.format(settings["touchpad-tap"]))
lines.append(' tap_button_map {}'.format(settings["touchpad-tap-button-map"]))
Expand Down Expand Up @@ -929,6 +933,7 @@ def load_settings():
"touchpad-drag-lock": "disabled",
"touchpad-dwt": "enabled",
"touchpad-middle-emulation": "enabled",
"touchpad-click-method": "button_areas",
"touchpad-custom-name": "",
"touchpad-custom-value": "",
"lockscreen-use-settings": True,
Expand Down Expand Up @@ -1000,6 +1005,7 @@ def load_presets():
def load_preset(file_name):
defaults = {
"panel-css": "",
"launcher-at-start": False,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
1 change: 1 addition & 0 deletions nwg_shell_config/shell/hyprland-0
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panel-css": "hyprland-0.css",
"launcher-at-start": false,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
1 change: 1 addition & 0 deletions nwg_shell_config/shell/hyprland-1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panel-css": "hyprland-1.css",
"launcher-at-start": false,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
1 change: 1 addition & 0 deletions nwg_shell_config/shell/hyprland-2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panel-css": "hyprland-2.css",
"launcher-at-start": false,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
1 change: 1 addition & 0 deletions nwg_shell_config/shell/hyprland-3
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panel-css": "hyprland-3.css",
"launcher-at-start": false,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
1 change: 1 addition & 0 deletions nwg_shell_config/shell/preset-0
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panel-css": "preset-0.css",
"launcher-at-start": false,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
1 change: 1 addition & 0 deletions nwg_shell_config/shell/preset-1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panel-css": "preset-1.css",
"launcher-at-start": false,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
1 change: 1 addition & 0 deletions nwg_shell_config/shell/preset-2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panel-css": "preset-2.css",
"launcher-at-start": false,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
1 change: 1 addition & 0 deletions nwg_shell_config/shell/preset-3
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panel-css": "preset-3.css",
"launcher-at-start": false,
"launcher-columns": 6,
"launcher-icon-size": 64,
"launcher-file-search-columns": 2,
Expand Down
Loading

0 comments on commit a4747ca

Please sign in to comment.