rebrand!: Antergos NeXT -> Euri Linux
This commit is contained in:
+91
@@ -0,0 +1,91 @@
|
||||
import QtQuick 2.0;
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore;
|
||||
import org.kde.plasma.components 2.0 as Plasma;
|
||||
import org.kde.kwin 2.0;
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
PlasmaCore.DataSource {
|
||||
id: composition
|
||||
engine: 'executable'
|
||||
connectedSources: []
|
||||
property QtObject client
|
||||
|
||||
function set(aClient) {
|
||||
client = aClient
|
||||
var windowId = client.windowId.toString(16)
|
||||
composition.connectSource("xprop -id 0x" + windowId + " _NET_WM_BYPASS_COMPOSITOR")
|
||||
}
|
||||
|
||||
function preference(stdout) {
|
||||
if (clientIsException()) {
|
||||
return "on"
|
||||
} else {
|
||||
var splittedStdout = stdout.split(" ")
|
||||
var compositionPreference = splittedStdout[2]
|
||||
|
||||
if (compositionPreference == "not") {
|
||||
return "none"
|
||||
} else if (compositionPreference == 1) {
|
||||
return "off"
|
||||
} else if (compositionPreference == 2) {
|
||||
return "on"
|
||||
} else {
|
||||
var error = ": Invalid composition preference: "
|
||||
console.error(client.resourceClass + error + compositionPreference)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clientIsException() {
|
||||
var result = false;
|
||||
const exceptions = ['plasmashell', 'ksmserver-logout-greeter'];
|
||||
let index = 0;
|
||||
|
||||
while (!result && index < exceptions.length) {
|
||||
result = (client.resourceClass == exceptions[index]);
|
||||
index++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
onNewData: {
|
||||
var exitCode = data["exit code"]
|
||||
var exitStatus = data["exit status"]
|
||||
var stdout = data["stdout"]
|
||||
var stderr = data["stderr"]
|
||||
|
||||
if (exitCode != 0) {
|
||||
console.error(stderr)
|
||||
return false
|
||||
} else {
|
||||
let compositionPreference = composition.preference(stdout)
|
||||
|
||||
if (client.fullScreen && compositionPreference != "on") {
|
||||
client.blocksCompositing = true
|
||||
} else if (!client.fullScreen && compositionPreference != "off") {
|
||||
client.blocksCompositing = false
|
||||
}
|
||||
}
|
||||
|
||||
disconnectSource(sourceName)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: workspace
|
||||
|
||||
function onClientAdded(client) {
|
||||
if (client.fullScreen) {
|
||||
composition.set(client)
|
||||
}
|
||||
}
|
||||
|
||||
function onClientFullScreenSet(client) {
|
||||
composition.set(client)
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
[Desktop Entry]
|
||||
|
||||
Name=Autocomposer
|
||||
X-KDE-PluginInfo-Version=4
|
||||
Comment=Blocks compositing on fullscreen, to improve graphical performance
|
||||
Icon=preferences-desktop-effects
|
||||
|
||||
X-KDE-PluginInfo-License=GPLv3
|
||||
X-KDE-PluginInfo-Website=https://store.kde.org/p/1502826/
|
||||
|
||||
X-KDE-PluginInfo-Name=autocomposer
|
||||
Type=Service
|
||||
X-KDE-PluginInfo-Category=Kwin Script
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
||||
|
||||
X-KDE-ServiceTypes=KWin/Script
|
||||
X-Plasma-API=declarativescript
|
||||
X-Plasma-MainScript=code/main.qml
|
||||
X-KWin-Border-Activate=true
|
||||
Reference in New Issue
Block a user