Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nwg_displays/langs/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"adaptive-sync-tooltip": "Povolí, nebo zakáže adaptivní synchronizaci \n(často označovanou jako VRR proměnná obnovovací frekvence, \nnebo podle výrobců FreeSync/G-Sync).",
"apply": "Použít",
"close": "Zavřít",
"clear": "Vymazat",
"custom-mode": "Upravený mód",
"custom-mode-tooltip": "Přidá '--custom' argument k nastavení módu \nNeyobrayeného v dostupných.\nPoužijte POUZE pokud přesně víte, co děláte.",
"dpms-tooltip": "Povolí, nebo zakáže výstup přez DPMS. \nPro vypnutí výstupu (tj. Vyprázdnění obrazovkz, \nale ponechání pracovních ploch beze změn), můžete vypnout DPMS.",
Expand Down
1 change: 1 addition & 0 deletions nwg_displays/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"adaptive-sync-tooltip": "Enables or disables adaptive synchronization \n(often referred to as Variable Refresh Rate, \nor by the vendor-specific names FreeSync/G-Sync).",
"apply": "Apply",
"close": "Close",
"clear": "Clear",
"custom-mode": "Custom mode",
"custom-mode-tooltip": "Adds '--custom' argument to set a mode \nnot listed in the list of available modes.\nUse this ONLY if you know what you're doing.",
"dpms-tooltip": "Enables or disables output via DPMS. \nTo turn an output off (ie. blank the screen \nbut keep workspaces as-is), one can set DPMS to off.",
Expand Down
1 change: 1 addition & 0 deletions nwg_displays/langs/pl_PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"adaptive-sync-tooltip": "Włącza lub wyłącza synchronizację adaptacyjną \n(często określaną jako 'zmienna częstotliwość odświeżania', \nlub według producentów FreeSync/G-Sync).",
"apply": "Zastosuj",
"close": "Zamknij",
"clear": "Wyczyść",
"custom-mode": "Tryb niestandardowy",
"custom-mode-tooltip": "Dodaje argument '--custom', by ustawić tryb \nnie występujący na liście dostępnych trybów.\nUżywaj TYLKO gdy dobrze wiesz co robisz.",
"dpms-tooltip": "Włącza lub wyłącza wyjście przez DPMS.\nAby wyłączyć wyjście (tj. wygasić ekran, ale zachować\nobszary robocze bez zmian), można wyłączyć DPMS.",
Expand Down
1 change: 1 addition & 0 deletions nwg_displays/langs/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"adaptive-sync-tooltip": "Ativa ou desativa sincronização adaptável \n(geralmente referida como Taxa de Atualização Variável, \nou pelo nomes comerciais FreeSync/G-Sync).",
"apply": "Aplicar",
"close": "Fechar",
"clear": "Limpar",
"custom-mode": "Modo personalizado",
"custom-mode-tooltip": "Adiciona o argumento '--custom' para definir um modo\nnão listado na listagem de disponíveis.\nUse isto SOMENTE se você sabe o que está fazendo.",
"dpms-tooltip": "Ativa ou desativa saída via DPMS. \nPara desligar uma saída (ex. tela em branco \nmas manter espaços de trabalho como estão), o DPMS pode ser definido como off.",
Expand Down
1 change: 1 addition & 0 deletions nwg_displays/langs/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"adaptive-sync-tooltip": "Включение или выключение адаптивной синхронизации \n(также известной как Variable Refresh Rate, \nили по вендор-специфичным именам FreeSync/G-Sync).",
"apply": "Применить",
"close": "Закрыть",
"clear": "Очистить",
"custom-mode": "Пользовательский режим",
"custom-mode-tooltip": "Добавляет аргумент '--custom' для указания режима, \nотсутствующего в списке. Используйте эту опцию \nТОЛЬКО если вы знаете, что делаете.",
"dpms-tooltip": "Включение или выключение вывода через DPMS. Чтобы отключить вывод \n(т.е. отключить экран, но оставить рабочие пространства без изменений), вы можете отключить DPMS.",
Expand Down
1 change: 1 addition & 0 deletions nwg_displays/langs/tr_TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"adaptive-sync-tooltip": "Uyarlanabilir senkronizasyonu etkinleştirir veya devre dışı bırakır\n(genellikle Değişken Yenileme Hızı olarak anılır,\nveya üreticiye özel isimlerle FreeSync/G-Sync olarak bilinir).",
"apply": "Uygula",
"close": "Kapat",
"clear": "Temizle",
"custom-mode": "Özel mod",
"custom-mode-tooltip": "'--custom' argümanını ekleyerek\nlistede olmayan özel bir modu ayarlar.\nYalnızca ne yaptığınızı biliyorsanız kullanın.",
"dpms-tooltip": "DPMS üzerinden çıkışı etkinleştirir veya devre dışı bırakır.\nBir çıkışı kapatmak için (ekranı karartmak ancak\nçalışma alanlarını korumak için), DPMS kapalı olarak ayarlanabilir.",
Expand Down
1 change: 1 addition & 0 deletions nwg_displays/langs/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"adaptive-sync-tooltip": "启用或停用 Adaptive-Sync 功能(通常称作可变刷新率,或品牌专属名词 FreeSync/G-Sync)。",
"apply": "应用",
"close": "关闭",
"clear": "清除",
"custom-mode": "自定义模式",
"custom-mode-tooltip": "使用“--custom”参数以使用未列入列表中的模式。不要使用此模式,除非你清楚自己在做什么!",
"dpms-tooltip": "启用或停用通过 DPMS 的输出。若要关闭输出(即,使显示器黑屏但不变动工作区),可将 DPMS 关闭。",
Expand Down
40 changes: 40 additions & 0 deletions nwg_displays/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,14 @@ def create_workspaces_window(btn):
btn_close.connect("clicked", close_dialog, dialog_win)
box.pack_end(btn_close, False, False, 6)

btn_clear = Gtk.Button()
btn_clear.set_label(voc["clear"])
if sway_config_dir:
btn_clear.connect("clicked", on_workspaces_clear_btn, dialog_win)
else:
btn_clear.set_sensitive(False)
box.pack_end(btn_clear, False, False, 6)

dialog_win.show_all()


Expand Down Expand Up @@ -868,6 +876,14 @@ def create_workspaces_window_hypr(btn):
btn_close.connect("clicked", close_dialog, dialog_win)
box.pack_end(btn_close, False, False, 6)

btn_clear = Gtk.Button()
btn_clear.set_label(voc["clear"])
if hypr_config_dir:
btn_clear.connect("clicked", on_workspaces_clear_btn_hypr, dialog_win)
else:
btn_clear.set_sensitive(False)
box.pack_end(btn_clear, False, False, 6)

dialog_win.show_all()


Expand Down Expand Up @@ -928,6 +944,30 @@ def on_workspaces_apply_btn_hypr(w, win, old_workspaces):
close_dialog(w, win)


def on_workspaces_clear_btn(w, win):
global workspaces
workspaces = {}
save_workspaces({}, os.path.join(sway_config_dir, "workspaces"), use_desc=config["use-desc"])
notify("Workspaces assignment", "Restart sway for changes to take effect")
close_dialog(w, win)


def on_workspaces_clear_btn_hypr(w, win):
global workspaces
workspaces = {}
workspace_conf_file = workspaces_path
now = datetime.datetime.now()
text_file = open(workspace_conf_file, "w")
line = "# Generated by nwg-displays on {} at {}. Do not edit manually.\n".format(
datetime.datetime.strftime(now, "%Y-%m-%d"),
datetime.datetime.strftime(now, "%H:%M:%S"),
)
text_file.write(line + "\n")
text_file.close()
notify("Workspaces assignment", "Restart Hyprland for changes to take effect")
close_dialog(w, win)


def create_confirm_win(backup, path, config_dir=None, profile_name=None):
global confirm_win
if confirm_win:
Expand Down