summaryrefslogtreecommitdiff
path: root/Quickshell.md
blob: a0401f469643971ba2d8aace24d041aa26f29648 (plain)
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
https://quickshell.org

XDG standard config paths. Looks for `shell.qml` in all sub-directories unless root dir has one. Target specific config using `quickshell -c configname`.

# Windows
Requires `import Quickshell`.
Types:
- PanelWindow: for bars, widgets and overlays
- FloatingWindow: standard desktop windows

[Type reference](https://quickshell.org/docs/types/Quickshell/PanelWindow)

# Text
[Text](https://doc.qt.io/qt-6/qml-qtquick-text.html) requires `import QtQuick.
Set `id: somename` to reference by `somename`, ie `somename.text = "blaat"`

Strings can be concat using `+`
# Processes
Requires `import Quickshell.Io` (NOTE the capital I in Io)

[Process](https://quickshell.org/docs/types/quickshell.io/process) object runs commands.
[StdioCollector](https://quickshell.org/docs/types/Quickshell.Io/StdioCollector) reads process' output.

Use a [Timer](https://doc.qt.io/qt-6/qml-qtqml-timer.html) to run Process on an interval.

# Component
A reusable tree of objects.
[Variants](https://quickshell.org/docs/types/Quickshell/Variants) creates instances of a component based on user supplied data. For example this used to create instances of a window based on the monitor list.

To prevent many of the same processes when we reuse a component many times use `Scope` to move them outside of the reused component.
We can use a [Property Definition](https://quickshell.org/docs/configuration/qml-overview/#property-definitions) on the parent scope to communicate between components in different scopes but in the same parent scope. Properties are reactive.

# Multiple files
shell.qml is the root. If a filename starts with a capital letter it can be referenced. E.g Bar.qml
```
Scope {
	Bar {}
}
```

Other folders can be imported using `import` statements.

# Singleton
Has only one instance that is accessible from every scope. For example the date process in the bar.

Set `pragma Singleton` at the top of the file ( before imports ). and Use `Singleton` type.


[Clock formatting](https://doc.qt.io/qt-6/qml-qtqml-qt.html#formatDateTime-method)