-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.qml
More file actions
140 lines (120 loc) · 5.96 KB
/
Config.qml
File metadata and controls
140 lines (120 loc) · 5.96 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
pragma Singleton
import Quickshell
import QtQuick
import qs
Singleton {
// check
readonly property bool settingsAvailable: typeof Settings !== 'undefined'
// general
property var general: QtObject {
// see https://doc.qt.io/qt-6/qlocale.html
property string locale: getSetting("general.locale", "AnyTerritory")
property string fontFamily: getSetting("general.font", "Hack Nerd Font")
property int fontSize: getSetting("general.fontSize", 14)
property int borderWidth: getSetting("general.borderWidth", 0)
property int cornerRadius: getSetting("general.radius", 8)
property int animDuration: getSetting("general.animDuration", 250)
property string wallpaper: getSetting("general.wallpaper", States.defaultWallpaper)
}
// colors
property var colors: QtObject {
property color bg: getSetting("colors.bg", "#aa000000")
property color bgl: getSetting("colors.bgl", "#80404040")
property color bge: getSetting("colors.bge", "#000000") // eco mode
property color fg: getSetting("colors.fg", "#b0b4bc")
property color border: getSetting("colors.border", "#aa4e4e4e")
property color passive: getSetting("colors.passive", "#4e4e4e")
property color dark: getSetting("colors.dark", Qt.darker(passive, 1.5))
property color extraDark: getSetting("colors.extraDark", Qt.darker(dark, 1.2))
property color action: getSetting("colors.action", "#0db9d7")
property color accent: getSetting("colors.accent", "#cc0000")
property color red: getSetting("colors.red", "#cc0000")
property color yellow: getSetting("colors.yellow", "#ffd700")
property color purple: getSetting("colors.purple", "#bf00ff")
property color green: getSetting("colors.green", "#9ece6a")
}
// bar
property var bar: QtObject {
property int height: getSetting("bar.height", 30)
// should be in sync with the compositor's (outer) gaps
property int padding: getSetting("bar.padding", 8)
property var title: QtObject {
property int width: getSetting("bar.title.width", 400)
property string empty: getSetting("bar.title.empty", "")
}
}
property var desktop: QtObject {
property bool launcher: getSetting("desktop.launcher", true)
property bool osd: getSetting("desktop.osd", false)
}
property var dashboard: QtObject {
property var player: QtObject {
property bool queueButtons: getSetting("dashboard.player.queueButtons", false)
}
}
property var notifications: QtObject {
property bool enabled: getSetting("notifications.enabled", true)
property int width: getSetting("notifications.width", 300)
}
// widgets
property var widgets: QtObject {
property bool workspaces: getSetting("widgets.workspaces", true)
property bool title: getSetting("widgets.title", true)
property bool stats: getSetting("widgets.stats", false)
property bool audio: getSetting("widgets.audio", true)
property bool bluetooth: getSetting("widgets.bluetooth", false)
property bool network: getSetting("widgets.network", false)
property bool tray: getSetting("widgets.tray", false)
property bool weather: getSetting("widgets.weather", true)
property bool language: getSetting("widgets.language", false)
property bool clock: getSetting("widgets.clock", true)
property bool battery: getSetting("widgets.battery", true)
}
// lockscreen
property var lockscreen: QtObject {
property string wallpaper: getSetting("lockscreen.wallpaper", States.defaultWallpaper)
property bool buttons: getSetting("lockscreen.buttons", true)
property bool clock: getSetting("lockscreen.clock", true)
property bool battery: getSetting("lockscreen.battery", true)
property bool shadows: getSetting("lockscreen.shadows", true)
property bool username: getSetting("lockscreen.username", true) // full name
property bool icon: getSetting("lockscreen.icon", true) // user icon
}
// session
property var session: QtObject {
property color background: getSetting("logout.color", "#aa202020")
property var commands: QtObject {
property string lock: getSetting("logout.commands.lock", "quickshell ipc call topbar lock")
property string logout: getSetting("logout.commands.logout", "pkill mango | hyprctl dispatch exit")
property string suspend: getSetting("logout.commands.suspend", "zzz")
property string hibernate: getSetting("logout.commands.hibernate", "acpiconf -s 4")
property string shutdown: getSetting("logout.commands.shutdown", "shutdown -p now")
property string reboot: getSetting("logout.commands.reboot", "shutdown -r now")
}
}
// workspaces
property var workspaces: QtObject {
property string one: getSetting("workspaces.one", "1")
property string two: getSetting("workspaces.two", "2")
property string three: getSetting("workspaces.three", "3")
property string four: getSetting("workspaces.four", "4")
property string five: getSetting("workspaces.five", "5")
property string six: getSetting("workspaces.six", "6")
property string seven: getSetting("workspaces.seven", "7")
property string eight: getSetting("workspaces.eight", "8")
property string nine: getSetting("workspaces.nine", "9")
property string ten: getSetting("workspaces.ten", "0")
}
function getSetting(path, defaultValue) {
if (!settingsAvailable)
return defaultValue;
var obj = Settings;
var parts = path.split('.');
for (var i = 0; i < parts.length; i++) {
if (obj === undefined || obj === null)
return defaultValue;
obj = obj[parts[i]];
}
return obj ?? defaultValue;
}
}