Fix keymap.lua syntax (binding before return), remove broken bar-widget, bar clean

swadhinbiswas committed 2 months ago
d9078af
1 parent 9da17d3
commit d9078af
9 files changed
+0 -636
▼config/hypr/deo-autostart.lua
+0-21
1
-
2
-local function kill_old_shell()
3
- hl.exec_cmd(
4
- "pkill -f 'quickshell.*-c moonshell' 2>/dev/null"
5
- .. "; pkill -f 'moonshell shell' 2>/dev/null"
6
- .. "; pkill -x hypridle 2>/dev/null"
7
- .. "; pkill -f 'wl-paste --type text --watch cliphist' 2>/dev/null"
8
- .. "; pkill -f 'wl-paste --type image --watch cliphist' 2>/dev/null"
9
- .. "; wl-paste --type text --watch cliphist store &"
10
- .. "; wl-paste --type image --watch cliphist store &"
11
- .. "; true"
12
- )
13
-end
14
-
15
-hl.on("hyprland.start", function()
16
- kill_old_shell()
17
- require("default.hypr.autostart")
18
-end)
19
-
20
-kill_old_shell()
21
-hl.exec_cmd("omarchy-launch-shell")
22
0
▼config/hypr/deo-bindings.lua
+0-113
1
-
2
-o.bind("SUPER + J", "Toggle window split", hl.dsp.layout("togglesplit"))
3
-o.bind("SUPER + P", "Pseudo window", hl.dsp.window.pseudo())
4
-o.bind("SUPER + O", "Pop window out (float & pin)", "omarchy-hyprland-window-pop")
5
-o.bind("SUPER + CTRL + F", "Tiled full screen", "omarchy-hyprland-window-tiled-fullscreen-toggle")
6
-o.bind("SUPER + ALT + F", "Full width", hl.dsp.window.fullscreen({ mode = "maximized" }))
7
-o.bind("SUPER + ALT + Home", "Save window width", "omarchy-hyprland-window-width save")
8
-o.bind("SUPER + Home", "Restore window width", "omarchy-hyprland-window-width restore")
9
-o.bind("SUPER + G", "Toggle grouping", hl.dsp.group.toggle())
10
-o.bind("SUPER + ALT + SHIFT + TAB", "Previous in group", hl.dsp.group.prev())
11
-o.bind("SUPER + CTRL + LEFT", "Move group focus left", hl.dsp.group.prev())
12
-o.bind("SUPER + CTRL + RIGHT", "Move group focus right", hl.dsp.group.next())
13
-o.bind("SUPER + ALT + mouse_down", "Next in group", hl.dsp.group.next())
14
-o.bind("SUPER + ALT + mouse_up", "Previous in group", hl.dsp.group.prev())
15
-for i = 1, 5 do
16
- o.bind("SUPER + ALT + code:" .. tostring(10 + i), "Switch to group window " .. i, hl.dsp.group.active({ index = i }))
17
-end
18
-o.bind("SUPER + SLASH", "Monitor scaling up", "omarchy-hyprland-monitor-scaling up")
19
-o.bind("SUPER + ALT + SLASH", "Monitor scaling down", "omarchy-hyprland-monitor-scaling down")
20
-
21
-o.bind("SUPER + TAB", "Next workspace", hl.dsp.focus({ workspace = "e+1" }))
22
-o.bind("SUPER + SHIFT + TAB", "Previous workspace", hl.dsp.focus({ workspace = "e-1" }))
23
-o.bind("SUPER + CTRL + TAB", "Former workspace", hl.dsp.focus({ workspace = "previous" }))
24
-
25
-o.bind("SUPER + S", "Toggle scratchpad", hl.dsp.workspace.toggle_special("scratchpad"))
26
-o.bind("SUPER + ALT + S", "Move window to scratchpad", hl.dsp.window.move({ workspace = "special:scratchpad", follow = false }))
27
-o.bind("SUPER + grave", "Toggle scratchpad", hl.dsp.workspace.toggle_special("scratchpad"))
28
-o.bind("SUPER + SHIFT + grave", "Move window to scratchpad", hl.dsp.window.move({ workspace = "special:scratchpad", follow = false }))
29
-
30
-o.bind("SUPER + SHIFT + ALT + LEFT", "Move workspace to left monitor", hl.dsp.workspace.move({ monitor = "l" }))
31
-o.bind("SUPER + SHIFT + ALT + RIGHT", "Move workspace to right monitor", hl.dsp.workspace.move({ monitor = "r" }))
32
-o.bind("SUPER + SHIFT + ALT + UP", "Move workspace to up monitor", hl.dsp.workspace.move({ monitor = "u" }))
33
-o.bind("SUPER + SHIFT + ALT + DOWN", "Move workspace to down monitor", hl.dsp.workspace.move({ monitor = "d" }))
34
-
35
-o.bind("ALT + TAB", "Focus on next window", hl.dsp.window.cycle_next())
36
-o.bind("ALT + SHIFT + TAB", "Focus on previous window", hl.dsp.window.cycle_next({ next = false }))
37
-o.bind("CTRL + ALT + TAB", "Focus on next monitor", hl.dsp.focus({ monitor = "+1" }))
38
-o.bind("CTRL + ALT + SHIFT + TAB", "Focus on previous monitor", hl.dsp.focus({ monitor = "-1" }))
39
-
40
-o.bind("SUPER + code:20", "Expand window left", hl.dsp.window.resize({ x = -100, y = 0, relative = true }))
41
-o.bind("SUPER + code:21", "Shrink window left", hl.dsp.window.resize({ x = 100, y = 0, relative = true }))
42
-o.bind("SUPER + SHIFT + code:20", "Shrink window up", hl.dsp.window.resize({ x = 0, y = -100, relative = true }))
43
-o.bind("SUPER + SHIFT + code:21", "Expand window down", hl.dsp.window.resize({ x = 0, y = 100, relative = true }))
44
-o.bind("SUPER + ALT + code:20", "Expand window left a little", hl.dsp.window.resize({ x = -25, y = 0, relative = true }))
45
-o.bind("SUPER + ALT + code:21", "Shrink window left a little", hl.dsp.window.resize({ x = 25, y = 0, relative = true }))
46
-o.bind("SUPER + SHIFT + ALT + code:20", "Shrink window up a little", hl.dsp.window.resize({ x = 0, y = -25, relative = true }))
47
-o.bind("SUPER + SHIFT + ALT + code:21", "Expand window down a little", hl.dsp.window.resize({ x = 0, y = 25, relative = true }))
48
-o.bind("SUPER + CTRL + code:20", "Expand window left a lot", hl.dsp.window.resize({ x = -300, y = 0, relative = true }))
49
-o.bind("SUPER + CTRL + code:21", "Shrink window left a lot", hl.dsp.window.resize({ x = 300, y = 0, relative = true }))
50
-o.bind("SUPER + CTRL + SHIFT + code:20", "Shrink window up a lot", hl.dsp.window.resize({ x = 0, y = -300, relative = true }))
51
-o.bind("SUPER + CTRL + SHIFT + code:21", "Expand window down a lot", hl.dsp.window.resize({ x = 0, y = 300, relative = true }))
52
-
53
-o.bind("SUPER + mouse_down", "Scroll active workspace forward", hl.dsp.focus({ workspace = "e+1" }))
54
-o.bind("SUPER + mouse_up", "Scroll active workspace backward", hl.dsp.focus({ workspace = "e-1" }))
55
-
56
-o.bind("SUPER + SHIFT + M", "Omarchy menu", "omarchy-menu toggle")
57
-o.bind("SUPER + ALT + SPACE", "Apps menu", "omarchy-menu toggle apps")
58
-o.bind("SUPER + CTRL + E", "Emojis", "omarchy-shell shell toggle omarchy.emojis")
59
-o.bind("SUPER + CTRL + O", "Toggle menu", "omarchy-menu toggle toggle")
60
-o.bind("SUPER + CTRL + H", "Hardware menu", "omarchy-menu toggle hardware")
61
-o.bind("SUPER + SHIFT + code:201", "Omarchy menu", "omarchy-menu toggle root")
62
-o.bind("SUPER + K", "Keybindings", "omarchy-menu-keybindings")
63
-o.bind("SUPER + ALT + K", "Tmux keybindings", "omarchy-menu-tmux-keybindings")
64
-o.bind("SUPER + CTRL + K", "Herdr keybindings", "omarchy-menu-herdr-keybindings")
65
-o.bind("SUPER + CTRL + Q", "Calculator", "omacalc")
66
-o.bind("XF86Calculator", "Calculator", "omacalc")
67
-o.bind("XF86PowerOff", "Power menu", "omarchy-menu toggle system", { locked = true })
68
-
69
-o.bind("SUPER + CTRL + SPACE", "Background switcher", "omarchy-menu toggle background")
70
-o.bind("SUPER + SHIFT + CTRL + SPACE", "Theme menu", "omarchy-menu toggle theme")
71
-o.bind("SUPER + CTRL + A", "Audio panel", "omarchy-shell shell toggle omarchy.audio")
72
-o.bind("SUPER + CTRL + B", "Bluetooth panel", "omarchy-shell shell toggle omarchy.bluetooth")
73
-o.bind("SUPER + CTRL + D", "Display panel", "omarchy-shell shell toggle omarchy.monitor")
74
-o.bind("SUPER + CTRL + ALT + D", "Calendar panel", "omarchy-shell shell toggle omarchy.clock")
75
-o.bind("SUPER + CTRL + W", "Network panel", "omarchy-shell shell toggle omarchy.network")
76
-o.bind("SUPER + CTRL + P", "Power panel", "omarchy-shell shell toggle omarchy.power")
77
-o.bind("SUPER + CTRL + T", "Activity (btop)", "{ tui = \"btop\" }")
78
-for i = 1, 9 do
79
- o.bind("SUPER + CTRL + code:" .. tostring(10 + i), "Bar panel " .. i, "omarchy-shell -q shell togglePanelAt right " .. i)
80
-end
81
-
82
-o.bind("SUPER + comma", "Dismiss last notification", "omarchy-shell notifications dismissOne")
83
-o.bind("SUPER + ALT + comma", "Invoke last notification", "omarchy-shell notifications invokeLast")
84
-o.bind("SUPER + SHIFT + ALT + comma", "Open notification history", "omarchy-shell notifications showHistory")
85
-o.bind_toggle("SUPER + CTRL + comma", "Toggle silencing notifications", "notification-silencing")
86
-
87
-o.bind_toggle("SUPER + CTRL + I", "Toggle locking on idle", "idle")
88
-o.bind_toggle("SUPER + CTRL + N", "Toggle nightlight", "nightlight")
89
-o.bind("SUPER + BACKSPACE", "Toggle window transparency", "omarchy-hyprland-window-transparency-toggle")
90
-o.bind("SUPER + SHIFT + BACKSPACE", "Toggle window gaps", "omarchy-hyprland-window-gaps-toggle")
91
-o.bind("SUPER + CTRL + BACKSPACE", "Toggle single-window square aspect", "omarchy-hyprland-window-single-square-aspect-toggle")
92
-
93
-o.bind("SUPER + CTRL + Z", "Zoom in", "omarchy-hyprland-cursor-zoom in")
94
-o.bind("SUPER + CTRL + ALT + Z", "Reset zoom", "omarchy-hyprland-cursor-zoom reset")
95
-
96
-o.bind("SUPER + CTRL + ALT + R", "Show reminders", "omarchy-reminder show")
97
-o.bind("SUPER + SHIFT + CTRL + R", "Clear reminders", "omarchy-reminder clear")
98
-o.bind("SUPER + CTRL + ALT + T", "Show time", "omarchy-notification-time")
99
-o.bind("SUPER + CTRL + ALT + B", "Show battery remaining", "omarchy-notification-battery")
100
-o.bind("SUPER + CTRL + ALT + W", "Toggle weather", "omarchy-notification-weather")
101
-
102
-o.bind("PRINT", "Screenshot", "omarchy-capture-screenshot")
103
-o.bind("ALT + PRINT", "Screenrecording", "omarchy-capture-screenrecording --stop-recording || omarchy-menu toggle trigger.capture.screenrecord")
104
-o.bind("SUPER + PRINT", "Color picker", "pkill hyprpicker || hyprpicker -a")
105
-o.bind("SUPER + CTRL + PRINT", "Extract text (OCR) from screenshot", "omarchy-capture-text")
106
-o.bind("SUPER + CTRL + PERIOD", "Transcode", "omarchy-transcode")
107
-
108
-o.bind("SUPER + SHIFT + CTRL + A", "Agent", "omarchy-agent --pick")
109
-
110
-o.bind("switch:on:Lid Switch", nil, "omarchy-system-lid-close", { locked = true })
111
-o.bind("switch:off:Lid Switch", nil, "omarchy-hyprland-monitor-clamshell", { locked = true })
112
-o.bind("SUPER + CTRL + Delete", "Toggle laptop display", "omarchy-hyprland-monitor-internal toggle")
113
-o.bind("SUPER + CTRL + ALT + Delete", "Toggle laptop display mirroring", "omarchy-hyprland-monitor-internal-mirror toggle")
114
0
▼config/hypr/deo-layer.lua
+0-16
1
-
2
-local require_optional = require("default.hypr.require_optional")
3
-
4
-require("default.hypr.helpers")
5
-
6
-require("default.hypr.envs")
7
-
8
-require("default.hypr.looknfeel")
9
-
10
-require_optional.module("omarchy.current.theme.hyprland")
11
-
12
-require("default.hypr.windows")
13
-
14
-require("hypr.deo-bindings")
15
-
16
-require("hypr.deo-autostart")
17
0
▼shell/plugins/monitormgr/Model.js
+0-91
1
-// Monitor management functions
2
-// Reads hyprctl JSON, sends commands to configure monitors
3
-
4
-function parseMonitors(jsonStr) {
5
- try {
6
- var monitors = JSON.parse(jsonStr)
7
- var result = []
8
- for (var i = 0; i < monitors.length; i++) {
9
- var m = monitors[i]
10
- var transform = m.transform || 0
11
- var rotation = [0, 90, 180, 270][transform % 4]
12
- result.push({
13
- name: m.name || "",
14
- description: m.description || "",
15
- width: m.width || 0,
16
- height: m.height || 0,
17
- refreshRate: Math.round(m.refreshRate || 0),
18
- x: m.x || 0,
19
- y: m.y || 0,
20
- scale: m.scale || 1,
21
- transform: transform,
22
- rotation: rotation,
23
- focused: !!m.focused,
24
- activeWorkspace: m.activeWorkspace ? m.activeWorkspace.id : -1,
25
- make: m.make || "",
26
- model: m.model || ""
27
- })
28
- }
29
- return result
30
- } catch (e) {
31
- return []
32
- }
33
-}
34
-
35
-function rotationToTransform(degrees) {
36
- var map = { 0: 0, 90: 1, 180: 2, 270: 3 }
37
- return map[degrees] || 0
38
-}
39
-
40
-function setMonitorPosition(name, x, y) {
41
- return "hyprctl keyword monitor " + name + ",preferred," + x + "x" + y + ",1"
42
-}
43
-
44
-function setMonitorScale(name, scale) {
45
- return "hyprctl keyword monitor " + name + ",preferred,auto," + scale
46
-}
47
-
48
-function setMonitorRotation(name, transform) {
49
- return "hyprctl keyword monitor " + name + ",preferred,auto,1,transform," + transform
50
-}
51
-
52
-function setMonitorConfig(name, mode, x, y, scale, transform) {
53
- var pos = x + "x" + y
54
- var cmd = "hyprctl keyword monitor " + name + "," + mode + "," + pos + "," + scale
55
- if (transform && transform !== 0) {
56
- cmd += ",transform," + transform
57
- }
58
- return cmd
59
-}
60
-
61
-function getBrightnessPath(monitorName) {
62
- // DDC/CI path via i2c
63
- var base = "/sys/class/backlight/"
64
- // Try to match by connector name
65
- var paths = [
66
- "/sys/class/backlight/amdgpu_bl1/brightness",
67
- "/sys/class/backlight/intel_backlight/brightness",
68
- "/sys/class/backlight/acpi_video0/brightness"
69
- ]
70
- for (var i = 0; i < paths.length; i++) {
71
- if (typeof paths[i] === "string") return paths[i]
72
- }
73
- return ""
74
-}
75
-
76
-function getBrightnessMax(path) {
77
- var maxPath = path.replace("/brightness", "/max_brightness")
78
- return "cat " + maxPath + " 2>/dev/null || echo 100"
79
-}
80
-
81
-function setBrightness(path, percent) {
82
- var maxPath = path.replace("/brightness", "/max_brightness")
83
- return "max=$(cat " + maxPath + " 2>/dev/null || echo 100); "
84
- + "val=$((max * " + percent + " / 100)); "
85
- + "echo $val | tee " + path + " 2>/dev/null"
86
-}
87
-
88
-function setWallpaper(monitorName, wallpaperPath) {
89
- // swww or hyprpaper or omarchy shell background
90
- return "swww img " + wallpaperPath + " 2>/dev/null || true"
91
-}
92
0
▼shell/plugins/monitormgr/Panel.qml
+0-153
1
-import QtQuick
2
-import Quickshell
3
-import Quickshell.Io
4
-import qs.Commons
5
-import qs.Ui
6
-import "Model.js" as Model
7
-
8
-Panel {
9
- id: root
10
- moduleName: "deomarchy.monitormgr"
11
-
12
- property var monitors: []
13
- property string wallpaperDir: Quickshell.env("HOME") + "/.local/state/omarchy/current/theme/backgrounds"
14
- property var wallpapers: []
15
- property int selectedMonitor: 0
16
-
17
- implicitWidth: 420
18
- implicitHeight: contentCol.implicitHeight + Style.spacing.controlPaddingX * 2
19
-
20
- Process {
21
- id: monitorQuery
22
- running: true
23
- command: ["hyprctl", "monitors", "-j"]
24
- stdout: SplitParser {
25
- onRead: function(line) {
26
- root.monitors = Model.parseMonitors(line)
27
- }
28
- }
29
- }
30
-
31
- Process {
32
- id: wpQuery
33
- running: true
34
- command: ["bash", "-c", "ls " + wallpaperDir + " 2>/dev/null || true"]
35
- stdout: SplitParser {
36
- onRead: function(line) {
37
- var t = String(line).trim()
38
- if (t && root.wallpapers.indexOf(t) === -1)
39
- root.wallpapers = root.wallpapers.concat([t])
40
- }
41
- }
42
- }
43
-
44
- Process {
45
- id: actionProc
46
- running: false
47
- onRunningChanged: if (!running) monitorQuery.running = true
48
- }
49
-
50
- function runAction(cmd) {
51
- actionProc.command = ["bash", "-c", cmd]
52
- actionProc.running = true
53
- }
54
-
55
- function rotateMonitor(name, cur) {
56
- runAction(Model.setMonitorRotation(name, (cur + 1) % 4))
57
- }
58
-
59
- function moveMonitor(name, dx, dy, x, y) {
60
- runAction(Model.setMonitorPosition(name, x + dx, y + dy))
61
- }
62
-
63
- Column {
64
- id: contentCol
65
- anchors.fill: parent
66
- anchors.margins: Style.spacing.controlPaddingX
67
- spacing: 8
68
-
69
- Text {
70
- text: "Monitors"
71
- color: Color.foreground
72
- font.family: root.bar ? root.bar.fontFamily : Style.font.family
73
- font.pixelSize: Style.font.heading
74
- font.bold: true
75
- opacity: 0.9
76
- }
77
-
78
- Repeater {
79
- model: root.monitors
80
- delegate: Rectangle {
81
- required property var modelData
82
- property var mon: modelData
83
- width: contentCol.width
84
- height: monCol.implicitHeight + 16
85
- radius: 8
86
- color: mon.focused ? Qt.rgba(Color.accent.r, Color.accent.g, Color.accent.b, 0.15)
87
- : Qt.rgba(1, 1, 1, 0.05)
88
- border.color: mon.focused ? Color.accent : Qt.rgba(1, 1, 1, 0.1)
89
- border.width: mon.focused ? 1 : 0
90
-
91
- Column {
92
- id: monCol
93
- anchors.fill: parent
94
- anchors.margins: 8
95
- spacing: 6
96
-
97
- Text {
98
- text: mon.name + (mon.focused ? " (focused)" : "") + " " + mon.description
99
- color: Color.foreground
100
- font.family: root.bar ? root.bar.fontFamily : Style.font.family
101
- font.pixelSize: Style.font.body
102
- font.bold: true
103
- }
104
-
105
- Text {
106
- text: mon.width + "x" + mon.height + " @ " + mon.refreshRate + "Hz " + mon.rotation + "\u00b0 Scale: " + mon.scale
107
- color: Color.subtext
108
- font.family: root.bar ? root.bar.fontFamily : Style.font.family
109
- font.pixelSize: Style.font.small
110
- }
111
-
112
- Text {
113
- text: "Position: " + mon.x + " x " + mon.y
114
- color: Color.subtext
115
- font.family: root.bar ? root.bar.fontFamily : Style.font.family
116
- font.pixelSize: Style.font.small
117
- }
118
-
119
- Row {
120
- spacing: 6
121
-
122
- Repeater {
123
- model: [
124
- { label: "\u2190", action: function() { root.moveMonitor(mon.name, -1920, 0, mon.x, mon.y) } },
125
- { label: "\u2192", action: function() { root.moveMonitor(mon.name, 1920, 0, mon.x, mon.y) } },
126
- { label: "\u2191", action: function() { root.moveMonitor(mon.name, 0, -1080, mon.x, mon.y) } },
127
- { label: "\u2193", action: function() { root.moveMonitor(mon.name, 0, 1080, mon.x, mon.y) } },
128
- { label: "\u21bb", action: function() { root.rotateMonitor(mon.name, mon.transform) } }
129
- ]
130
- delegate: Rectangle {
131
- width: 36; height: 28; radius: 4
132
- color: moveArea.containsMouse ? Qt.rgba(1,1,1,0.2) : Qt.rgba(1,1,1,0.08)
133
- Text {
134
- anchors.centerIn: parent
135
- text: modelData.label
136
- color: Color.foreground
137
- font.pixelSize: 14
138
- }
139
- MouseArea {
140
- id: moveArea
141
- anchors.fill: parent
142
- hoverEnabled: true
143
- cursorShape: Qt.PointingHandCursor
144
- onClicked: modelData.action()
145
- }
146
- }
147
- }
148
- }
149
- }
150
- }
151
- }
152
- }
153
-}
154
0
▼shell/plugins/monitormgr/manifest.json
+0-19
1
-{
2
- "schemaVersion": 1,
3
- "id": "deomarchy.monitormgr",
4
- "name": "Monitor Manager",
5
- "version": "1.0.0",
6
- "author": "de-omarchy",
7
- "description": "Multi-monitor management: position, rotation, wallpaper, brightness",
8
- "kinds": ["bar-widget"],
9
- "entryPoints": {
10
- "barWidget": "Panel.qml"
11
- },
12
- "barWidget": {
13
- "displayName": "Monitor Manager",
14
- "description": "Position, rotation, wallpaper per monitor",
15
- "category": "System",
16
- "allowMultiple": false,
17
- "defaultSection": "right"
18
- }
19
-}
20
0
▼shell/plugins/sysmon/BarWidget.qml
+0-69
1
-import QtQuick
2
-import Quickshell
3
-import Quickshell.Io
4
-import qs.Commons
5
-import qs.Ui
6
-
7
-BarWidget {
8
- id: root
9
- moduleName: "omarchy.sysmon"
10
-
11
- property int cpuPct: 0
12
- property int memPct: 0
13
- property int diskPct: 0
14
- property int gpuTemp: 0
15
- property int cpuTemp: 0
16
- property string netDown: "0"
17
- property string netUp: "0"
18
-
19
- readonly property string scriptPath: omarchyPath + "/shell/plugins/sysmon/sysmon-stats.sh"
20
-
21
- Process {
22
- id: proc
23
- running: true
24
- command: ["bash", scriptPath]
25
- stdout: SplitParser {
26
- onRead: function(line) {
27
- var m = String(line).match(/C=(\d+) M=(\d+) D=(\d+) G=(\d+) T=(\d+) RX=([\d.]+) TX=([\d.]+)/)
28
- if (m) {
29
- root.cpuPct = parseInt(m[1])
30
- root.memPct = parseInt(m[2])
31
- root.diskPct = parseInt(m[3])
32
- root.gpuTemp = parseInt(m[4])
33
- root.cpuTemp = parseInt(m[5])
34
- root.netDown = m[6]
35
- root.netUp = m[7]
36
- }
37
- }
38
- }
39
- }
40
-
41
- implicitWidth: row.implicitWidth + Style.spacing.controlPaddingX * 2
42
- implicitHeight: barSize
43
- visible: !root.vertical
44
-
45
- Row {
46
- id: row
47
- anchors.verticalCenter: parent.verticalCenter
48
- spacing: 10
49
-
50
- Repeater {
51
- model: [
52
- { icon: "", value: root.cpuPct + "%" },
53
- { icon: "󱋗", value: root.cpuTemp + "\u00b0" },
54
- { icon: "󰗻", value: root.memPct + "%" },
55
- { icon: "󰋓", value: root.diskPct + "%" },
56
- { icon: "󱈘", value: root.gpuTemp + "\u00b0" },
57
- { icon: "󰇣", value: root.netDown + "\u2193" },
58
- { icon: "", value: root.netUp + "\u2191" }
59
- ]
60
- delegate: Text {
61
- text: modelData.icon + " " + modelData.value
62
- color: root.bar ? root.bar.barForeground : Color.foreground
63
- font.family: root.bar ? root.bar.fontFamily : Style.font.family
64
- font.pixelSize: Style.font.body
65
- opacity: 0.85
66
- }
67
- }
68
- }
69
-}
70
0
▼shell/plugins/sysmon/manifest.json
+0-21
1
-{
2
- "schemaVersion": 1,
3
- "id": "omarchy.sysmon",
4
- "name": "System monitor",
5
- "version": "1.0.0",
6
- "author": "de-omarchy",
7
- "description": "CPU, RAM, disk and GPU temperature usage in the bar",
8
- "kinds": [
9
- "bar-widget"
10
- ],
11
- "entryPoints": {
12
- "barWidget": "BarWidget.qml"
13
- },
14
- "barWidget": {
15
- "displayName": "System monitor",
16
- "description": "CPU, RAM, disk, GPU temp readouts",
17
- "category": "System",
18
- "allowMultiple": false,
19
- "defaultSection": "right"
20
- }
21
-}
22
0
▼shell/plugins/sysmon/sysmon-stats.sh
+0-38
1
-#!/bin/bash
2
-prev_cpu=$(awk '/^cpu /{print $2+$3+$4+$5+$6+$7+$8}' /proc/stat)
3
-prev_idle=$(awk '/^cpu /{print $5}' /proc/stat)
4
-prev_rx=$(awk 'NR>2{t+=$2} END{print t+0}' /proc/net/dev)
5
-prev_tx=$(awk 'NR>2{t+=$10} END{print t+0}' /proc/net/dev)
6
-while true; do
7
- sleep 2
8
- cur_cpu=$(awk '/^cpu /{print $2+$3+$4+$5+$6+$7+$8}' /proc/stat)
9
- cur_idle=$(awk '/^cpu /{print $5}' /proc/stat)
10
- dt=$(( cur_cpu - prev_cpu )); di=$(( cur_idle - prev_idle ))
11
- if [ "$dt" -gt 0 ]; then cpu=$(( 100 * (dt - di) / dt )); else cpu=0; fi
12
- prev_cpu=$cur_cpu; prev_idle=$cur_idle
13
- mem=$(awk '/^MemTotal:/{t=$2} /^MemAvailable:/{a=$2} END{printf "%d", (t-a)*100/t}' /proc/meminfo)
14
- dsk=$(df --output=pcent / 2>/dev/null | tail -1 | tr -dc '0-9')
15
- gpu=0
16
- if command -v nvidia-smi >/dev/null 2>&1; then
17
- gpu=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits 2>/dev/null | head -1)
18
- fi
19
- gpu=${gpu:-0}
20
- cputemp=0
21
- for z in /sys/class/thermal/thermal_zone*/temp; do
22
- ztype=$(echo $z | sed 's|/temp||;s|.*/||')
23
- ztype=$(cat /sys/class/thermal/$ztype/type 2>/dev/null)
24
- if [ "$ztype" = "x86_pkg_temp" ] || [ "$ztype" = "coretemp" ]; then
25
- cputemp=$(awk '{printf "%d", $1/1000}' $z)
26
- break
27
- fi
28
- done
29
- if [ "$cputemp" = "0" ]; then
30
- cputemp=$(awk '{printf "%d", $1/1000}' /sys/class/thermal/thermal_zone3/temp 2>/dev/null)
31
- fi
32
- cur_rx=$(awk 'NR>2{t+=$2} END{print t+0}' /proc/net/dev)
33
- cur_tx=$(awk 'NR>2{t+=$10} END{print t+0}' /proc/net/dev)
34
- rx_mbps=$(awk "BEGIN{printf \"%.1f\", ($cur_rx-$prev_rx)/1048576}")
35
- tx_mbps=$(awk "BEGIN{printf \"%.1f\", ($cur_tx-$prev_tx)/1048576}")
36
- prev_rx=$cur_rx; prev_tx=$cur_tx
37
- echo "C=$cpu M=$mem D=${dsk:-0} G=$gpu T=$cputemp RX=$rx_mbps TX=$tx_mbps"
38
-done
39
0