forked from snowarch/iNiR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkillDialog.qml
More file actions
197 lines (181 loc) · 6.51 KB
/
Copy pathkillDialog.qml
File metadata and controls
197 lines (181 loc) · 6.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
//@ pragma UseQApplication
//@ pragma Env QS_NO_RELOAD_POPUP=1
//@ pragma Env INIR_STANDALONE_WINDOW=1
//@ pragma Env QT_QUICK_CONTROLS_STYLE=Basic
//@ pragma Env QT_QUICK_FLICKABLE_WHEEL_DECELERATION=10000
// Launcher keeps QT_SCALE_FACTOR=1; shell scaling lives in appearance.typography.sizeScale
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window
import Quickshell
import Quickshell.Io
import qs.services
import qs.modules.common
import qs.modules.common.widgets
import qs.modules.common.functions
ApplicationWindow {
id: root
property int conflictCount: 0
onConflictCountChanged: {
if (conflictCount === 0) {
root.close();
}
}
property real contentPadding: 8
visible: true
onClosing: {
Qt.quit()
}
title: Translation.tr("Shell conflicts killer")
Component.onCompleted: {
Quickshell.watchFiles = false;
Config.readWriteDelay = 0;
Config.blockWrites = true;
MaterialThemeLoader.reapplyTheme();
}
minimumWidth: 400
minimumHeight: 300
maximumWidth: 400
maximumHeight: 300
width: 400
height: 300
color: Appearance.m3colors.m3background
component ConflictingProgramGroup: ColumnLayout {
id: conflictGroup
required property list<string> programs
required property string description
visible: false
onVisibleChanged: {
conflictCount += visible ? 1 : -1
}
signal alwaysSelected()
Process {
running: true
command: ["/usr/bin/pidof", ...conflictGroup.programs]
onExited: (exitCode, exitStatus) => {
if (exitCode === 0) {
conflictGroup.visible = true
}
}
}
StyledText {
text: conflictGroup.programs.join(", ")
font.pixelSize: Appearance.font.pixelSize.normal
}
StyledText {
font {
pixelSize: Appearance.font.pixelSize.smaller
italic: true
}
text: conflictGroup.description
color: Appearance.colors.colSubtext
}
RowLayout {
Layout.alignment: Qt.AlignRight
RippleButton {
colBackground: Appearance.colors.colLayer2
contentItem: StyledText {
text: Translation.tr("Always")
}
onClicked: {
Quickshell.execDetached(["/usr/bin/killall", ...conflictGroup.programs])
conflictGroup.alwaysSelected()
conflictGroup.visible = false
}
}
RippleButton {
colBackground: Appearance.colors.colLayer2
contentItem: StyledText {
text: Translation.tr("Yes")
}
onClicked: {
Quickshell.execDetached(["/usr/bin/killall", ...conflictGroup.programs])
conflictGroup.visible = false
}
}
RippleButton {
colBackground: Appearance.colors.colLayer2
contentItem: StyledText {
text: Translation.tr("No")
}
onClicked: conflictGroup.visible = false
}
}
}
ColumnLayout {
anchors {
fill: parent
margins: contentPadding
}
Item {
// Titlebar
visible: Config.options?.windows.showTitlebar
Layout.fillWidth: true
implicitHeight: Math.max(welcomeText.implicitHeight, windowControlsRow.implicitHeight)
StyledText {
id: welcomeText
anchors {
left: Config.options.windows.centerTitle ? undefined : parent.left
horizontalCenter: Config.options.windows.centerTitle ? parent.horizontalCenter : undefined
verticalCenter: parent.verticalCenter
leftMargin: 12
}
color: Appearance.colors.colOnLayer0
text: Translation.tr("Kill conflicting programs?")
font {
family: Appearance.font.family.title
pixelSize: Appearance.font.pixelSize.title
variableAxes: Appearance.font.variableAxes.title
}
}
RowLayout { // Window controls row
id: windowControlsRow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
RippleButton {
buttonRadius: Appearance.rounding.full
implicitWidth: 35
implicitHeight: 35
onClicked: root.close()
contentItem: MaterialSymbol {
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
text: "close"
iconSize: 20
}
}
}
}
Rectangle {
// Content container
color: Appearance.m3colors.m3surfaceContainerLow
radius: Appearance.rounding.windowRounding - root.contentPadding
implicitHeight: contentColumn.implicitHeight
implicitWidth: contentColumn.implicitWidth
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout {
id: contentColumn
anchors.fill: parent
spacing: 12
ConflictingProgramGroup {
id: kded6Group
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: false
programs: ["kded6"]
description: Translation.tr("Conflicts with the shell's system tray implementation")
onAlwaysSelected: Config.setNestedValue("conflictKiller.autoKillTrays", true)
}
ConflictingProgramGroup {
id: notificationDaemons
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: false
programs: ["mako", "dunst"]
description: Translation.tr("Conflicts with the shell's notification implementation")
onAlwaysSelected: Config.setNestedValue("conflictKiller.autoKillNotificationDaemons", true)
}
}
}
}
}