mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 14:28:02 +03:00
some changes
This commit is contained in:
1 parent
d1781b8ac9
commit
41bdc758d4
3 files changed
+4
-49
No files matched your search
@@ -1,46 +0,0 @@
|
|||||||
#!/usr/bin/env nix-shell
|
|
||||||
#!nix-shell -i python3 -p python3
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
import os
|
|
||||||
|
|
||||||
def convert_file(filepath):
|
|
||||||
if not os.path.isfile(filepath):
|
|
||||||
return
|
|
||||||
|
|
||||||
with open(filepath, 'r', encoding='utf-8') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
|
|
||||||
new_lines = []
|
|
||||||
changed = False
|
|
||||||
|
|
||||||
# "CTRL $mainMod, right, layoutmsg, focus r"
|
|
||||||
pattern = re.compile(r'^(\s*)"([^"]*,[^"]*)"\s*$')
|
|
||||||
|
|
||||||
for line in lines:
|
|
||||||
match = pattern.match(line)
|
|
||||||
if match:
|
|
||||||
indent = match.group(1)
|
|
||||||
content = match.group(2)
|
|
||||||
parts = [f'"{p.strip()}"' for p in content.split(',')]
|
|
||||||
args_str = " ".join(parts)
|
|
||||||
new_line = f'{indent}{{ _args = [ {args_str} ]; }}\n'
|
|
||||||
new_lines.append(new_line)
|
|
||||||
changed = True
|
|
||||||
else:
|
|
||||||
new_lines.append(line)
|
|
||||||
if changed:
|
|
||||||
with open(filepath, 'w', encoding='utf-8') as f:
|
|
||||||
f.writelines(new_lines)
|
|
||||||
print(f"Converted: {filepath}")
|
|
||||||
else:
|
|
||||||
print(f"Skipped (no changes): {filepath}")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
if len(sys.argv) < 2:
|
|
||||||
print("Usage: python3 lua_converter.py <file1.nix> <file2.nix> ...")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
for file in sys.argv[1:]:
|
|
||||||
convert_file(file)
|
|
||||||
+2
-1
@@ -9,7 +9,8 @@
|
|||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||||
|
configType = "hyprlang";
|
||||||
xwayland.enable = true;
|
xwayland.enable = true;
|
||||||
systemd.enable = false;
|
systemd.enable = false;
|
||||||
systemd.variables = [ "-all" ];
|
systemd.variables = [ "-all" ];
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
{
|
{
|
||||||
programs.hyprland = {
|
programs.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||||
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
|
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||||
xwayland.enable = true;
|
xwayland.enable = true;
|
||||||
withUWSM = true;
|
withUWSM = true;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user