diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e4c6c4..a2e2def 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,6 @@ add_compile_options( if("plugin" IN_LIST ENABLE_MODULES) add_subdirectory(Plugins) - add_custom_target(fix-cc - COMMAND sed -i "s/-mno-direct-extern-access/-fno-direct-access-external-data/g" "${CMAKE_BINARY_DIR}/compile_commands.json") endif() if("shell" IN_LIST ENABLE_MODULES) diff --git a/Daemons/LidService.qml b/Daemons/LidService.qml index 0a8fe79..98f67d1 100644 --- a/Daemons/LidService.qml +++ b/Daemons/LidService.qml @@ -1,5 +1,4 @@ import Quickshell -import ZShell import QtQuick Scope { diff --git a/Modules/Lock/Lock.qml b/Modules/Lock/Lock.qml index 68d8a46..5de21c6 100644 --- a/Modules/Lock/Lock.qml +++ b/Modules/Lock/Lock.qml @@ -9,6 +9,7 @@ import qs.Components Scope { id: root + required property var lid property alias lock: lock property int seenOnce: 0 @@ -21,6 +22,13 @@ Scope { onRequestLock: lock.locked = true onUnlock: lock.locked = false + Connections { + target: root.lid + function onRequestLock(): void { + lock.locked = true + } + } + LockSurface { id: lockSurface diff --git a/Plugins/ZShell/lidwatcher.hpp b/Plugins/ZShell/lidwatcher.hpp index 2f25d7b..7579bcc 100644 --- a/Plugins/ZShell/lidwatcher.hpp +++ b/Plugins/ZShell/lidwatcher.hpp @@ -32,7 +32,6 @@ class LidWatcher : public QObject { LidState m_state = Opened; - void extracted(); void onPropertiesChanged(const QString& interface, const QVariantMap& changed, const QStringList& invalidated); diff --git a/shell.qml b/shell.qml index 0f494ef..9063f58 100644 --- a/shell.qml +++ b/shell.qml @@ -35,6 +35,8 @@ ShellRoot { Lock { id: lock + + lid: lid } Shortcuts { @@ -48,7 +50,10 @@ ShellRoot { } LazyLoader { + id: lid + activeAsync: Config.lock.lidWatch && Battery.isLaptop + component: LidService { onRequestLock: lock.lock.requestLock() }