Skip to content

Commit 572abdc

Browse files
Merge remote-tracking branch 'upstream/master' into webview
2 parents 9945246 + fc704e6 commit 572abdc

27 files changed

+1596
-23
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
libxcb \
5454
libpipewire \
5555
cli11 \
56+
polkit \
5657
jemalloc
5758
5859
- name: Build

BUILD.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ To disable: `-DSERVICE_PAM=OFF`
192192

193193
Dependencies: `pam`
194194

195+
### Polkit
196+
This feature enables creating Polkit agents that can prompt user for authentication.
197+
198+
To disable: `-DSERVICE_POLKIT=OFF`
199+
200+
Dependencies: `polkit`, `glib`
201+
195202
### Hyprland
196203
This feature enables hyprland specific integrations. It requires wayland support
197204
but has no extra dependencies.

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ boption(SERVICE_STATUS_NOTIFIER "System Tray" ON)
6767
boption(SERVICE_PIPEWIRE "PipeWire" ON)
6868
boption(SERVICE_MPRIS "Mpris" ON)
6969
boption(SERVICE_PAM "Pam" ON)
70+
boption(SERVICE_POLKIT "Polkit" ON)
7071
boption(SERVICE_GREETD "Greetd" ON)
7172
boption(SERVICE_UPOWER "UPower" ON)
7273
boption(SERVICE_NOTIFICATIONS "Notifications" ON)

changelog/next.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
## Breaking Changes
2+
3+
### Config paths are no longer canonicalized
4+
5+
This fixes nix configs changing shell-ids on rebuild as the shell id is now derived from
6+
the symlink path. Configs with a symlink in their path will have a different shell id.
7+
8+
Shell ids are used to derive the default config / state / cache folders, so those files
9+
will need to be manually moved if using a config behind a symlinked path without an explicitly
10+
set shell id.
11+
112
## New Features
213

14+
- Added support for creating Polkit agents.
315
- Added support for creating wayland idle inhibitors.
416
- Added support for wayland idle timeouts.
517
- Added the ability to override Quickshell.cacheDir with a custom path.
@@ -11,3 +23,8 @@
1123
## Bug Fixes
1224

1325
- Fixed volume control breaking with pipewire pro audio mode.
26+
- Fixed escape sequence handling in desktop entries.
27+
28+
## Packaging Changes
29+
30+
`glib` and `polkit` have been added as dependencies when compiling with polkit agent support.

default.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
libgbm ? null,
2222
pipewire,
2323
pam,
24+
polkit,
25+
glib,
2426

2527
gitRev ? (let
2628
headExists = builtins.pathExists ./.git/HEAD;
@@ -43,6 +45,7 @@
4345
withPam ? true,
4446
withHyprland ? true,
4547
withI3 ? true,
48+
withPolkit ? true,
4649
}: let
4750
unwrapped = stdenv.mkDerivation {
4851
pname = "quickshell${lib.optionalString debug "-debug"}";
@@ -76,7 +79,8 @@
7679
++ lib.optionals (withWayland && libgbm != null) [ libdrm libgbm ]
7780
++ lib.optional withX11 xorg.libxcb
7881
++ lib.optional withPam pam
79-
++ lib.optional withPipewire pipewire;
82+
++ lib.optional withPipewire pipewire
83+
++ lib.optionals withPolkit [ polkit glib ];
8084

8185
cmakeBuildType = if debug then "Debug" else "RelWithDebInfo";
8286

@@ -91,6 +95,7 @@
9195
(lib.cmakeBool "SCREENCOPY" (libgbm != null))
9296
(lib.cmakeBool "SERVICE_PIPEWIRE" withPipewire)
9397
(lib.cmakeBool "SERVICE_PAM" withPam)
98+
(lib.cmakeBool "SERVICE_POLKIT" withPolkit)
9499
(lib.cmakeBool "HYPRLAND" withHyprland)
95100
(lib.cmakeBool "I3" withI3)
96101
];

quickshell.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
libxcb
4343
libxkbcommon
4444
linux-pam
45+
polkit
4546
mesa
4647
pipewire
4748
qtbase

src/core/desktopentry.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,22 @@ QVector<QString> DesktopEntry::parseExecString(const QString& execString) {
269269
currentArgument += '\\';
270270
escape = 0;
271271
}
272+
} else if (escape == 2) {
273+
currentArgument += c;
274+
escape = 0;
272275
} else if (escape != 0) {
273-
if (escape != 2) {
274-
// Technically this is an illegal state, but the spec has a terrible double escape
275-
// rule in strings for no discernable reason. Assuming someone might understandably
276-
// misunderstand it, treat it as a normal escape and log it.
276+
switch (c.unicode()) {
277+
case 's': currentArgument += u' '; break;
278+
case 'n': currentArgument += u'\n'; break;
279+
case 't': currentArgument += u'\t'; break;
280+
case 'r': currentArgument += u'\r'; break;
281+
case '\\': currentArgument += u'\\'; break;
282+
default:
277283
qCWarning(logDesktopEntry).noquote()
278284
<< "Illegal escape sequence in desktop entry exec string:" << execString;
285+
currentArgument += c;
286+
break;
279287
}
280-
281-
currentArgument += c;
282288
escape = 0;
283289
} else if (c == u'"' || c == u'\'') {
284290
parsingString = false;

src/core/scan.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919

2020
QS_LOGGING_CATEGORY(logQmlScanner, "quickshell.qmlscanner", QtWarningMsg);
2121

22-
void QmlScanner::scanDir(const QString& path) {
23-
if (this->scannedDirs.contains(path)) return;
24-
this->scannedDirs.push_back(path);
22+
void QmlScanner::scanDir(const QDir& dir) {
23+
if (this->scannedDirs.contains(dir)) return;
24+
this->scannedDirs.push_back(dir);
25+
26+
const auto& path = dir.path();
2527

2628
qCDebug(logQmlScanner) << "Scanning directory" << path;
27-
auto dir = QDir(path);
2829

2930
struct Entry {
3031
QString name;
@@ -163,10 +164,10 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna
163164
qCDebug(logQmlScanner) << "Found imports" << imports;
164165
}
165166

166-
auto currentdir = QDir(QFileInfo(path).canonicalPath());
167+
auto currentdir = QDir(QFileInfo(path).absolutePath());
167168

168169
// the root can never be a singleton so it dosent matter if we skip it
169-
this->scanDir(currentdir.path());
170+
this->scanDir(currentdir);
170171

171172
for (auto& import: imports) {
172173
QString ipath;
@@ -179,9 +180,9 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna
179180
}
180181

181182
auto pathInfo = QFileInfo(ipath);
182-
auto cpath = pathInfo.canonicalFilePath();
183+
auto cpath = pathInfo.absoluteFilePath();
183184

184-
if (cpath.isEmpty()) {
185+
if (!pathInfo.exists()) {
185186
qCWarning(logQmlScanner) << "Ignoring unresolvable import" << ipath << "from" << path;
186187
continue;
187188
}

src/core/scan.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ class QmlScanner {
1616
QmlScanner() = default;
1717
QmlScanner(const QDir& rootPath): rootPath(rootPath) {}
1818

19-
// path must be canonical
20-
void scanDir(const QString& path);
21-
19+
void scanDir(const QDir& dir);
2220
void scanQmlRoot(const QString& path);
2321

24-
QVector<QString> scannedDirs;
22+
QVector<QDir> scannedDirs;
2523
QVector<QString> scannedFiles;
2624
QHash<QString, QString> fileIntercepts;
2725

src/launch/command.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ int locateConfigFile(CommandState& cmd, QString& path) {
110110
}
111111

112112
if (split[0].trimmed() == *cmd.config.name) {
113-
path = QDir(QFileInfo(file).canonicalPath()).filePath(split[1].trimmed());
113+
path = QDir(QFileInfo(file).absolutePath()).filePath(split[1].trimmed());
114114
break;
115115
}
116116
}
@@ -140,8 +140,7 @@ int locateConfigFile(CommandState& cmd, QString& path) {
140140
return -1;
141141
}
142142

143-
path = QFileInfo(path).canonicalFilePath();
144-
return 0;
143+
goto rpath;
145144
}
146145
}
147146

@@ -154,7 +153,8 @@ int locateConfigFile(CommandState& cmd, QString& path) {
154153
return -1;
155154
}
156155

157-
path = QFileInfo(path).canonicalFilePath();
156+
rpath:
157+
path = QFileInfo(path).absoluteFilePath();
158158
return 0;
159159
}
160160

0 commit comments

Comments
 (0)