diff --git a/Bin/dev/qmlfmt.sh b/Bin/dev/qmlfmt.sh index a7c6b548..6af303d2 100755 --- a/Bin/dev/qmlfmt.sh +++ b/Bin/dev/qmlfmt.sh @@ -4,4 +4,6 @@ # Can be installed from AUR "qmlfmt-git" # Requires qt6-5compat -find . -name "*.qml" -print -exec qmlfmt -e -b 360 -t 2 -i 2 -w {} \; +cd "$(git rev-parse --show-toplevel)" +echo "Formatting $(find . -name "*.qml" | wc -l) files..." +find . -name "*.qml" -print0 | xargs -0 -P "$(nproc)" -I {} qmlfmt -e -b 360 -t 2 -i 2 -w {} diff --git a/Services/HyprlandService.qml b/Services/HyprlandService.qml index 1d50a7c6..2db855c3 100644 --- a/Services/HyprlandService.qml +++ b/Services/HyprlandService.qml @@ -274,8 +274,9 @@ Item { try { appId = toplevel.wayland.appId if (appId) - return appId + return appId } catch (e) { + } // Try direct properties @@ -298,6 +299,7 @@ Item { return String(ipcData.class || ipcData.initialClass || ipcData.appId || ipcData.wm_class || "") } } catch (e) { + } return "" diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 00000000..b49937b1 --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,4 @@ +pre-commit: + jobs: + - name: format qml + run: ./Bin/dev/qmlfmt.sh && git update-index --again