From 08b7b393cbff1e86d1417f2dcb07941d3c5bdf60 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:30:07 +0100 Subject: [PATCH] changes from main --- .../aiChat/AnnotationSourceButton.qml | 9 ++++----- .../ii/scripts/hyprland/hyprconfigurator.py | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarLeft/aiChat/AnnotationSourceButton.qml b/dots/.config/quickshell/ii/modules/ii/sidebarLeft/aiChat/AnnotationSourceButton.qml index bd75a5d42..828cc0356 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarLeft/aiChat/AnnotationSourceButton.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarLeft/aiChat/AnnotationSourceButton.qml @@ -1,10 +1,9 @@ -import qs.modules.common -import qs.modules.common.widgets -import qs.modules.common.functions -import qs.services import QtQuick import QtQuick.Layouts -import Quickshell.Hyprland + +import qs +import qs.modules.common +import qs.modules.common.widgets RippleButton { id: root diff --git a/dots/.config/quickshell/ii/scripts/hyprland/hyprconfigurator.py b/dots/.config/quickshell/ii/scripts/hyprland/hyprconfigurator.py index 7d582a821..3c5961273 100755 --- a/dots/.config/quickshell/ii/scripts/hyprland/hyprconfigurator.py +++ b/dots/.config/quickshell/ii/scripts/hyprland/hyprconfigurator.py @@ -2,6 +2,7 @@ import argparse import re import os +import tempfile def edit_hyprland_config(file_path, set_args, reset_args): try: @@ -54,8 +55,19 @@ def edit_hyprland_config(file_path, set_args, reset_args): new_lines[-1] += '\n' new_lines.append(f"{key} = {value}\n") - with open(file_path, 'w') as file: - file.writelines(new_lines) + dir_name = os.path.dirname(os.path.abspath(file_path)) + temp_path = None + try: + with tempfile.NamedTemporaryFile(mode='w', dir=dir_name, delete=False) as temp_file: + temp_file.writelines(new_lines) + temp_path = temp_file.name + os.chmod(temp_path, os.stat(file_path).st_mode) + os.replace(temp_path, file_path) + except Exception as e: + if temp_path and os.path.exists(temp_path): + os.remove(temp_path) + print(f"Error saving file: {e}") + return for key in reset_set: print(f"Removed '{key}' from '{file_path}'")